File tree 5 files changed +15
-20
lines changed 5 files changed +15
-20
lines changed Original file line number Diff line number Diff line change 1
1
prune xarray/datatree_*
2
+ recursive-include xarray/datatree_/datatree *.py
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ exclude_lines = ["pragma: no cover", "if TYPE_CHECKING"]
88
88
enable_error_code = " redundant-self"
89
89
exclude = [
90
90
' xarray/util/generate_.*\.py' ,
91
- ' xarray/datatree_/.*\.py' ,
91
+ ' xarray/datatree_/doc/ .*\.py' ,
92
92
]
93
93
files = " xarray"
94
94
show_error_codes = true
@@ -97,11 +97,6 @@ warn_redundant_casts = true
97
97
warn_unused_configs = true
98
98
warn_unused_ignores = true
99
99
100
- # Ignore mypy errors for modules imported from datatree_.
101
- [[tool .mypy .overrides ]]
102
- ignore_errors = true
103
- module = " xarray.datatree_.*"
104
-
105
100
# Much of the numerical computing stack doesn't have type annotations yet.
106
101
[[tool .mypy .overrides ]]
107
102
ignore_missing_imports = true
Original file line number Diff line number Diff line change 3
3
4
4
def _get_nc_dataset_class (engine ):
5
5
if engine == "netcdf4" :
6
- from netCDF4 import Dataset # type: ignore
6
+ from netCDF4 import Dataset
7
7
elif engine == "h5netcdf" :
8
- from h5netcdf .legacyapi import Dataset # type: ignore
8
+ from h5netcdf .legacyapi import Dataset
9
9
elif engine is None :
10
10
try :
11
11
from netCDF4 import Dataset
12
12
except ImportError :
13
- from h5netcdf .legacyapi import Dataset # type: ignore
13
+ from h5netcdf .legacyapi import Dataset
14
14
else :
15
15
raise ValueError (f"unsupported engine: { engine } " )
16
16
return Dataset
@@ -78,7 +78,7 @@ def _datatree_to_netcdf(
78
78
79
79
80
80
def _create_empty_zarr_group (store , group , mode ):
81
- import zarr # type: ignore
81
+ import zarr
82
82
83
83
root = zarr .open_group (store , mode = mode )
84
84
root .create_group (group , overwrite = True )
@@ -92,7 +92,7 @@ def _datatree_to_zarr(
92
92
consolidated : bool = True ,
93
93
** kwargs ,
94
94
):
95
- from zarr .convenience import consolidate_metadata # type: ignore
95
+ from zarr .convenience import consolidate_metadata
96
96
97
97
if kwargs .get ("group" , None ) is not None :
98
98
raise NotImplementedError (
Original file line number Diff line number Diff line change @@ -18,16 +18,15 @@ def foo(self):
18
18
return "bar"
19
19
20
20
dt : DataTree = DataTree ()
21
- assert dt .demo .foo == "bar" # type: ignore
21
+ assert dt .demo .foo == "bar"
22
22
23
23
# accessor is cached
24
- assert dt .demo is dt .demo # type: ignore
24
+ assert dt .demo is dt .demo
25
25
26
26
# check descriptor
27
- assert dt .demo .__doc__ == "Demo accessor." # type: ignore
28
- # TODO: typing doesn't seem to work with accessors
29
- assert DataTree .demo .__doc__ == "Demo accessor." # type: ignore
30
- assert isinstance (dt .demo , DemoAccessor ) # type: ignore
27
+ assert dt .demo .__doc__ == "Demo accessor."
28
+ assert DataTree .demo .__doc__ == "Demo accessor." # type: ignore
29
+ assert isinstance (dt .demo , DemoAccessor )
31
30
assert DataTree .demo is DemoAccessor # type: ignore
32
31
33
32
with pytest .warns (Warning , match = "overriding a preexisting attribute" ):
Original file line number Diff line number Diff line change 17
17
import os
18
18
import sys
19
19
20
- import sphinx_autosummary_accessors
20
+ import sphinx_autosummary_accessors # type: ignore
21
21
22
- import datatree
22
+ import datatree # type: ignore
23
23
24
24
# If extensions (or modules to document with autodoc) are in another directory,
25
25
# add these directories to sys.path here. If the directory is relative to the
286
286
287
287
# -- Options for LaTeX output --------------------------------------------------
288
288
289
- latex_elements = {
289
+ latex_elements : dict = {
290
290
# The paper size ('letterpaper' or 'a4paper').
291
291
# 'papersize': 'letterpaper',
292
292
# The font size ('10pt', '11pt' or '12pt').
You can’t perform that action at this time.
0 commit comments