42
42
43
43
def _get_default_engine_remote_uri ():
44
44
try :
45
- import netCDF4 # noqa
45
+ import netCDF4 # noqa: F401
46
46
47
47
engine = "netcdf4"
48
48
except ImportError : # pragma: no cover
49
49
try :
50
- import pydap # noqa
50
+ import pydap # noqa: F401
51
51
52
52
engine = "pydap"
53
53
except ImportError :
@@ -61,13 +61,13 @@ def _get_default_engine_remote_uri():
61
61
def _get_default_engine_grib ():
62
62
msgs = []
63
63
try :
64
- import Nio # noqa
64
+ import Nio # noqa: F401
65
65
66
66
msgs += ["set engine='pynio' to access GRIB files with PyNIO" ]
67
67
except ImportError : # pragma: no cover
68
68
pass
69
69
try :
70
- import cfgrib # noqa
70
+ import cfgrib # noqa: F401
71
71
72
72
msgs += ["set engine='cfgrib' to access GRIB files with cfgrib" ]
73
73
except ImportError : # pragma: no cover
<
10000
svg aria-hidden="true" focusable="false" class="octicon octicon-unfold" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"> @@ -80,7 +80,7 @@ def _get_default_engine_grib():
80
80
81
81
def _get_default_engine_gz ():
82
82
try :
83
- import scipy # noqa
83
+ import scipy # noqa: F401
84
84
85
85
engine = "scipy"
86
86
except ImportError : # pragma: no cover
@@ -90,12 +90,12 @@ def _get_default_engine_gz():
90
90
91
91
def _get_default_engine_netcdf ():
92
92
try :
93
- import netCDF4 # noqa
93
+ import netCDF4 # noqa: F401
94
94
95
95
engine = "netcdf4"
96
96
except ImportError : # pragma: no cover
97
97
try :
98
- import scipy .io .netcdf # noqa
98
+ import scipy .io .netcdf # noqa: F401
99
99
100
100
engine = "scipy"
101
101
except ImportError :
@@ -722,44 +722,41 @@ def open_mfdataset(
722
722
):
723
723
"""Open multiple files as a single dataset.
724
724
725
- If combine='by_coords' then the function ``combine_by_coords`` is used to
726
- combine the datasets into one before returning the result, and if
727
- combine='nested' then ``combine_nested`` is used. The filepaths must be
728
- structured according to which combining function is used, the details of
729
- which are given in the documentation for ``combine_by_coords`` and
730
- ``combine_nested``. By default the old (now deprecated) ``auto_combine``
731
- will be used, please specify either ``combine='by_coords'`` or
732
- ``combine='nested'`` in future. Requires dask to be installed. See
733
- documentation for details on dask [1]. Attributes from the first dataset
734
- file are used for the combined dataset.
725
+ If combine='by_coords' then the function ``combine_by_coords`` is used to combine
726
+ the datasets into one before returning the result, and if combine='nested' then
727
+ ``combine_nested`` is used. The filepaths must be structured according to which
728
+ combining function is used, the details of which are given in the documentation for
729
+ ``combine_by_coords`` and ``combine_nested``. By default the old (now deprecated)
730
+ ``auto_combine`` will be used, please specify either ``combine='by_coords'`` or
731
+ ``combine='nested'`` in future. Requires dask to be installed. See documentation for
732
+ details on dask [1]. Attributes from the first dataset file are used for the
733
+ combined dataset.
735
734
736
735
Parameters
737
736
----------
738
737
paths : str or sequence
739
- Either a string glob in the form "path/to/my/files/*.nc" or an explicit
740
- list of files to open. Paths can be given as strings or as pathlib
741
- Paths. If concatenation along more than one dimension is desired, then
742
- ``paths`` must be a nested list-of-lists (see ``manual_combine`` for
743
- details). (A string glob will be expanded to a 1-dimensional list.)
738
+ Either a string glob in the form "path/to/my/files/*.nc" or an explicit list of
739
+ files to open. Paths can be given as strings or as pathlib Paths. If
740
+ concatenation along more than one dimension is desired, then ``paths`` must be a
741
+ nested list-of-lists (see ``manual_combine`` for details). (A string glob will
742
+ be expanded to a 1-dimensional list.)
744
743
chunks : int or dict, optional
745
- Dictionary with keys given by dimension names and values given by chunk
746
- sizes. In general, these should divide the dimensions of each dataset.
747
- If int, chunk each dimension by ``chunks``.
748
- By default, chunks will be chosen to load entire input files into
749
- memory at once. This has a major impact on performance: please see the
750
- full documentation for more details [2].
744
+ Dictionary with keys given by dimension names and values given by chunk sizes.
745
+ In general, these should divide the dimensions of each dataset. If int, chunk
746
+ each dimension by ``chunks``. By default, chunks will be chosen to load entire
747
+ input files into memory at once. This has a major impact on performance: please
748
+ see the full documentation for more details [2].
751
749
concat_dim : str, or list of str, DataArray, Index or None, optional
752
- Dimensions to concatenate files along. You only
753
- need to provide this argument if any of the dimensions along which you
754
- want to concatenate is not a dimension in the original datasets, e.g.,
755
- if you want to stack a collection of 2D arrays along a third dimension.
756
- Set ``concat_dim=[..., None, ...]`` explicitly to
750
+ Dimensions to concatenate files along. You only need to provide this argument
751
+ if any of the dimensions along which you want to concatenate is not a dimension
752
+ in the original datasets, e.g., if you want to stack a collection of 2D arrays
753
+ along a third dimension. Set ``concat_dim=[..., None, ...]`` explicitly to
757
754
disable concatenation along a particular dimension.
758
755
combine : {'by_coords', 'nested'}, optional
759
- Whether ``xarray.combine_by_coords`` or ``xarray.combine_nested`` is
760
- used to combine all the data. If this argument is not provided,
761
- `xarray.auto_combine` is used, but in the future this behavior will
762
- switch to use `xarray.combine_by_coords` by default.
756
+ Whether ``xarray.combine_by_coords`` or ``xarray.combine_nested`` is used to
757
+ combine all the data. If this argument is not provided, `xarray.auto_combine` is
758
+ used, but in the future this behavior will switch to use
759
+ `xarray.combine_by_coords` by default.
763
760
compat : {'identical', 'equals', 'broadcast_equals',
764
761
'no_conflicts', 'override'}, optional
765
762
String indicating how to compare variables of the same name for
@@ -854,7 +851,7 @@ def open_mfdataset(
854
851
855
852
.. [1] http://xarray.pydata.org/en/stable/dask.html
856
853
.. [2] http://xarray.pydata.org/en/stable/dask.html#chunking-and-performance
857
- """ # noqa
854
+ """
858
855
if isinstance (paths , str ):
859
856
if is_remote_uri (paths ):
860
857
raise ValueError (
0 commit comments