diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index 17a7fb92..3481f0b3 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -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/action@v3.0.0 @@ -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 diff --git a/conda-env/ci.yml b/conda-env/ci.yml index 1801ee20..017428c3 100644 --- a/conda-env/ci.yml +++ b/conda-env/ci.yml @@ -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 diff --git a/conda-env/dev.yml b/conda-env/dev.yml index 1f90f97d..fad006ab 100644 --- a/conda-env/dev.yml +++ b/conda-env/dev.yml @@ -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 diff --git a/docs/getting-started-guide/installation.rst b/docs/getting-started-guide/installation.rst index 60a9204f..a51d4df2 100644 --- a/docs/getting-started-guide/installation.rst +++ b/docs/getting-started-guide/installation.rst @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 28b850d0..62342544 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ @@ -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", diff --git a/tests/test_regrid.py b/tests/test_regrid.py index 64c509a6..861b0124 100644 --- a/tests/test_regrid.py +++ b/tests/test_regrid.py @@ -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): diff --git a/xcdat/dataset.py b/xcdat/dataset.py index 21932216..f5139cd2 100644 --- a/xcdat/dataset.py +++ b/xcdat/dataset.py @@ -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 diff --git a/xcdat/regridder/grid.py b/xcdat/regridder/grid.py index b9e1ae7f..aa4b754b 100644 --- a/xcdat/regridder/grid.py +++ b/xcdat/regridder/grid.py @@ -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] diff --git a/xcdat/temporal.py b/xcdat/temporal.py index a6853251..3367e06a 100644 --- a/xcdat/temporal.py +++ b/xcdat/temporal.py @@ -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 ) ]