From 30156f4b7d7bd6bf6fc7b0cbf93246de1bd9793c Mon Sep 17 00:00:00 2001 From: mcflugen Date: Wed, 11 Dec 2024 11:14:58 -0700 Subject: [PATCH] use strict keyword for zip --- deltametrics/io.py | 4 ++-- deltametrics/utils.py | 2 +- tests/test_plot.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deltametrics/io.py b/deltametrics/io.py index 08e97ed6..5bdebcb8 100644 --- a/deltametrics/io.py +++ b/deltametrics/io.py @@ -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 @@ -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. diff --git a/deltametrics/utils.py b/deltametrics/utils.py index 4fe9ecb3..ec211cda 100644 --- a/deltametrics/utils.py +++ b/deltametrics/utils.py @@ -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)) diff --git a/tests/test_plot.py b/tests/test_plot.py index efbaab37..3a6a2c42 100644 --- a/tests/test_plot.py +++ b/tests/test_plot.py @@ -790,7 +790,7 @@ 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() @@ -798,7 +798,7 @@ def test_multiple_no_sets(self): 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() @@ -806,7 +806,7 @@ def test_multiple_no_sets_alphakwarg(self): 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()