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

[pull] main from NCAR:main #60

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build_envs/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build_envs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 15 additions & 2 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@
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 <https://github.com/NCAR/geocat-comp/issues/682>`__,
and updates our `code of conduct <https://github.com/NCAR/geocat-comp/commit/48b16cc0143ce63ebc4ce2735d0d1afc5f7bee5f>`__.

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:`688`)
* Remove NumPy version pin by `Katelyn FitzGerald`_ in (:pr:`686`)

Documentation
^^^^^^^^^^^^^
* Updates Code of Conduct by `Orhan Eroglu`_ in `48b16cc <https://github.com/NCAR/geocat-comp/commit/48b16cc0143ce63ebc4ce2735d0d1afc5f7bee5f>`__

v2025.01.0 (January 28, 2025)
-----------------------------
v2025.01.0 releases a collection of small changes and pins ``scipy`` to <1.15
Expand Down Expand Up @@ -427,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
Expand Down
3 changes: 2 additions & 1 deletion geocat/comp/climatologies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions test/test_climatologies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 #####
Expand Down Expand Up @@ -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"