Skip to content

Commit

Permalink
use strict keyword for zip
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Dec 13, 2024
1 parent 019ac9b commit 30156f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions deltametrics/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def get_known_coords(self, dimensions):
# get the coordinates and dimensions from the data
self.dims = under.dims
self.coords = [under.coords[dim].data for dim in self.dims]
self.dimensions = dict(zip(self.dims, self.coords))
self.dimensions = dict(zip(self.dims, self.coords, strict=True))
# otherwise, check for the arguments passed
elif not (dimensions is None):
# if dimensions was passed, it must be a dictionary
Expand Down Expand Up @@ -418,7 +418,7 @@ def get_known_coords(self, dimensions):
self.coords = coords

self.known_coords = self.dims
self.dimensions = dict(zip(self.dims, self.coords))
self.dimensions = dict(zip(self.dims, self.coords, strict=True))

def connect(self, *args, **kwargs):
"""Connect to the data file.
Expand Down
2 changes: 1 addition & 1 deletion deltametrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _attribute_checker(self, checklist):

log_list = list(att_dict.values())
log_form = [value for string, value in
zip(log_list, att_dict.keys()) if not string]
zip(log_list, att_dict.keys(), strict=True) if not string]
if not all(log_list):
raise RuntimeError('Required attribute(s) not assigned: '
+ str(log_form))
Expand Down
6 changes: 3 additions & 3 deletions tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,23 +790,23 @@ def test_one_histogram_with_ax(self):
def test_multiple_no_sets(self):
sets = [np.histogram(np.random.normal(lc, s, size=500),
bins=self.bins, density=True) for lc, s in
zip(self.locs, self.scales)]
zip(self.locs, self.scales, strict=True)]
fig, ax = plt.subplots()
show_histograms(*sets, ax=ax)
plt.close()

def test_multiple_no_sets_alphakwarg(self):
sets = [np.histogram(np.random.normal(lc, s, size=500),
bins=self.bins, density=True) for lc, s in
zip(self.locs, self.scales)]
zip(self.locs, self.scales, strict=True)]
fig, ax = plt.subplots()
show_histograms(*sets, ax=ax, alpha=0.4)
plt.close()

def test_multiple_with_sets(self):
sets = [np.histogram(np.random.normal(lc, s, size=500),
bins=self.bins, density=True) for lc, s in
zip(self.locs, self.scales)]
zip(self.locs, self.scales, strict=True)]
fig, ax = plt.subplots()
show_histograms(*sets, sets=[0, 0, 1, 1, 2], ax=ax)
plt.close()
Expand Down

0 comments on commit 30156f4

Please sign in to comment.