8000 Lint (#3373) · pydata/xarray@4254b4a · GitHub
[go: up one dir, main page]

Skip to content

Commit 4254b4a

Browse files
authored
Lint (#3373)
* raise exception instance, not class * isort * isort * Bump mypy version
1 parent 283b4fe commit 4254b4a

File tree

18 files changed

+30
-29
lines changed

18 files changed

+30
-29
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
hooks:
1212
- id: flake8
1313
- repo: https://github.com/pre-commit/mirrors-mypy
14-
rev: v0.720 # Must match ci/requirements/*.yml
14+
rev: v0.730 # Must match ci/requirements/*.yml
1515
hooks:
1616
- id: mypy
1717
# run these occasionally, ref discussion https://github.com/pydata/xarray/pull/3194

asv_bench/benchmarks/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def requires_dask():
1818
try:
1919
import dask # noqa: F401
2020
except ImportError:
21-
raise NotImplementedError
21+
raise NotImplementedError()
2222

2323

2424
def randn(shape, frac_nan=None, chunks=None, seed=0):

asv_bench/benchmarks/data 8000 set_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def setup(self):
458458
try:
459459
import distributed
460460
except ImportError:
461-
raise NotImplementedError
461+
raise NotImplementedError()
462462
self.client = distributed.Client()
463463
self.write = create_delayed_write()
464464

ci/requirements/py36-min-all-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies:
2020
- iris=2.2.0
2121
- lxml=4.4.1 # optional dep of pydap
2222
- matplotlib=3.1.1
23-
- mypy==0.720 # Must match .pre-commit-config.yaml
23+
- mypy==0.730 # Must match .pre-commit-config.yaml
2424
- nc-time-axis=1.2.0
2525
- netcdf4=1.5.1.2
2626
- numba=0.45.1

ci/requirements/py36.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies:
2020
- iris>=1.10
2121
- lxml # optional dep of pydap
2222
- matplotlib
23-
- mypy==0.720 # Must match .pre-commit-config.yaml
23+
- mypy==0.730 # Must match .pre-commit-config.yaml
2424
- nc-time-axis
2525
- netcdf4
2626
- numba

ci/requirements/py37-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies:
2020
- iris>=1.10
2121
- lxml # optional dep of pydap
2222
- matplotlib
23-
- mypy==0.720 # Must match .pre-commit-config.yaml
23+
- mypy==0.730 # Must match .pre-commit-config.yaml
2424
- nc-time-axis
2525
- netcdf4
2626
- numba

ci/requirements/py37.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies:
2020
- iris>=1.10
2121
- lxml # optional dep of pydap
2222
- matplotlib
23-
- mypy==0.720 # Must match .pre-commit-config.yaml
23+
- mypy==0.730 # Must match .pre-commit-config.yaml
2424
- nc-time-axis
2525
- netcdf4
2626
- numba

properties/test_encode_decode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
These ones pass, just as you'd hope!
55
66
"""
7-
import pytest
7+
import pytest # isort:skip
88

99
pytest.importorskip("hypothesis")
1010

xarray/backends/common.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ def __len__(self):
8888
return len(self.variables)
8989

9090
def get_dimensions(self): # pragma: no cover
91-
raise NotImplementedError
91+
raise NotImplementedError()
9292

9393
def get_attrs(self): # pragma: no cover
94-
raise NotImplementedError
94+
raise NotImplementedError()
9595

9696
def get_variables(self): # pragma: no cover
97-
raise NotImplementedError
97+
raise NotImplementedError()
9898

9999
def get_encoding(self):
100100
return {}
@@ -247,13 +247,13 @@ def encode_attribute(self, a):
247247
return a
248248

249249
def set_dimension(self, d, l): # pragma: no cover
250-
raise NotImplementedError
250+
raise NotImplementedError()
251251

252252
def set_attribute(self, k, v): # pragma: no cover
253-
raise NotImplementedError
253+
raise NotImplementedError()
254254

255255
def set_variable(self, k, v): # pragma: no cover
256-
raise NotImplementedError
256+
raise NotImplementedError()
257257

258258
def store_dataset(self, dataset):
259259
"""

xarray/backends/file_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class FileManager:
2828

2929
def acquire(self, needs_lock=True):
3030
"""Acquire the file object from this manager."""
31-
raise NotImplementedError
31+
raise NotImplementedError()
3232

3333
def acquire_context(self, needs_lock=True):
3434
"""Context manager for acquiring a file. Yields a file object.
@@ -37,11 +37,11 @@ def acquire_context(self, needs_lock=True):
3737
(i.e., removes it from any cache) if an exception is raised from the
3838
context. It *does not* automatically close the file.
3939
"""
40-
raise NotImplementedError
40+
raise NotImplementedError()
4141

4242
def close(self, needs_lock=True):
4343
"""Close the file object associated with this manager, if needed."""
44-
raise NotImplementedError
44+
raise NotImplementedError()
4545

4646

4747
class CachingFileManager(FileManager):

0 commit comments

Comments
 (0)
0