From afd8977b07d4c85d6c0a5adc4c936a8525dd7fe8 Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 17:57:34 +0100 Subject: [PATCH 01/15] Start migrating to cruft / conda package --- .pre-commit-config-cruft.yaml | 7 +++++++ .pre-commit-config.yaml | 32 +++++++++++++++----------------- xarray_sentinel/sentinel1.py | 2 +- 3 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 .pre-commit-config-cruft.yaml diff --git a/.pre-commit-config-cruft.yaml b/.pre-commit-config-cruft.yaml new file mode 100644 index 0000000..b55f24f --- /dev/null +++ b/.pre-commit-config-cruft.yaml @@ -0,0 +1,7 @@ +repos: +- repo: https://github.com/cruft/cruft + rev: 2.15.0 + hooks: + - id: cruft + entry: cruft update -y + additional_dependencies: [toml] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62fca7c..7d86a38 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -8,34 +8,32 @@ repos: - id: check-yaml - id: check-toml - id: check-added-large-files + - id: check-merge-conflict - id: debug-statements - id: mixed-line-ending -- repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort -- repo: https://github.com/psf/black - rev: 23.9.1 - hooks: - - id: black - repo: https://github.com/keewis/blackdoc - rev: v0.3.8 + rev: v0.3.9 hooks: - id: blackdoc - exclude: generate_reductions.py - additional_dependencies: [black==22.3.0] -- repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + additional_dependencies: [black==23.11.0] +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.13 hooks: - - id: flake8 + - id: ruff + args: [--fix, --show-fixes] + - id: ruff-format - repo: https://github.com/executablebooks/mdformat rev: 0.7.17 hooks: - id: mdformat - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.10.0 + rev: v2.12.0 hooks: - id: pretty-format-yaml - args: [--autofix] + args: [--autofix, --preserve-quotes] - id: pretty-format-toml args: [--autofix] +- repo: https://github.com/gitleaks/gitleaks + rev: v8.18.1 + hooks: + - id: gitleaks diff --git a/xarray_sentinel/sentinel1.py b/xarray_sentinel/sentinel1.py index ee44a09..62ab7cc 100644 --- a/xarray_sentinel/sentinel1.py +++ b/xarray_sentinel/sentinel1.py @@ -316,7 +316,7 @@ def get_footprint_linestring( def make_geospatial_attributes( - footprint: Sequence[Tuple[float, float]] + footprint: Sequence[Tuple[float, float]], ) -> Dict[str, Any]: wkt = "POLYGON((" + ",".join(f"{y} {x}" for y, x in footprint) + "))" geospatial_attrs = { From 2b3a8a4fcf8818f75264dee49ec9bbea803cafac Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:26:20 +0100 Subject: [PATCH 02/15] Mover metadata to pyproject.yaml --- pyproject.toml | 84 ++++++++++++++++++++++++++++++++++++++++++++------ setup.cfg | 44 -------------------------- 2 files changed, 74 insertions(+), 54 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index ebdb575..14f82e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,52 @@ [build-system] -requires = [ - "setuptools>=42", - "wheel", - "setuptools_scm[toml]>=3.4", - "setuptools_scm_git_archive" +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] + +[project] +authors = [{ "name" = "B-Open", "email" = "software@bopen.eu" }] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering", +] +dependencies = [ + "fsspec", + "numpy", + "pandas", + "rioxarray", + "xarray >= 0.18.0", + "xmlschema", +] +description = "Easily access and explore the SAR data products of the Copernicus Sentinel-1 satellite mission" +dynamic = ["version"] +keywords = [ + "copernicus", + "earth-observation", + "radar", + "remote-sensing", + "satellite-imagery", + "sentinel-1", + "sar", + "synthetic-aperture-radar", + "xarray", ] +license = { file = "LICENSE" } +name = "xarray-sentinel" +readme = "README.md" + + +[project.entry-points."xarray.backends"] +sentinel-1 = "xarray_sentinel.xarray_backends:Sentinel1Backend" [tool.coverage.run] branch = true -[tool.isort] -profile = "black" - [tool.mypy] plugins = "numpy.typing.mypy_plugin" strict = true @@ -24,12 +59,41 @@ module = [ "rasterio", "shapely", "shapely.geometry", - "shapely.wkt" + "shapely.wkt", ] +[tool.ruff] +ignore = [ + # pydocstyle: Missing Docstrings + "D1", +] +# Same as Black. +indent-width = 4 +line-length = 88 +select = [ + # pyflakes + "F", + # pycodestyle + "E", + "W", + # isort + "I", + # pydocstyle + "D", +] + +[tool.ruff.lint.pycodestyle] +max-line-length = 110 + +[tool.ruff.pydocstyle] +convention = "numpy" + +[tool.setuptools] +packages = ["xarray_sentinel"] + [tool.setuptools_scm] write_to = "xarray_sentinel/version.py" write_to_template = ''' -# don't change, don't track in version control +# Do not change! Do not track in version control! __version__ = "{version}" ''' diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4b383a0..0000000 --- a/setup.cfg +++ /dev/null @@ -1,44 +0,0 @@ -[metadata] -name = xarray-sentinel -author = B-Open -author_email = software@bopen.eu -license = Apache License 2.0 -description = Easily access and explore the SAR data products of the Copernicus Sentinel-1 satellite mission -url = https://github.com/bopen/xarray-sentinel -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Science/Research - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Topic :: Scientific/Engineering -long_description_content_type=text/markdown -long_description = file: README.md -keywords = copernicus, earth-observation, radar, remote-sensing, satellite-imagery, sentinel-1, sar, synthetic-aperture-radar, xarray - -[options] -packages = find: -python_requires = >=3.9 -install_requires = - fsspec - numpy - pandas - rioxarray - xarray >= 0.18.0 - xmlschema -include_package_data = True - -[options.package_data] -xarray_sentinel = resources/sentinel1/*.xsd - -[options.entry_points] -xarray.backends = - sentinel-1 = xarray_sentinel.xarray_backends:Sentinel1Backend - -[flake8] -max-line-length = 120 -extend-ignore = E203, W503 From a11b2ce506677b7181f7b3fdc6a0013d9486db1e Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:26:45 +0100 Subject: [PATCH 03/15] More sync --- .gitignore | 352 ++++++++++++++++++++++++++++++++++- Dockerfile | 12 ++ xarray_sentinel/sentinel1.py | 7 +- 3 files changed, 360 insertions(+), 11 deletions(-) create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore index b84df8d..c7d9595 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,237 @@ -# local +# setuptools-scm version.py +# Sphinx automatic generation of API +docs/_api/ + +# Created by https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm,emacs,linux,macos,windows +# Edit at https://www.toptal.com/developers/gitignore?templates=python,jupyternotebooks,vim,visualstudiocode,pycharm,emacs,linux,macos,windows + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +### JupyterNotebooks ### +# gitignore template for Jupyter Notebooks +# website: http://jupyter.org/ + +.ipynb_checkpoints +*/.ipynb_checkpoints/* + +# IPython +profile_default/ +ipython_config.py + +# Remove previous ipynb_checkpoints +# git rm -r .ipynb_checkpoints/ + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### PyCharm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### PyCharm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +### Python ### # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -13,7 +244,6 @@ __pycache__/ .Python build/ develop-eggs/ -dist/ downloads/ eggs/ .eggs/ @@ -23,7 +253,6 @@ parts/ sdist/ var/ wheels/ -pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg @@ -53,6 +282,7 @@ coverage.xml *.py,cover .hypothesis/ .pytest_cache/ +cover/ # Translations *.mo @@ -75,17 +305,17 @@ instance/ docs/_build/ # PyBuilder +.pybuilder/ target/ # Jupyter Notebook -.ipynb_checkpoints # IPython -profile_default/ -ipython_config.py # pyenv -.python-version +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. @@ -94,7 +324,22 @@ ipython_config.py # install all needed dependencies. #Pipfile.lock -# PEP 582; used by e.g. github.com/David-OConnor/pyflow +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ # Celery stuff @@ -130,3 +375,94 @@ dmypy.json # Pyre type checker .pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/ +# .vscode/* +# !.vscode/settings.json +# !.vscode/tasks.json +# !.vscode/launch.json +# !.vscode/extensions.json +# !.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm,emacs,linux,macos,windows diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..57dd157 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM continuumio/miniconda3 + +WORKDIR /src/xarray-sentinel + +COPY environment.yml /src/xarray-sentinel/ + +RUN conda install -c conda-forge gcc python=3.11 \ + && conda env update -n base -f environment.yml + +COPY . /src/xarray-sentinel + +RUN pip install --no-deps -e . diff --git a/xarray_sentinel/sentinel1.py b/xarray_sentinel/sentinel1.py index 62ab7cc..b9567bb 100644 --- a/xarray_sentinel/sentinel1.py +++ b/xarray_sentinel/sentinel1.py @@ -1,6 +1,7 @@ """Map Sentinel-1 data products to xarray. -References: +References +---------- - Sentinel-1 document library: https://sentinels.copernicus.eu/web/sentinel/user-guides/sentinel-1-sar/document-library - Sentinel-1 Product Specification v3.9 07 May 2021 S1-RS-MDA-52-7441-3-9 documenting IPF 3.40 @@ -797,7 +798,7 @@ def calibrate_amplitude( calibration_lut: xr.DataArray, **kwargs: Any, ) -> xr.DataArray: - """Return the calibrated amplitude. The calibration is done using the calibration LUT in the product metadata. + """Return the calibrated amplitude using the calibration LUT in the product metadata. :param digital_number: digital numbers to be calibrated :param calibration_lut: calibration LUT (sigmaNought, betaNought or gamma). @@ -832,7 +833,7 @@ def calibrate_intensity( min_db: Optional[float] = -40.0, **kwargs: Any, ) -> xr.DataArray: - """Return the calibrated intensity. The calibration is done using the calibration LUT in the product metadata. + """Return the calibrated intensity using the calibration LUT in the product metadata. :param digital_number: digital numbers to be calibrated :param calibration_lut: calibration LUT (sigmaNought, betaNought or gamma). From 12e2bcd5400d9de17cc0b4f5f4572ab003a993ef Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:27:30 +0100 Subject: [PATCH 04/15] Code style --- pyproject.toml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 14f82e6..4d78211 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] [project] -authors = [{ "name" = "B-Open", "email" = "software@bopen.eu" }] +authors = [{"name" = "B-Open", "email" = "software@bopen.eu"}] classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", @@ -13,7 +13,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering" ] dependencies = [ "fsspec", @@ -21,7 +21,7 @@ dependencies = [ "pandas", "rioxarray", "xarray >= 0.18.0", - "xmlschema", + "xmlschema" ] description = "Easily access and explore the SAR data products of the Copernicus Sentinel-1 satellite mission" dynamic = ["version"] @@ -34,13 +34,12 @@ keywords = [ "sentinel-1", "sar", "synthetic-aperture-radar", - "xarray", + "xarray" ] -license = { file = "LICENSE" } +license = {file = "LICENSE"} name = "xarray-sentinel" readme = "README.md" - [project.entry-points."xarray.backends"] sentinel-1 = "xarray_sentinel.xarray_backends:Sentinel1Backend" @@ -59,13 +58,13 @@ module = [ "rasterio", "shapely", "shapely.geometry", - "shapely.wkt", + "shapely.wkt" ] [tool.ruff] ignore = [ # pydocstyle: Missing Docstrings - "D1", + "D1" ] # Same as Black. indent-width = 4 @@ -79,7 +78,7 @@ select = [ # isort "I", # pydocstyle - "D", + "D" ] [tool.ruff.lint.pycodestyle] From d6ec52b3b1b0db3cdb0d60d06e2e36e10f81130b Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:33:54 +0100 Subject: [PATCH 05/15] Sync environment management --- Makefile | 24 +++++++++++++++++------- ci/environment-ci.yml | 17 +++++++++++++++++ ci/environment-integration.yml | 10 ++++++++++ environment.yml | 6 ------ 4 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 ci/environment-ci.yml create mode 100644 ci/environment-integration.yml diff --git a/Makefile b/Makefile index 8f5d6eb..a86f861 100644 --- a/Makefile +++ b/Makefile @@ -3,22 +3,21 @@ CONDA := conda CONDAFLAGS := COV_REPORT := html -default: qa test type-check +default: qa unit-tests type-check qa: pre-commit run --all-files -test: +unit-tests: python -m pytest -vv --cov=. --cov-report=$(COV_REPORT) -doc-test: - python -m pytest -vv --doctest-glob='*.md' README.md - type-check: python -m mypy --strict . conda-env-update: - $(CONDA) env update $(CONDAFLAGS) -f environment.yml + $(CONDA) install -y -c conda-forge conda-merge + $(CONDA) run conda-merge environment.yml ci/environment-ci.yml > ci/combined-environment-ci.yml + $(CONDA) env update $(CONDAFLAGS) -f ci/combined-environment-ci.yml docker-build: docker build -t $(PROJECT) . @@ -27,4 +26,15 @@ docker-run: docker run --rm -ti -v $(PWD):/srv $(PROJECT) template-update: - pre-commit run --all-files cruft -c .pre-commit-config-weekly.yaml + pre-commit run --all-files cruft -c .pre-commit-config-cruft.yaml + +docs-build: + cd docs && rm -fr _api && make clean && make html + +# DO NOT EDIT ABOVE THIS LINE, ADD COMMANDS BELOW + +doc-tests: + python -m pytest -vv --doctest-glob="*.md" --doctest-glob="*.rst" README.md + +integration-tests: + python -m pytest -vv --cov=. --cov-report=$(COV_REPORT) --log-cli-level=INFO tests/integration*.py diff --git a/ci/environment-ci.yml b/ci/environment-ci.yml new file mode 100644 index 0000000..7861afa --- /dev/null +++ b/ci/environment-ci.yml @@ -0,0 +1,17 @@ +# environment-ci.yml: Additional dependencies to install in the CI environment. +channels: +- conda-forge +- nodefaults +dependencies: +- make +- mypy +- myst-parser +- pip +- pre-commit +- pydata-sphinx-theme +- pytest +- pytest-cov +- sphinx +- sphinx-autoapi +# DO NOT EDIT ABOVE THIS LINE, ADD DEPENDENCIES BELOW +- pandas-stubs diff --git a/ci/environment-integration.yml b/ci/environment-integration.yml new file mode 100644 index 0000000..f31eba3 --- /dev/null +++ b/ci/environment-integration.yml @@ -0,0 +1,10 @@ +# environment-integration.yml: Additional dependencies to install in the integration environment (e.g., pinned dependencies). +channels: +- conda-forge +- nodefaults +dependencies: +- make +- pytest +- pytest-cov +# DO NOT EDIT ABOVE THIS LINE, ADD DEPENDENCIES BELOW +- pandas-stubs diff --git a/environment.yml b/environment.yml index 9583f53..3b29864 100644 --- a/environment.yml +++ b/environment.yml @@ -3,17 +3,11 @@ channels: dependencies: - dask >= 2022.5.0 - fsspec >= 2022.3.0 -- make -- mypy - netcdf4 - numpy >= 1.22.0 -- pandas-stubs -- pytest -- pytest-cov - rasterio >= 1.3.0 - rioxarray >= 0.10.0 - shapely -- types-setuptools - xarray >= 2022.6.0 - xmlschema >= 2.0.1 - zarr From 28da00758e8c362e336cfdaffc8d5c56cb5e7374 Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:37:58 +0100 Subject: [PATCH 06/15] Sync github actions --- .github/workflows/on-push.yml | 224 ++++++++++++++++++++++++---------- 1 file changed, 162 insertions(+), 62 deletions(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index 4eb85d3..0cdad0e 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -14,65 +14,95 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +defaults: + run: + shell: bash -l {0} + jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.x - uses: pre-commit/action@v3.0.0 + combine-environments: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install conda-merge + run: | + python -m pip install conda-merge + - name: Combine environments + run: | + for SUFFIX in ci integration; do + conda-merge ci/environment-$SUFFIX.yml environment.yml > ci/combined-environment-$SUFFIX.yml || exit + done + - uses: actions/upload-artifact@v4 + with: + name: combined-environments + path: ci/combined-environment-*.yml + unit-tests: - name: unit-tests (3.11) + name: unit-tests + needs: combine-environments runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} + strategy: + matrix: + python-version: ['3.11'] steps: - - uses: actions/checkout@v3 - - name: Install Conda environment with Micromamba - uses: mamba-org/provision-with-micromamba@v15 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: combined-environments + path: ci + - name: Get current date + id: date + run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" + - uses: mamba-org/setup-micromamba@v1 with: - environment-file: environment.yml + environment-file: ci/combined-environment-ci.yml environment-name: DEVELOP - channels: conda-forge - cache-env: true - cache-env-key: ubuntu-latest-3.11 - extra-specs: | - python=3.11 + cache-environment: true + cache-environment-key: environment-${{ steps.date.outputs.date }} + cache-downloads-key: downloads-${{ steps.date.outputs.date }} + create-args: >- + python=${{ matrix.python-version }} - name: Install package run: | python -m pip install --no-deps -e . - name: Run tests run: | - make test COV_REPORT=xml - - name: Run doc tests - run: | - make doc-test COV_REPORT=xml - - name: Upload code coverage to Codecov - uses: codecov/codecov-action@v3.1.2 + make unit-tests COV_REPORT=xml type-check: - needs: [unit-tests] + needs: [combine-environments, unit-tests] runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} steps: - - uses: actions/checkout@v3 - - name: Install Conda environment with Micromamba - uses: mamba-org/provision-with-micromamba@v15 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: combined-environments + path: ci + - name: Get current date + id: date + run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" + - uses: mamba-org/setup-micromamba@v1 with: - environment-file: environment.yml + environment-file: ci/combined-environment-ci.yml environment-name: DEVELOP - channels: conda-forge - cache-env: true - cache-env-key: ubuntu-latest-3.11 - extra-specs: | + cache-environment: true + cache-environment-key: environment-${{ steps.date.outputs.date }} + cache-downloads-key: downloads-${{ steps.date.outputs.date }} + create-args: >- python=3.11 - name: Install package run: | @@ -81,55 +111,125 @@ jobs: run: | make type-check + docs-build: + needs: [combine-environments, unit-tests] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: combined-environments + path: ci + - name: Get current date + id: date + run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" + - uses: mamba-org/setup-micromamba@v1 + with: + environment-file: ci/combined-environment-ci.yml + environment-name: DEVELOP + cache-environment: true + cache-environment-key: environment-${{ steps.date.outputs.date }} + cache-downloads-key: downloads-${{ steps.date.outputs.date }} + create-args: >- + python=3.11 + - name: Install package + run: | + python -m pip install --no-deps -e . + - name: Build documentation + run: | + make docs-build + integration-tests: - needs: [unit-tests] + needs: [combine-environments, unit-tests] + if: | + success() && true runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} strategy: matrix: - python-version: ['3.10', '3.9'] - extra: [''] include: - - python-version: '3.9' - extra: -minver + - python-version: '3.11' + extra: -integration steps: - - uses: actions/checkout@v3 - - name: Install Conda environment with Micromamba - uses: mamba-org/provision-with-micromamba@v15 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: combined-environments + path: ci + - name: Get current date + id: date + run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" + - uses: mamba-org/setup-micromamba@v1 with: - environment-file: environment${{ matrix.extra }}.yml + environment-file: ci/combined-environment${{ matrix.extra }}.yml environment-name: DEVELOP${{ matrix.extra }} - channels: conda-forge - cache-env: true - cache-env-key: ubuntu-latest-${{ matrix.python-version }}${{ matrix.extra }}. - extra-specs: | + cache-environment: true + cache-environment-key: environment-${{ steps.date.outputs.date }} + cache-downloads-key: downloads-${{ steps.date.outputs.date }} + create-args: >- python=${{ matrix.python-version }} - name: Install package run: | python -m pip install --no-deps -e . - name: Run tests run: | - make test COV_REPORT=xml - - name: Upload code coverage to Codecov - uses: codecov/codecov-action@v3.1.2 + make unit-tests COV_REPORT=xml distribution: runs-on: ubuntu-latest - needs: [integration-tests, type-check] + needs: [unit-tests, type-check, docs-build, integration-tests] + if: | + always() && + needs.unit-tests.result == 'success' && + needs.type-check.result == 'success' && + needs.docs-build.result == 'success' && + (needs.integration-tests.result == 'success' || needs.integration-tests.result == 'skipped') steps: - - uses: actions/checkout@v3 - - name: Build distributions + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install package + run: | + python -m pip install --upgrade pip + python -m pip install build twine + - name: Build distribution run: | - $CONDA/bin/python -m pip install build - $CONDA/bin/python -m build - - name: Publish a Python distribution to PyPI - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 + python -m build + - name: Check wheels + run: | + cd dist || exit + python -m pip install xarray_sentinel*.whl || exit + python -m twine check --strict * || exit + python -c "import xarray_sentinel" || exit + cd .. + - uses: actions/upload-artifact@v4 + with: + name: distribution + path: dist + + upload-to-pypi: + runs-on: ubuntu-latest + needs: distribution + if: | + always() && + needs.distribution.result == 'success' && + github.event_name == 'push' && + startsWith(github.ref, 'refs/tags') + environment: + name: pypi + url: https://pypi.org/p/xarray-sentinel + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publish + + steps: + - uses: actions/download-artifact@v4 + with: + name: distribution + path: dist + - uses: pypa/gh-action-pypi-publish@v1.8.11 with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true From 3e7fa58aa62cda5d5cfedc7d06a3bae63c983e18 Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:46:53 +0100 Subject: [PATCH 07/15] Add docs stub --- docs/Makefile | 20 +++++++++++ docs/_static/.gitkeep | 0 docs/_templates/.gitkeep | 0 docs/conf.py | 76 ++++++++++++++++++++++++++++++++++++++++ docs/index.md | 16 +++++++++ docs/make.bat | 35 ++++++++++++++++++ 6 files changed, 147 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/_static/.gitkeep create mode 100644 docs/_templates/.gitkeep create mode 100644 docs/conf.py create mode 100644 docs/index.md create mode 100644 docs/make.bat diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/.gitkeep b/docs/_static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/_templates/.gitkeep b/docs/_templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..0975b86 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,76 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Import and path setup --------------------------------------------------- + +import os +import sys + +import xarray_sentinel + +sys.path.insert(0, os.path.abspath("../")) + +# -- Project information ----------------------------------------------------- + +project = "xarray_sentinel" +copyright = "2023, B-Open Solutions srl" +author = "B-Open Solutions srl" +version = xarray_sentinel.__version__ +release = xarray_sentinel.__version__ + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "autoapi.extension", + "myst_parser", + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", +] + +# autodoc configuration +autodoc_typehints = "none" + +# autoapi configuration +autoapi_dirs = ["../xarray_sentinel"] +autoapi_ignore = ["*/version.py"] +autoapi_options = [ + "members", + "inherited-members", + "undoc-members", + "show-inheritance", + "show-module-summary", + "imported-members", +] +autoapi_root = "_api" + +# napoleon configuration +napoleon_google_docstring = False +napoleon_numpy_docstring = True +napoleon_preprocess_types = True + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "pydata_sphinx_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..4a7f49e --- /dev/null +++ b/docs/index.md @@ -0,0 +1,16 @@ +# Welcome to xarray_sentinel's documentation! + +Easily access and explore the SAR data products of the Copernicus Sentinel-1 satellite mission + +```{toctree} +:caption: 'Contents:' +:maxdepth: 2 + +API Reference <_api/xarray_sentinel/index> +``` + +# Indices and tables + +- {ref}`genindex` +- {ref}`modindex` +- {ref}`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..954237b --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd From b7177b6e886d8524ccc2ceb43b615b8254421179 Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:49:06 +0100 Subject: [PATCH 08/15] Add versione test --- tests/test_00_version.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/test_00_version.py diff --git a/tests/test_00_version.py b/tests/test_00_version.py new file mode 100644 index 0000000..16c0a3a --- /dev/null +++ b/tests/test_00_version.py @@ -0,0 +1,5 @@ +import xarray_sentinel + + +def test_version() -> None: + assert xarray_sentinel.__version__ != "999" From 5275fb71cd26439eac7dcd3202f18c77f2a2a28b Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:52:49 +0100 Subject: [PATCH 09/15] Link to cruft --- .cruft.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .cruft.json diff --git a/.cruft.json b/.cruft.json new file mode 100644 index 0000000..de78e91 --- /dev/null +++ b/.cruft.json @@ -0,0 +1,18 @@ +{ + "template": "https://github.com/ecmwf-projects/cookiecutter-conda-package", + "commit": "d379e35af1aa17d816367bcb0942fcf3e238be9d", + "checkout": null, + "context": { + "cookiecutter": { + "project_name": "xarray-sentinel", + "project_slug": "xarray_sentinel", + "project_short_description": "Easily access and explore the SAR data products of the Copernicus Sentinel-1 satellite mission", + "copyright_holder": "B-Open Solutions srl and the xarray-sentinel authors", + "copyright_year": "2021", + "mypy_strict": true, + "integration_tests": true, + "_template": "https://github.com/ecmwf-projects/cookiecutter-conda-package" + } + }, + "directory": null +} From 10e5559d0705e4200f5a4a180873ac617801fdef Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 18:55:14 +0100 Subject: [PATCH 10/15] Clean up integration tests --- ci/environment-ci.yml | 1 + ci/environment-integration.yml | 15 ++++++++++++++- environment-minver.yml | 17 ----------------- 3 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 environment-minver.yml diff --git a/ci/environment-ci.yml b/ci/environment-ci.yml index 7861afa..6f67e71 100644 --- a/ci/environment-ci.yml +++ b/ci/environment-ci.yml @@ -15,3 +15,4 @@ dependencies: - sphinx-autoapi # DO NOT EDIT ABOVE THIS LINE, ADD DEPENDENCIES BELOW - pandas-stubs +- types-setuptools diff --git a/ci/environment-integration.yml b/ci/environment-integration.yml index f31eba3..d8f98d6 100644 --- a/ci/environment-integration.yml +++ b/ci/environment-integration.yml @@ -7,4 +7,17 @@ dependencies: - pytest - pytest-cov # DO NOT EDIT ABOVE THIS LINE, ADD DEPENDENCIES BELOW -- pandas-stubs +- fsspec == 2021.4.0 +- make +- mypy +- netcdf4 +- numpy == 1.22.0 +- pytest +- pytest-cov +- rasterio == 1.2.4 +- rioxarray == 0.8.0 +- shapely +- types-setuptools +- xarray == 0.21.1 +- xmlschema == 1.9.0 +- zarr diff --git a/environment-minver.yml b/environment-minver.yml deleted file mode 100644 index 9b4cc7e..0000000 --- a/environment-minver.yml +++ /dev/null @@ -1,17 +0,0 @@ -channels: -- conda-forge -dependencies: -- fsspec == 2021.4.0 -- make -- mypy -- netcdf4 -- numpy == 1.22.0 -- pytest -- pytest-cov -- rasterio == 1.2.4 -- rioxarray == 0.8.0 -- shapely -- types-setuptools -- xarray == 0.21.1 -- xmlschema == 1.9.0 -- zarr From ceb784373fe529af9bfd908ed3c95239fc7f235e Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 19:13:04 +0100 Subject: [PATCH 11/15] Old versions --- .github/workflows/on-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index 0cdad0e..2791661 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -149,7 +149,7 @@ jobs: strategy: matrix: include: - - python-version: '3.11' + - python-version: '3.9' extra: -integration steps: From 8ecbe8abf06fe182602c993a7305e9f238b337ca Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Tue, 16 Jan 2024 23:45:11 +0100 Subject: [PATCH 12/15] Simplify minimal --- ci/environment-integration.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ci/environment-integration.yml b/ci/environment-integration.yml index d8f98d6..fd8f474 100644 --- a/ci/environment-integration.yml +++ b/ci/environment-integration.yml @@ -8,16 +8,11 @@ dependencies: - pytest-cov # DO NOT EDIT ABOVE THIS LINE, ADD DEPENDENCIES BELOW - fsspec == 2021.4.0 -- make -- mypy - netcdf4 - numpy == 1.22.0 -- pytest -- pytest-cov - rasterio == 1.2.4 - rioxarray == 0.8.0 - shapely -- types-setuptools - xarray == 0.21.1 - xmlschema == 1.9.0 - zarr From b688e5b617f73b36cb5cc604399d2d7966d0ebef Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Wed, 17 Jan 2024 14:45:38 +0100 Subject: [PATCH 13/15] Update dependencies (minimal dependencies in particular) --- ci/environment-integration.yml | 6 ++++-- environment.yml | 4 ++-- pyproject.toml | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ci/environment-integration.yml b/ci/environment-integration.yml index fd8f474..f073708 100644 --- a/ci/environment-integration.yml +++ b/ci/environment-integration.yml @@ -9,8 +9,10 @@ dependencies: # DO NOT EDIT ABOVE THIS LINE, ADD DEPENDENCIES BELOW - fsspec == 2021.4.0 - netcdf4 -- numpy == 1.22.0 -- rasterio == 1.2.4 +- numpy == 1.23.0 +- packaging == 22.0 +- pandas == 1.5.0 +- rasterio == 1.3.0 - rioxarray == 0.8.0 - shapely - xarray == 0.21.1 diff --git a/environment.yml b/environment.yml index 3b29864..db04603 100644 --- a/environment.yml +++ b/environment.yml @@ -1,13 +1,13 @@ channels: - conda-forge dependencies: -- dask >= 2022.5.0 +- dask >= 2022.6.1 - fsspec >= 2022.3.0 - netcdf4 - numpy >= 1.22.0 - rasterio >= 1.3.0 - rioxarray >= 0.10.0 - shapely -- xarray >= 2022.6.0 +- xarray >= 2022.06.0 - xmlschema >= 2.0.1 - zarr diff --git a/pyproject.toml b/pyproject.toml index 4d78211..978ed7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,10 +39,14 @@ keywords = [ license = {file = "LICENSE"} name = "xarray-sentinel" readme = "README.md" +requires-python = ">=3.9" [project.entry-points."xarray.backends"] sentinel-1 = "xarray_sentinel.xarray_backends:Sentinel1Backend" +[project.urls] +repository = "https://github.com/bopen/xarray-sentinel" + [tool.coverage.run] branch = true From f8a46fc55c73f7612b01bc51de5b5cadec7834f3 Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Wed, 17 Jan 2024 15:01:34 +0100 Subject: [PATCH 14/15] Understand how integration works --- ci/environment-integration.yml | 12 +++++------- environment.yml | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ci/environment-integration.yml b/ci/environment-integration.yml index f073708..c001bd6 100644 --- a/ci/environment-integration.yml +++ b/ci/environment-integration.yml @@ -7,14 +7,12 @@ dependencies: - pytest - pytest-cov # DO NOT EDIT ABOVE THIS LINE, ADD DEPENDENCIES BELOW -- fsspec == 2021.4.0 -- netcdf4 +- dask == 2022.6.1 +- fsspec == 2022.3.0 - numpy == 1.23.0 - packaging == 22.0 - pandas == 1.5.0 - rasterio == 1.3.0 -- rioxarray == 0.8.0 -- shapely -- xarray == 0.21.1 -- xmlschema == 1.9.0 -- zarr +- rioxarray == 0.10.0 +- xarray == 2022.06.0 +- xmlschema == 2.0.1 diff --git a/environment.yml b/environment.yml index db04603..a00f6d0 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ dependencies: - dask >= 2022.6.1 - fsspec >= 2022.3.0 - netcdf4 -- numpy >= 1.22.0 +- numpy >= 1.23.0 - rasterio >= 1.3.0 - rioxarray >= 0.10.0 - shapely From 00f133ce9eaa4d270b5980906d47cda36f6d4947 Mon Sep 17 00:00:00 2001 From: Alessandro Amici Date: Wed, 17 Jan 2024 15:48:09 +0100 Subject: [PATCH 15/15] Mark type --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 978ed7a..ee2a9c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,6 +94,9 @@ convention = "numpy" [tool.setuptools] packages = ["xarray_sentinel"] +[tool.setuptools.package-data] +xarray_sentinel = ["py.typed"] + [tool.setuptools_scm] write_to = "xarray_sentinel/version.py" write_to_template = '''