Skip to content

Commit 3a02250

Browse files
committed
Update the template and sync'ed style
1 parent c544713 commit 3a02250

11 files changed

+60
-20
lines changed

.cruft.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/ecmwf-projects/cookiecutter-conda-package",
3-
"commit": "d379e35af1aa17d816367bcb0942fcf3e238be9d",
3+
"commit": "8397fdf4e595402b3266e357ae5f53ebce99a0c9",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -11,6 +11,7 @@
1111
"copyright_year": "2021",
1212
"mypy_strict": true,
1313
"integration_tests": true,
14+
"pypi": true,
1415
"_template": "https://github.com/ecmwf-projects/cookiecutter-conda-package"
1516
}
1617
},

.github/workflows/on-push.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Get current date
6767
id: date
6868
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
69-
- uses: mamba-org/setup-micromamba@v1
69+
- uses: mamba-org/setup-micromamba@v2
7070
with:
7171
environment-file: ci/combined-environment-ci.yml
7272
environment-name: DEVELOP
@@ -95,7 +95,7 @@ jobs:
9595
- name: Get current date
9696
id: date
9797
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
98-
- uses: mamba-org/setup-micromamba@v1
98+
- uses: mamba-org/setup-micromamba@v2
9999
with:
100100
environment-file: ci/combined-environment-ci.yml
101101
environment-name: DEVELOP
@@ -124,7 +124,7 @@ jobs:
124124
- name: Get current date
125125
id: date
126126
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
127-
- uses: mamba-org/setup-micromamba@v1
127+
- uses: mamba-org/setup-micromamba@v2
128128
with:
129129
environment-file: ci/combined-environment-ci.yml
130130
environment-name: DEVELOP
@@ -161,7 +161,7 @@ jobs:
161161
- name: Get current date
162162
id: date
163163
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
164-
- uses: mamba-org/setup-micromamba@v1
164+
- uses: mamba-org/setup-micromamba@v2
165165
with:
166166
environment-file: ci/combined-environment${{ matrix.extra }}.yml
167167
environment-name: DEVELOP${{ matrix.extra }}
@@ -215,7 +215,7 @@ jobs:
215215
runs-on: ubuntu-latest
216216
needs: distribution
217217
if: |
218-
always() &&
218+
always() && true &&
219219
needs.distribution.result == 'success' &&
220220
github.event_name == 'push' &&
221221
startsWith(github.ref, 'refs/tags')
@@ -230,6 +230,6 @@ jobs:
230230
with:
231231
name: distribution
232232
path: dist
233-
- uses: pypa/gh-action-pypi-publish@v1.8.14
233+
- uses: pypa/gh-action-pypi-publish@v1.12.3
234234
with:
235235
verbose: true

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
version.py
33

44
# Sphinx automatic generation of API
5+
docs/README.md
56
docs/_api/
67

78
# Created by https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm,emacs,linux,macos,windows

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v5.0.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -17,23 +17,23 @@ repos:
1717
- id: blackdoc
1818
additional_dependencies: [black==23.11.0]
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.1.13
20+
rev: v0.8.3
2121
hooks:
2222
- id: ruff
2323
args: [--fix, --show-fixes]
2424
- id: ruff-format
2525
- repo: https://github.com/executablebooks/mdformat
26-
rev: 0.7.17
26+
rev: 0.7.19
2727
hooks:
2828
- id: mdformat
2929
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
30-
rev: v2.12.0
30+
rev: v2.14.0
3131
hooks:
3232
- id: pretty-format-yaml
3333
args: [--autofix, --preserve-quotes]
3434
- id: pretty-format-toml
3535
args: [--autofix]
3636
- repo: https://github.com/gitleaks/gitleaks
37-
rev: v8.18.1
37+
rev: v8.21.2
3838
hooks:
3939
- id: gitleaks

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ template-update:
2929
pre-commit run --all-files cruft -c .pre-commit-config-cruft.yaml
3030

3131
docs-build:
32-
cd docs && rm -fr _api && make clean && make html
32+
cp README.md docs/. && cd docs && rm -fr _api && make clean && make html
3333

3434
# DO NOT EDIT ABOVE THIS LINE, ADD COMMANDS BELOW
3535

docs/conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@
3737
autodoc_typehints = "none"
3838

3939
# autoapi configuration
40+
autoapi_add_toctree_entry = False
4041
autoapi_dirs = ["../xarray_sentinel"]
4142
autoapi_ignore = ["*/version.py"]
43+
autoapi_member_order = "groupwise"
4244
autoapi_options = [
4345
"members",
4446
"inherited-members",

docs/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Easily access and explore the SAR data products of the Copernicus Sentinel-1 sat
66
:caption: 'Contents:'
77
:maxdepth: 2
88
9+
README.md
910
API Reference <_api/xarray_sentinel/index>
1011
```
1112

notebooks/fsspec.ipynb

+4-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@
203203
"account_name = \"sentinel1euwest\"\n",
204204
"token = planetary_computer.sas.get_token(account_name, \"s1-grd\").token\n",
205205
"\n",
206-
"product_folder = \"s1-grd/GRD/2022/1/10/IW/DV/S1A_IW_GRDH_1SDV_20220110T050922_20220110T050947_041394_04EBF7_A360\"\n",
206+
"product_folder = (\n",
207+
" \"s1-grd/GRD/2022/1/10/IW/DV/\"\n",
208+
" \"S1A_IW_GRDH_1SDV_20220110T050922_20220110T050947_041394_04EBF7_A360\"\n",
209+
")\n",
207210
"\n",
208211
"storage_options = {\"account_name\": \"sentinel1euwest\", \"sas_token\": token}\n",
209212
"product_path = f\"abfs://{product_folder}/manifest.safe\"\n",

pyproject.toml

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[build-system]
2-
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
2+
build-backend = "setuptools.build_meta"
3+
requires = ["setuptools>=64", "setuptools_scm>=8"]
34

45
[project]
56
authors = [{"name" = "B-Open", "email" = "[email protected]"}]
@@ -66,13 +67,15 @@ module = [
6667
]
6768

6869
[tool.ruff]
70+
# Same as Black.
71+
indent-width = 4
72+
line-length = 88
73+
74+
[tool.ruff.lint]
6975
ignore = [
7076
# pydocstyle: Missing Docstrings
7177
"D1"
7278
]
73-
# Same as Black.
74-
indent-width = 4
75-
line-length = 88
7679
select = [
7780
# pyflakes
7881
"F",
@@ -88,7 +91,7 @@ select = [
8891
[tool.ruff.lint.pycodestyle]
8992
max-line-length = 110
9093

91-
[tool.ruff.pydocstyle]
94+
[tool.ruff.lint.pydocstyle]
9295
convention = "numpy"
9396

9497
[tool.setuptools]

pyproject.toml.rej

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff a/pyproject.toml b/pyproject.toml (rejected hunks)
2+
@@ -1,5 +1,6 @@
3+
[build-system]
4+
-requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
5+
+build-backend = "setuptools.build_meta"
6+
+requires = ["setuptools>=64", "setuptools_scm>=8"]
7+
8+
[project]
9+
classifiers = [
10+
@@ -25,13 +26,15 @@ branch = true
11+
strict = true
12+
13+
[tool.ruff]
14+
+# Same as Black.
15+
+indent-width = 4
16+
+line-length = 88
17+
+
18+
+[tool.ruff.lint]
19+
ignore = [
20+
# pydocstyle: Missing Docstrings
21+
"D1"
22+
]
23+
-# Same as Black.
24+
-indent-width = 4
25+
-line-length = 88
26+
select = [
27+
# pyflakes
28+
"F",

xarray_sentinel/sentinel1.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Sentinel-1 Product Specification v3.7 27 February 2020 S1-RS-MDA-52-7441 documenting IPF 3.30
1010
https://sentinel.esa.int/documents/247904/1877131/Sentinel-1-Product-Specification
1111
"""
12+
1213
from __future__ import annotations
1314

1415
import os
@@ -518,7 +519,7 @@ def open_rasterio_dataarray(
518519
# fsspec needs rasterio >= 1.3.0, but we allow earlier rasterio versions for local files
519520
if fs is None or isinstance(fs, fsspec.implementations.local.LocalFileSystem):
520521
try:
521-
arr = xr.open_dataarray(measurement, engine="rasterio", chunks=chunks) # type: ignore
522+
arr = xr.open_dataarray(measurement, engine="rasterio", chunks=chunks)
522523
except rasterio.RasterioIOError as ex:
523524
if "No such file" in str(ex):
524525
raise FileNotFoundError(str(ex))

0 commit comments

Comments
 (0)