From 791fd0b4c53dfcaddd1eae27c51e75ac2eca81b3 Mon Sep 17 00:00:00 2001 From: Katelyn FitzGerald <7872563+kafitzgerald@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:18:53 -0700 Subject: [PATCH 1/3] Python 3.13 support and testing (#688) * Python 3.13 * update release notes --- .github/workflows/ci-release.yml | 2 +- .github/workflows/ci.yml | 2 +- build_envs/docs.yml | 2 +- build_envs/environment.yml | 2 +- docs/release-notes.rst | 1 + setup.cfg | 3 ++- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 457bd98a..eda82ce7 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: checkout uses: actions/checkout@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0abdaa8f..82c2f302 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: checkout uses: actions/checkout@v4 diff --git a/build_envs/docs.yml b/build_envs/docs.yml index 50cf37ce..1c4ddb3f 100644 --- a/build_envs/docs.yml +++ b/build_envs/docs.yml @@ -2,7 +2,7 @@ name: gc-docs channels: - conda-forge dependencies: - - python>=3.10,<3.13 + - python>=3.10,<3.14 - pre_commit - geocat-datafiles - geocat-viz diff --git a/build_envs/environment.yml b/build_envs/environment.yml index 17fd8925..92085496 100644 --- a/build_envs/environment.yml +++ b/build_envs/environment.yml @@ -2,7 +2,7 @@ name: geocat_comp_build channels: - conda-forge dependencies: - - python>=3.10,<3.13 # minimum support 3.10 + - python>=3.10,<3.14 # minimum support 3.10 - cf_xarray>=0.3.1 # min version 0.3.1 for dependencies - cftime - dask diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 5103e243..5de26816 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -13,6 +13,7 @@ vYYYY.MM.## (unreleased) Maintenance ^^^^^^^^^^^ +* Add support and testing for Python 3.13 by`Katelyn FitzGerald`_ in (:pr:`687`) * Remove NumPy version pin by `Katelyn FitzGerald`_ in (:pr:`686`) v2025.01.0 (January 28, 2025) diff --git a/setup.cfg b/setup.cfg index 53019f95..0f2a0426 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,12 +18,13 @@ classifiers = Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 Topic :: Scientific/Engineering [options] zip_safe = False include_package_data = True -python_requires = >=3.10, <3.13 +python_requires = >=3.10, <3.14 packages = find_namespace: setup_requires = setuptools_scm From 7e5c456b15a75ce5aa53f53a3b9b51761fd53316 Mon Sep 17 00:00:00 2001 From: Katelyn FitzGerald <7872563+kafitzgerald@users.noreply.github.com> Date: Tue, 25 Feb 2025 10:44:06 -0700 Subject: [PATCH 2/3] Non nanosecond datetime tests (#691) * add test coverage for inferring calendars from datetime objects with different units * support for non-nanosecond datetimes * update release notes * formatting --- docs/release-notes.rst | 6 +++++- geocat/comp/climatologies.py | 3 ++- test/test_climatologies.py | 7 +++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 5de26816..6720d307 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -11,9 +11,13 @@ Release Notes vYYYY.MM.## (unreleased) ------------------------ +Enhancements +^^^^^^^^^^^^ +* Add tests and support for non-nanosecond datetime objects by `Katelyn FitzGerald`_ in (:pr:`691`) + Maintenance ^^^^^^^^^^^ -* Add support and testing for Python 3.13 by`Katelyn FitzGerald`_ in (:pr:`687`) +* Add support and testing for Python 3.13 by `Katelyn FitzGerald`_ in (:pr:`687`) * Remove NumPy version pin by `Katelyn FitzGerald`_ in (:pr:`686`) v2025.01.0 (January 28, 2025) diff --git a/geocat/comp/climatologies.py b/geocat/comp/climatologies.py index 6e5a2425..f183b3a0 100644 --- a/geocat/comp/climatologies.py +++ b/geocat/comp/climatologies.py @@ -105,7 +105,8 @@ def _infer_calendar_name(dates): anytime. It was copied to preserve the version that is compatible with functions in climatologies.py """ - if np.asarray(dates).dtype == "datetime64[ns]": + + if np.issubdtype(dates.dtype, np.datetime64): return "proleptic_gregorian" else: return np.asarray(dates).ravel()[0].calendar diff --git a/test/test_climatologies.py b/test/test_climatologies.py index 71c28aa3..a73c13d2 100644 --- a/test/test_climatologies.py +++ b/test/test_climatologies.py @@ -6,6 +6,7 @@ import xarray as xr from geocat.comp import climate_anomaly, month_to_season, calendar_average, climatology_average +from geocat.comp.climatologies import _infer_calendar_name ##### Helper Functions ##### @@ -943,3 +944,9 @@ def test_non_standard_calendars_climatology_average(self, name, dset, expected) -> None: result = climatology_average(dset, freq='month') xr.testing.assert_allclose(result, expected) + + +@pytest.mark.parametrize("units", ("s", "ms", "us", "ns")) +def test_units_infer_calendar_name(units): + time = xr.date_range("2000-01-01", periods=10, freq="1D", unit=units) + assert _infer_calendar_name(time) == "proleptic_gregorian" From ac0546c4dca407536a2b370b78b63a125770bbd3 Mon Sep 17 00:00:00 2001 From: Anissa Zacharias Date: Tue, 25 Feb 2025 11:56:49 -0700 Subject: [PATCH 3/3] update release notes for v2025.02.0 (#694) --- docs/release-notes.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 6720d307..80fdf58d 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -8,8 +8,11 @@ Release Notes ============= -vYYYY.MM.## (unreleased) ------------------------- +v2025.02.0 (February 25, 2025) +------------------------------ +This release adds support and testing for Python 3.13, unpins numpy dependency, increases support for +`non-nanosecond datetime objects `__, +and updates our `code of conduct `__. Enhancements ^^^^^^^^^^^^ @@ -17,9 +20,13 @@ Enhancements Maintenance ^^^^^^^^^^^ -* Add support and testing for Python 3.13 by `Katelyn FitzGerald`_ in (:pr:`687`) +* Add support and testing for Python 3.13 by `Katelyn FitzGerald`_ in (:pr:`688`) * Remove NumPy version pin by `Katelyn FitzGerald`_ in (:pr:`686`) +Documentation +^^^^^^^^^^^^^ +* Updates Code of Conduct by `Orhan Eroglu`_ in `48b16cc `__ + v2025.01.0 (January 28, 2025) ----------------------------- v2025.01.0 releases a collection of small changes and pins ``scipy`` to <1.15 @@ -432,6 +439,7 @@ Maintenance .. _`Cora Schneck`: https://github.com/cyschneck .. _`Philip Chmielowiec`: https://github.com/philipc2 .. _`AnshRoshan`: https://github.com/AnshRoshan +.. _`Orhan Eroglu`: https://github.com/erogluorhan .. TEMPLATE