Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.9 support #720

Merged
merged 5 commits into from
Jan 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix ruff issue with strict=False in zip()
  • Loading branch information
tomvothecoder committed Jan 17, 2025
commit 34c9d4d1fd120ec109dd41247e7185ffe9c07761
4 changes: 2 additions & 2 deletions tests/test_regrid.py
Original file line number Diff line number Diff line change
@@ -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):
2 changes: 1 addition & 1 deletion xcdat/dataset.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion xcdat/regridder/grid.py
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 1 addition & 1 deletion xcdat/temporal.py
Original file line number Diff line number Diff line change
@@ -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
)
]