Skip to content

Commit ce15385

Browse files
authored
run black and blackdoc (#4381)
1 parent ffce4ec commit ce15385

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+255
-286
lines changed

xarray/backends/file_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ def __hash__(self):
314314

315315

316316
class DummyFileManager(FileManager):
317-
"""FileManager that simply wraps an open file in the FileManager interface.
318-
"""
317+
"""FileManager that simply wraps an open file in the FileManager interface."""
319318

320319
def __init__(self, value):
321320
self._value = value

xarray/backends/h5netcdf_.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ def _h5netcdf_create_group(dataset, name):
6767

6868

6969
class H5NetCDFStore(WritableCFDataStore):
70-
"""Store for reading and writing data via h5netcdf
71-
"""
70+
"""Store for reading and writing data via h5netcdf"""
7271

7372
__slots__ = (
7473
"autoclose",

xarray/backends/lru_cache.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ def __getitem__(self, key: K) -> V:
5555
return value
5656

5757
def _enforce_size_limit(self, capacity: int) -> None:
58-
"""Shrink the cache if necessary, evicting the oldest items.
59-
"""
58+
"""Shrink the cache if necessary, evicting the oldest items."""
6059
while len(self._cache) > capacity:
6160
key, value = self._cache.popitem(last=False)
6261
if self._on_evict is not None:

xarray/backends/pseudonetcdf_.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ def _getitem(self, key):
3535

3636

3737
class PseudoNetCDFDataStore(AbstractDataStore):
38-
"""Store for accessing datasets via PseudoNetCDF
39-
"""
38+
"""Store for accessing datasets via PseudoNetCDF"""
4039

4140
@classmethod
4241
def open(cls, filename, lock=None, mode=None, **format_kwargs):

xarray/backends/pynio_.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def _getitem(self, key):
4141

4242

4343
class NioDataStore(AbstractDataStore):
44-
"""Store for accessing datasets via PyNIO
45-
"""
44+
"""Store for accessing datasets via PyNIO"""
4645

4746
def __init__(self, filename, mode="r", lock=None, **kwargs):
4847
import Nio

xarray/backends/rasterio_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def shape(self):
5050
return self._shape
5151

5252
def _get_indexer(self, key):
53-
""" Get indexer for rasterio array.
53+
"""Get indexer for rasterio array.
5454
5555
Parameter
5656
---------

xarray/backends/zarr.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ def encode_zarr_variable(var, needs_copy=True, name=None):
257257

258258

259259
class ZarrStore(AbstractWritableDataStore):
260-
"""Store for reading and writing data via zarr
261-
"""
260+
"""Store for reading and writing data via zarr"""
262261

263262
__slots__ = (
264263
"append_dim",

xarray/coding/cftime_offsets.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ def _adjust_n_years(other, n, month, reference_day):
221221

222222

223223
def _shift_month(date, months, day_option="start"):
224-
"""Shift the date to a month start or end a given number of months away.
225-
"""
224+
"""Shift the date to a month start or end a given number of months away."""
226225
import cftime
227226

228227
delta_year = (date.month + months) // 12
@@ -354,8 +353,7 @@ def onOffset(self, date):
354353

355354

356355
class QuarterOffset(BaseCFTimeOffset):
357-
"""Quarter representation copied off of pandas/tseries/offsets.py
358-
"""
356+
"""Quarter representation copied off of pandas/tseries/offsets.py"""
359357

360358
_freq: ClassVar[str]
361359
_default_month: ClassVar[int]

xarray/coding/strings.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ def bytes_to_char(arr):
145145

146146

147147
def _numpy_bytes_to_char(arr):
148-
"""Like netCDF4.stringtochar, but faster and more flexible.
149-
"""
148+
"""Like netCDF4.stringtochar, but faster and more flexible."""
150149
# ensure the array is contiguous
151150
arr = np.array(arr, copy=False, order="C", dtype=np.string_)
152151
return arr.reshape(arr.shape + (1,)).view("S1")
@@ -189,8 +188,7 @@ def char_to_bytes(arr):
189188

190189

191190
def _numpy_char_to_bytes(arr):
192-
"""Like netCDF4.chartostring, but faster and more flexible.
193-
"""
191+
"""Like netCDF4.chartostring, but faster and more flexible."""
194192
# based on: http://stackoverflow.com/a/10984878/809705
195193
arr = np.array(arr, copy=False, order="C")
196194
dtype = "S" + str(arr.shape[-1])

xarray/coding/variables.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,13 @@ class VariableCoder:
3535
def encode(
3636
self, variable: Variable, name: Hashable = None
3737
) -> Variable: # pragma: no cover
38-
"""Convert an encoded variable to a decoded variable
39-
"""
38+
"""Convert an encoded variable to a decoded variable"""
4039
raise NotImplementedError()
4140

4241
def decode(
4342
self, variable: Variable, name: Hashable = None
4443
) -> Variable: # pragma: no cover
45-
"""Convert an decoded variable to a encoded variable
46-
"""
44+
"""Convert an decoded variable to a encoded variable"""
4745
raise NotImplementedError()
4846

4947

0 commit comments

Comments
 (0)