diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c4f3a3c..a4eaa11 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 2a30de9..c123977 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ dist __pycache__ .pytest_cache .mypy_cache +.ruff_cache +.venv .tox dask-worker-space *.egg-info @@ -19,4 +21,4 @@ output.tif.msk .DS_Store *# -*~ \ No newline at end of file +*~ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9fbeff7..6a1327f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,25 +1,24 @@ -exclude: 'docs|test|setup.py' -repos: - - repo: https://github.com/psf/black - rev: 21.7b0 +exclude: "docs" +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 hooks: - - id: black - language_version: python + - id: check-yaml + - id: check-toml + - id: end-of-file-fixer + - id: trailing-whitespace - - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 - hooks: - - id: flake8 - language_version: python - - - repo: https://github.com/PyCQA/pydocstyle - rev: 6.1.1 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.2 hooks: - - id: pydocstyle - language_version: python + - id: ruff + args: [ --fix ] + types_or: [ python, pyi, jupyter ] + + - id: ruff-format + types_or: [ python, pyi, jupyter ] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v0.910' + rev: v1.10.0 hooks: - id: mypy - language_version: python \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4460a5a..c41be43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,20 @@ # CHANGELOG -## v0.2.0 +## v0.3.0 + +### Changed +- New `src/` project structure +- Update depencies to latest major versions. +- Migrate setup metadata and tooling to `pyproject.toml` +- Switch linting and formatting to `ruff` and **reformat everything** +- `mypy` pre-commit and fix typing here and there +- migrate to newer `bump-my-version` package config in `pyproject.toml` to, guess, bump the version + +## Fixed + +- Fix issue with with latest dask versions (>2023.9.2) that made test fail + +## v0.2.0 ### Changed @@ -16,17 +30,17 @@ ### Added -- Worker.read() takes an optional masked parameter, when set to False, ignores +- Worker.read() takes an optional masked parameter, when set to False, ignores dataset mask. ### Fixed -- Fixed inconsistency in between the way cog_worker and rasterio.windows - rounds bounding boxes to pixels and vice-verca, which would occasionally cause +- Fixed inconsistency in between the way cog_worker and rasterio.windows + rounds bounding boxes to pixels and vice-verca, which would occasionally cause gaps in files generated by Manager.chunk_save(). -- Fixed issue where Worker.lnglat_bounds() would fail inverse transforms for +- Fixed issue where Worker.lnglat_bounds() would fail inverse transforms for chunks >10000 px. -- Fixed distributed test suite to be compatible with current behavior of +- Fixed distributed test suite to be compatible with current behavior of dask.distributed. ## v0.1.4 - 2021-11-29 @@ -37,7 +51,7 @@ ### Added -- Add parameter `compute=False` to have DaskManager return Delayed objects +- Add parameter `compute=False` to have DaskManager return Delayed objects instead of computing immediately. ## v0.1.3 - 2021-10-02 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d71099..dd2bdbd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,9 +19,8 @@ Note: requires `pandoc` to build convert jupyter notebooks. 1. Create release candidate branch 2. Run tests `tox` 3. Update changelog - 4. Bump to new version `bump2version [major/minor/patch]` + 4. Bump to new version `bump-my-version [major/minor/patch]` 5. Build docs `cd sphinx_docs && make ghpages` 6. Commit docs 7. Merge to `main` 8. Publish to pypi `tox -e release` - diff --git a/LICENSE.md b/LICENSE.txt similarity index 100% rename from LICENSE.md rename to LICENSE.txt diff --git a/README.md b/README.md index a97abaa..5b61c61 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Scalable geospatial analysis on Cloud Optimized GeoTIFFs. - **PyPI**: https://pypi.org/project/cog-worker cog_worker is a simple library to help write scripts to conduct scaleable -analysis of gridded data. It's intended to be useful for moderate- to large-scale +analysis of gridded data. It's intended to be useful for moderate- to large-scale GIS, remote sensing, and machine learning applications. ## Installation @@ -123,4 +123,4 @@ distributed_manager = DaskManager( # Execute in worker pool and save chunks to disk as they complete. distributed_manager.chunk_save('output.tif', MyAnalysis, chunksize=2048) -``` \ No newline at end of file +``` diff --git a/cog_worker/__init__.pyc b/cog_worker/__init__.pyc deleted file mode 100644 index 15dd245..0000000 Binary files a/cog_worker/__init__.pyc and /dev/null differ diff --git a/docs/.buildinfo b/docs/.buildinfo index e5b91c3..e1abf1f 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 116ab50c53e331c65a37185835288728 +config: 161f4fa986221183a5783980cd0c9435 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_images/examples_1._quick-start_1_0.svg b/docs/_images/examples_1._quick-start_1_0.svg deleted file mode 100644 index a31df0c..0000000 --- a/docs/_images/examples_1._quick-start_1_0.svg +++ /dev/null @@ -1,440 +0,0 @@ - - - diff --git a/docs/_images/examples_1._quick-start_5_0.svg b/docs/_images/examples_1._quick-start_5_0.svg deleted file mode 100644 index bdd663b..0000000 --- a/docs/_images/examples_1._quick-start_5_0.svg +++ /dev/null @@ -1,482 +0,0 @@ - - - diff --git a/docs/_images/examples_1._quick-start_5_2.svg b/docs/_images/examples_1._quick-start_5_2.svg deleted file mode 100644 index 4100cdc..0000000 --- a/docs/_images/examples_1._quick-start_5_2.svg +++ /dev/null @@ -1,419 +0,0 @@ - - - diff --git a/docs/_images/examples_1._quick-start_5_3.svg b/docs/_images/examples_1._quick-start_5_3.svg deleted file mode 100644 index 9ced397..0000000 --- a/docs/_images/examples_1._quick-start_5_3.svg +++ /dev/null @@ -1,371 +0,0 @@ - - - diff --git a/docs/_images/examples_1._quick-start_9_0.png b/docs/_images/examples_1._quick-start_9_0.png new file mode 100644 index 0000000..bcb4209 Binary files /dev/null and b/docs/_images/examples_1._quick-start_9_0.png differ diff --git a/docs/_images/examples_1._quick-start_9_1.png b/docs/_images/examples_1._quick-start_9_1.png deleted file mode 100644 index 87ca312..0000000 Binary files a/docs/_images/examples_1._quick-start_9_1.png and /dev/null differ diff --git a/docs/_images/examples_2._tutorial_11_0.svg b/docs/_images/examples_2._tutorial_11_0.svg deleted file mode 100644 index d80b91c..0000000 --- a/docs/_images/examples_2._tutorial_11_0.svg +++ /dev/null @@ -1,406 +0,0 @@ - - - diff --git a/docs/_images/examples_2._tutorial_11_1.svg b/docs/_images/examples_2._tutorial_11_1.svg deleted file mode 100644 index 76cdaa6..0000000 --- a/docs/_images/examples_2._tutorial_11_1.svg +++ /dev/null @@ -1,406 +0,0 @@ - - - diff --git a/docs/_images/examples_2._tutorial_14_1.png b/docs/_images/examples_2._tutorial_14_1.png new file mode 100644 index 0000000..7866b9a Binary files /dev/null and b/docs/_images/examples_2._tutorial_14_1.png differ diff --git a/docs/_images/examples_2._tutorial_14_1.svg b/docs/_images/examples_2._tutorial_14_1.svg deleted file mode 100644 index ca93533..0000000 --- a/docs/_images/examples_2._tutorial_14_1.svg +++ /dev/null @@ -1,758 +0,0 @@ - - - diff --git a/docs/_images/examples_2._tutorial_14_2.svg b/docs/_images/examples_2._tutorial_14_2.svg deleted file mode 100644 index de86c82..0000000 --- a/docs/_images/examples_2._tutorial_14_2.svg +++ /dev/null @@ -1,649 +0,0 @@ - - - diff --git a/docs/_images/examples_2._tutorial_14_3.png b/docs/_images/examples_2._tutorial_14_3.png deleted file mode 100644 index 51a43b4..0000000 Binary files a/docs/_images/examples_2._tutorial_14_3.png and /dev/null differ diff --git a/docs/_images/examples_2._tutorial_5_0.svg b/docs/_images/examples_2._tutorial_5_0.svg deleted file mode 100644 index 9250fa9..0000000 --- a/docs/_images/examples_2._tutorial_5_0.svg +++ /dev/null @@ -1,482 +0,0 @@ - - - diff --git a/docs/_images/examples_2._tutorial_7_0.svg b/docs/_images/examples_2._tutorial_7_0.svg deleted file mode 100644 index 3bad568..0000000 --- a/docs/_images/examples_2._tutorial_7_0.svg +++ /dev/null @@ -1,482 +0,0 @@ - - - diff --git a/docs/_images/examples_2._tutorial_9_0.png b/docs/_images/examples_2._tutorial_9_0.png new file mode 100644 index 0000000..9cff518 Binary files /dev/null and b/docs/_images/examples_2._tutorial_9_0.png differ diff --git a/docs/_images/examples_2._tutorial_9_0.svg b/docs/_images/examples_2._tutorial_9_0.svg deleted file mode 100644 index 013f391..0000000 --- a/docs/_images/examples_2._tutorial_9_0.svg +++ /dev/null @@ -1,482 +0,0 @@ - - - diff --git a/docs/_modules/cog_worker/distributed.html b/docs/_modules/cog_worker/distributed.html index 6caa9a1..1e621a1 100644 --- a/docs/_modules/cog_worker/distributed.html +++ b/docs/_modules/cog_worker/distributed.html @@ -1,14 +1,14 @@ - +
- -