Skip to content

Commit

Permalink
Merge pull request #253 from jenshnielsen/support_mypy_930
Browse files Browse the repository at this point in the history
support typechecking with mypy 0.930
  • Loading branch information
astafan8 committed Jan 4, 2022
2 parents c4c31a1 + dda773f commit cdeb974
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plottr/data/datadict.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ def remove_invalid_entries(self) -> 'DataDict':
datavals = self.data_vals(d)
rows = datavals.reshape(-1, int(np.prod(ishp[d])))

_idxs = np.array([])
_idxs: np.ndarray = np.array([])

# get indices of all rows that are fully None
if len(ishp[d]) == 0:
Expand Down
2 changes: 1 addition & 1 deletion plottr/utils/testdata/dispersive_qubit_readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def angle_data(theta: float, n: int = 100) -> np.ndarray:
data = angle_data(np.pi/2., n=1000)
extent = np.abs(data).max()
hist, xe, ye = np.histogram2d(data.real, data.imag,
bins=np.linspace(-extent, extent, 51))
bins=list(np.linspace(-extent, extent, 51)))
fig, ax = plt.subplots(1, 1)
im = ax.pcolormesh(xe, ye, hist.T)
cb = fig.colorbar(im)
Expand Down
6 changes: 3 additions & 3 deletions plottr/utils/testdata/testdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from plottr.data.datadict import DataDict


def generate_2d_scalar_simple(nx: int, ny: int, ndeps: int = 1) -> Iterable[Dict[str, int]]:
def generate_2d_scalar_simple(nx: int, ny: int, ndeps: int = 1) -> Iterable[Dict[str, float]]:
"""
Generate 2d example data, with axes x, y.
Expand All @@ -34,9 +34,9 @@ def generate_2d_scalar_simple(nx: int, ny: int, ndeps: int = 1) -> Iterable[Dict
xx, yy = np.meshgrid(x, y, indexing='ij')

for x, y in zip(xx.reshape(-1), yy.reshape(-1)):
ret = dict(x=x, y=y)
ret = dict(x=float(x), y=float(y))
for n in range(ndeps):
ret[f'z_{n}'] = x * y * n
ret[f'z_{n}'] = float(x * y * n)
yield ret


Expand Down

0 comments on commit cdeb974

Please sign in to comment.