Files
python-xarray/xarray-pr8953-nodatatreeprune.patch
Sebastian Wagner 69cc45c6ae Accepting request 1171757 from home:bnavigator:branches:devel:languages:python:numeric
- Update to 2024.3.0
  ## New Features
  * Partial writes to existing chunks with region or append_dim
    will now raise an error (unless safe_chunks=False); previously
    an error would only be raised on new variables. (PR8459,
    GH8371, GH8882) By Maximilian Roos.
  * Grouped and resampling quantile calculations now use the
    vectorized algorithm in flox>=0.9.4 if present. By Deepak
    Cherian.
  * Do not broadcast in arithmetic operations when global option
    arithmetic_broadcast=False (GH6806, PR8784). By Etienne Schalk
    and Deepak Cherian.
  * Add the .oindex property to Explicitly Indexed Arrays for
    orthogonal indexing functionality. (GH8238, PR8750) By Anderson
    Banihirwe.
  * Add the .vindex property to Explicitly Indexed Arrays for
    vectorized indexing functionality. (GH8238, PR8780) By Anderson
    Banihirwe.
  * Expand use of .oindex and .vindex properties. (:pull: 8790) By
    Anderson Banihirwe and Deepak Cherian.
  * Allow creating xr.Coordinates objects with no indexes (PR8711)
    By Benoit Bovy and Tom Nicholas.
  * Enable plotting of datetime.dates. (GH8866, PR8873) By Sascha
    Hofmann.
  ## Breaking changes
  * Don’t allow overwriting index variables with to_zarr region
    writes. (GH8589, PR8876). By Deepak Cherian.
  ## Bug fixes
  * The default freq parameter in xr.date_range() and
    xr.cftime_range() is set to 'D' only if periods, start, or end

OBS-URL: https://build.opensuse.org/request/show/1171757
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-xarray?expand=0&rev=95
2024-05-04 11:49:52 +00:00

131 lines
5.0 KiB
Diff

From 84d23be58bb39be4eb896f5f0dbe0a8f956431fb Mon Sep 17 00:00:00 2001
From: Matt Savoie <matthew.savoie@colorado.edu>
Date: Wed, 17 Apr 2024 09:57:53 -0600
Subject: [PATCH 1/4] DAS-2108: stop pruning datatree_ directory
Quick fixup of some typing.
Removes mypy exclusions for datatree_
---
MANIFEST.in | 1 -
pyproject.toml | 10 +---------
xarray/datatree_/datatree/io.py | 10 +++++-----
xarray/datatree_/datatree/tests/test_extensions.py | 11 +++++------
xarray/datatree_/docs/source/conf.py | 6 +++---
5 files changed, 14 insertions(+), 24 deletions(-)
delete mode 100644 MANIFEST.in
Index: xarray-2024.03.0/MANIFEST.in
===================================================================
--- xarray-2024.03.0.orig/MANIFEST.in
+++ xarray-2024.03.0/MANIFEST.in
@@ -1 +1,2 @@
prune xarray/datatree_*
+recursive-include xarray/datatree_/datatree *.py
Index: xarray-2024.03.0/pyproject.toml
===================================================================
--- xarray-2024.03.0.orig/pyproject.toml
+++ xarray-2024.03.0/pyproject.toml
@@ -96,11 +96,6 @@ warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
-# Ignore mypy errors for modules imported from datatree_.
-[[tool.mypy.overrides]]
-module = "xarray.datatree_.*"
-ignore_errors = true
-
# Much of the numerical computing stack doesn't have type annotations yet.
[[tool.mypy.overrides]]
ignore_missing_imports = true
Index: xarray-2024.03.0/xarray/datatree_/datatree/io.py
===================================================================
--- xarray-2024.03.0.orig/xarray/datatree_/datatree/io.py
+++ xarray-2024.03.0/xarray/datatree_/datatree/io.py
@@ -3,14 +3,14 @@ from xarray.core.datatree import DataTre
def _get_nc_dataset_class(engine):
if engine == "netcdf4":
- from netCDF4 import Dataset # type: ignore
+ from netCDF4 import Dataset
elif engine == "h5netcdf":
- from h5netcdf.legacyapi import Dataset # type: ignore
+ from h5netcdf.legacyapi import Dataset
elif engine is None:
try:
from netCDF4 import Dataset
except ImportError:
- from h5netcdf.legacyapi import Dataset # type: ignore
+ from h5netcdf.legacyapi import Dataset
else:
raise ValueError(f"unsupported engine: {engine}")
return Dataset
@@ -78,7 +78,7 @@ def _datatree_to_netcdf(
def _create_empty_zarr_group(store, group, mode):
- import zarr # type: ignore
+ import zarr
root = zarr.open_group(store, mode=mode)
root.create_group(group, overwrite=True)
@@ -92,7 +92,7 @@ def _datatree_to_zarr(
consolidated: bool = True,
**kwargs,
):
- from zarr.convenience import consolidate_metadata # type: ignore
+ from zarr.convenience import consolidate_metadata
if kwargs.get("group", None) is not None:
raise NotImplementedError(
Index: xarray-2024.03.0/xarray/datatree_/datatree/tests/test_extensions.py
===================================================================
--- xarray-2024.03.0.orig/xarray/datatree_/datatree/tests/test_extensions.py
+++ xarray-2024.03.0/xarray/datatree_/datatree/tests/test_extensions.py
@@ -18,16 +18,15 @@ class TestAccessor:
return "bar"
dt: DataTree = DataTree()
- assert dt.demo.foo == "bar" # type: ignore
+ assert dt.demo.foo == "bar"
# accessor is cached
- assert dt.demo is dt.demo # type: ignore
+ assert dt.demo is dt.demo
# check descriptor
- assert dt.demo.__doc__ == "Demo accessor." # type: ignore
- # TODO: typing doesn't seem to work with accessors
- assert DataTree.demo.__doc__ == "Demo accessor." # type: ignore
- assert isinstance(dt.demo, DemoAccessor) # type: ignore
+ assert dt.demo.__doc__ == "Demo accessor."
+ assert DataTree.demo.__doc__ == "Demo accessor." # type: ignore
+ assert isinstance(dt.demo, DemoAccessor)
assert DataTree.demo is DemoAccessor # type: ignore
with pytest.warns(Warning, match="overriding a preexisting attribute"):
Index: xarray-2024.03.0/xarray/datatree_/docs/source/conf.py
===================================================================
--- xarray-2024.03.0.orig/xarray/datatree_/docs/source/conf.py
+++ xarray-2024.03.0/xarray/datatree_/docs/source/conf.py
@@ -17,9 +17,9 @@ import inspect
import os
import sys
-import sphinx_autosummary_accessors
+import sphinx_autosummary_accessors # type: ignore
-import datatree
+import datatree # type: ignore
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -286,7 +286,7 @@ htmlhelp_basename = "datatree_doc"
# -- Options for LaTeX output --------------------------------------------------
-latex_elements = {
+latex_elements: dict = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').