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
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
- name: Checkout Code Repository
uses: actions/checkout@v3

- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.11"

- name: Install and Run Pre-commit
uses: pre-commit/[email protected]
Expand All @@ -55,7 +55,7 @@ jobs:
shell: bash -l {0}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion conda-env/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ channels:
dependencies:
# Base - required for building the package.
# =========================================
- python >=3.9
- python >=3.10
- cf_xarray >=0.9.1
- cftime
- dask
Expand Down
2 changes: 1 addition & 1 deletion conda-env/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ channels:
dependencies:
# Base - required for building the package.
# =========================================
- python >=3.9
- python >=3.10
- cf_xarray >=0.9.1
- cftime
- dask
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Instructions

We recommend using the Conda environment creation procedure to install ``xcdat``.
The advantage with following this approach is that Conda will attempt to resolve
dependencies (e.g. ``python >= 3.9``) for compatibility.
dependencies for compatibility.

To create an ``xcdat`` Conda environment, run:

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "xcdat"
dynamic = ["version"]
description = "Xarray Climate Data Analysis Tools"
readme = "README.rst"
requires-python = ">=3.9"
requires-python = ">=3.10"
license = { text = "Apache-2.0" }
authors = [{ name = "xCDAT developers" }]
classifiers = [
Expand All @@ -16,7 +16,6 @@ classifiers = [
"License :: OSI Approved :: Apache-2.0 License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down
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
Loading