Skip to content

Commit

Permalink
Revert "Drop Python 3.9 support (#720)"
Browse files Browse the repository at this point in the history
This reverts commit d8d91e1.
  • Loading branch information
tomvothecoder committed Jan 17, 2025
1 parent d8d91e1 commit c93b5bf
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
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.11
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.11"
python-version: "3.10"

- 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.10", "3.11", "3.12"]
python-version: ["3.9", "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.10
- python >=3.9
- 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.10
- python >=3.9
- 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 for compatibility.
dependencies (e.g. ``python >= 3.9``) for compatibility.

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

Expand Down
3 changes: 2 additions & 1 deletion 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.10"
requires-python = ">=3.9"
license = { text = "Apache-2.0" }
authors = [{ name = "xCDAT developers" }]
classifiers = [
Expand All @@ -16,6 +16,7 @@ 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, strict=False):
for x, y in zip(mapping, expected_mapping):
np.testing.assert_allclose(x, y)

for x2, y2 in zip(weights, expected_weigths, strict=False):
for x2, y2 in zip(weights, expected_weigths):
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") # type: ignore
flat_offsets = flat_offsets.astype("float")

# 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) # type: ignore
bounds = (180.0 / np.pi) * np.arcsin(bounds)

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, strict=False
df_new.year, df_new.month, df_new.day, df_new.hour
)
]

Expand Down

0 comments on commit c93b5bf

Please sign in to comment.