Skip to content

Commit 04480ba

Browse files
author
Joseph Hamman
committed
fix mypy checks
1 parent 94519b3 commit 04480ba

File tree

6 files changed

+19
-4
lines changed

6 files changed

+19
-4
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,16 @@ repos:
3333
hooks:
3434
- id: prettier
3535
language_version: system
36+
37+
- repo: https://github.com/pre-commit/mirrors-mypy
38+
rev: v0.910
39+
hooks:
40+
- id: mypy
41+
additional_dependencies: [
42+
# Type stubs
43+
types-setuptools,
44+
types-pkg_resources,
45+
# Dependencies that are typed
46+
numpy,
47+
xarray,
48+
]

conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# type: ignore
12
import pytest
23

34

doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15+
# type: ignore
16+
1517
import os
1618
import sys
1719

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
# type: ignore
23
import os
34

45
from setuptools import find_packages, setup

xbatcher/generators.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import itertools
44
from collections import OrderedDict
5-
from collections.abc import Iterator
6-
from typing import Any, Dict, Hashable
5+
from typing import Any, Dict, Hashable, Iterator
76

87
import xarray as xr
98

@@ -163,7 +162,7 @@ def _gen_batches(self) -> dict:
163162
]
164163
dsc = xr.concat(all_dsets, dim='input_batch')
165164
new_input_dims = [
166-
dim + new_dim_suffix for dim in self.input_dims
165+
str(dim) + new_dim_suffix for dim in self.input_dims
167166
]
168167
batches.append(_maybe_stack_batch_dims(dsc, new_input_dims))
169168
else:

xbatcher/loaders/torch.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def __getitem__(self, idx) -> Tuple[Any, Any]:
5757

5858
if self.target_transform:
5959
y_batch = self.target_transform(y_batch)
60-
print('x_batch.shape', X_batch.shape)
6160
return X_batch, y_batch
6261

6362

0 commit comments

Comments
 (0)