Skip to content

Commit

Permalink
Fix ruff issue with strict=False in zip()
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder committed Jan 17, 2025
1 parent 841d2ba commit 34c9d4d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/test_regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,10 @@ def test_map_latitude_coarse_to_fine(self):
[[0.29289322]],
]

for x, y in zip(mapping, expected_mapping):
for x, y in zip(mapping, expected_mapping, strict=False):
np.testing.assert_allclose(x, y)

for x2, y2 in zip(weights, expected_weigths):
for x2, y2 in zip(weights, expected_weigths, strict=False):
np.testing.assert_allclose(x2, y2)

def test_map_latitude_fine_to_coarse(self):
Expand Down
2 changes: 1 addition & 1 deletion xcdat/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def _get_cftime_coords(offsets: np.ndarray, units: str, calendar: str) -> np.nda

# Convert offsets to `np.float64` to avoid "TypeError: unsupported type
# for timedelta days component: numpy.int64".
flat_offsets = flat_offsets.astype("float")
flat_offsets = flat_offsets.astype("float") # type: ignore

# We don't need to do calendar arithmetic here because the units and
# offsets are in "months" or "years", which means leap days should not
Expand Down
2 changes: 1 addition & 1 deletion xcdat/regridder/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _create_gaussian_axis(nlats: int) -> Tuple[xr.DataArray, xr.DataArray]:
},
)

bounds = (180.0 / np.pi) * np.arcsin(bounds)
bounds = (180.0 / np.pi) * np.arcsin(bounds) # type: ignore

bounds_data = np.zeros((points.shape[0], 2))
bounds_data[:, 0] = bounds[:-1]
Expand Down
2 changes: 1 addition & 1 deletion xcdat/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ def _convert_df_to_dt(self, df: pd.DataFrame) -> np.ndarray:
dates = [
self.date_type(year, month, day, hour)
for year, month, day, hour in zip(
df_new.year, df_new.month, df_new.day, df_new.hour
df_new.year, df_new.month, df_new.day, df_new.hour, strict=False
)
]

Expand Down

0 comments on commit 34c9d4d

Please sign in to comment.