[Git][debian-gis-team/xarray-safe-rcm][upstream] New upstream version 2024.02.0
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Wed Feb 21 07:45:04 GMT 2024
Antonio Valentino pushed to branch upstream at Debian GIS Project / xarray-safe-rcm
Commits:
49bbd284 by Antonio Valentino at 2024-02-21T07:36:28+00:00
New upstream version 2024.02.0
- - - - -
4 changed files:
- .github/workflows/pypi.yaml
- .pre-commit-config.yaml
- safe_rcm/api.py
- safe_rcm/product/reader.py
Changes:
=====================================
.github/workflows/pypi.yaml
=====================================
@@ -11,9 +11,9 @@ jobs:
if: github.repository == 'umr-lops/xarray-safe-rcm'
steps:
- name: Checkout
- uses: actions/checkout at v3
+ uses: actions/checkout at v4
- name: Set up Python
- uses: actions/setup-python at v4
+ uses: actions/setup-python at v5
with:
python-version: "3.x"
- name: Install dependencies
@@ -27,7 +27,7 @@ jobs:
run: |
twine check dist/*
- name: Upload build artifacts
- uses: actions/upload-artifact at v3
+ uses: actions/upload-artifact at v4
with:
name: packages
path: dist/*
@@ -45,10 +45,10 @@ jobs:
steps:
- name: Download build artifacts
- uses: actions/download-artifact at v3
+ uses: actions/download-artifact at v4
with:
name: packages
path: dist/
- name: Publish to PyPI
- uses: pypa/gh-action-pypi-publish at a56da0b891b3dc519c7ee3284aff1fad93cc8598
+ uses: pypa/gh-action-pypi-publish at 2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
=====================================
.pre-commit-config.yaml
=====================================
@@ -4,7 +4,7 @@ ci:
# https://pre-commit.com/
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
@@ -12,28 +12,28 @@ repos:
- id: check-yaml
- id: check-toml
- repo: https://github.com/pycqa/isort
- rev: 5.12.0
+ rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
- rev: 23.3.0
+ rev: 24.2.0
hooks:
- id: black
- id: black-jupyter
- repo: https://github.com/keewis/blackdoc
- rev: v0.3.8
+ rev: v0.3.9
hooks:
- id: blackdoc
- repo: https://github.com/pycqa/flake8
- rev: 6.0.0
+ rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/kynan/nbstripout
- rev: 0.6.1
+ rev: 0.7.1
hooks:
- id: nbstripout
args: [--extra-keys=metadata.kernelspec metadata.language_info.version]
- repo: https://github.com/pre-commit/mirrors-prettier
- rev: v3.0.0-alpha.9-for-vscode
+ rev: v4.0.0-alpha.8
hooks:
- id: prettier
=====================================
safe_rcm/api.py
=====================================
@@ -5,6 +5,7 @@ from fnmatch import fnmatchcase
import datatree
import fsspec
import xarray as xr
+from fsspec.implementations.dirfs import DirFileSystem
from tlz.dicttoolz import valmap
from tlz.functoolz import compose_left, curry, juxt
@@ -74,6 +75,7 @@ def open_rcm(
storage_options = backend_kwargs.get("storage_options", {})
mapper = fsspec.get_mapper(url, **storage_options)
+ relative_fs = DirFileSystem(path=url, fs=mapper.fs)
try:
declared_files = read_manifest(mapper, "manifest.safe")
@@ -85,8 +87,7 @@ def open_rcm(
missing_files = [
path
for path in declared_files
- if not ignored_file(path, manifest_ignores)
- and not mapper.fs.exists(mapper._key_to_str(path))
+ if not ignored_file(path, manifest_ignores) and not relative_fs.exists(path)
]
if missing_files:
raise ExceptionGroup(
@@ -147,16 +148,12 @@ def open_rcm(
),
imagery_paths,
)
- imagery_urls = valmap(
- mapper._key_to_str,
- resolved,
- )
imagery_dss = valmap(
compose_left(
- curry(mapper.fs.open),
+ curry(relative_fs.open),
curry(xr.open_dataset, engine="rasterio", **dataset_kwargs),
),
- imagery_urls,
+ resolved,
)
dss = [ds.assign_coords(pole=coord) for coord, ds in imagery_dss.items()]
imagery = xr.concat(dss, dim="pole")
=====================================
safe_rcm/product/reader.py
=====================================
@@ -125,6 +125,7 @@ def read_product(mapper, product_path):
default_dims=["stacked"],
),
lambda obj: obj.set_index({"stacked": ["pole", "pulse"]}),
+ lambda obj: obj.drop_duplicates("stacked", keep="last"),
lambda obj: obj.unstack("stacked"),
),
},
View it on GitLab: https://salsa.debian.org/debian-gis-team/xarray-safe-rcm/-/commit/49bbd284fd8562c259ae44eb303cf3f82163c421
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/xarray-safe-rcm/-/commit/49bbd284fd8562c259ae44eb303cf3f82163c421
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240221/30b5dcee/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list