commit 52c33bda6481864272755dfe07574bc59772157374e764496b61ea05832c7875 Author: Markéta Machová Date: Tue Oct 21 11:51:23 2025 +0000 - Update to 1.6.5 * python 3.14 wheels, 3.8/3.9 support dropped. * roundtrip not correct when dates are all python datetime instances and calendar not proleptic_gregorian (issue #354). * fix cftime.datetime.strftime so it works with two digit year formatting (%y, issue #362). * speed up comparisions (using __richcmp___) and update docs. Issue #365. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cftime?expand=0&rev=28 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/cftime-1.6.4.post1.tar.gz b/cftime-1.6.4.post1.tar.gz new file mode 100644 index 0000000..e2c3739 --- /dev/null +++ b/cftime-1.6.4.post1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50ac76cc9f10ab7bd46e44a71c51a6927051b499b4407df4f29ab13d741b942f +size 54631 diff --git a/cftime-1.6.5.tar.gz b/cftime-1.6.5.tar.gz new file mode 100644 index 0000000..05a5668 --- /dev/null +++ b/cftime-1.6.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8225fed6b9b43fb87683ebab52130450fc1730011150d3092096a90e54d1e81e +size 326605 diff --git a/python-cftime.changes b/python-cftime.changes new file mode 100644 index 0000000..da3ac15 --- /dev/null +++ b/python-cftime.changes @@ -0,0 +1,213 @@ +------------------------------------------------------------------- +Tue Oct 21 09:24:09 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 1.6.5 + * python 3.14 wheels, 3.8/3.9 support dropped. + * roundtrip not correct when dates are all python datetime + instances and calendar not proleptic_gregorian (issue #354). + * fix cftime.datetime.strftime so it works with two digit year + formatting (%y, issue #362). + * speed up comparisions (using __richcmp___) and update docs. Issue #365. + +------------------------------------------------------------------- +Thu Dec 5 14:43:54 UTC 2024 - Dirk Müller + +- update to 1.6.4.post1: + * metadata fixes + +------------------------------------------------------------------- +Sun Jun 9 10:39:23 UTC 2024 - Ben Greiner + +- Update to 1.6.4 + * return empty array if one provided to date2num (issue #315). + * numpy 2.0 compatibility (issue #325). + * handle nan/inf in num2date (issue #328). +- Build PEP517 + +------------------------------------------------------------------- +Fri Dec 1 11:31:40 UTC 2023 - Dirk Müller + +- update to 1.6.3: + * add support for formats without separators in strptime (e.g. + '20200229', issue #301). + * set the c_api_binop_methods compiler directive to True to + retain Cython 0.x behavior for arithmetic operators for + Cython >= 3.0.0 + * support for python 3.12. +- drop cython3.patch (upstream) + +------------------------------------------------------------------- +Wed Aug 30 11:03:06 UTC 2023 - Markéta Machová + +- add upstream cython3.patch + +------------------------------------------------------------------- +Thu Oct 27 22:15:54 UTC 2022 - Yogalakshmi Arunachalam + +- Update to version 1.6.2 + * num2date should not fail on an empty integer array (issue #287). + * longdouble keyword in date2num so that a roundtrip from a time to a date + and back again does not lose microsecond precision when the units require + the times be encoded as floating point values (PR #284) + * added strptime method (issue #277). + * cibuildwheel wheel-building workflow added to github actions by @ocefpaf (triggers binary + wheel builds and uploads to pypi automatically when GH release created). PR #290. + +------------------------------------------------------------------- +Mon Sep 26 19:50:01 UTC 2022 - Yogalakshmi Arunachalam + +- Update to version 1.6.1 + * fix failing tests on windows with numpy 1.23.0 (issue #278) + * expose to_tuple module function in public API. + +------------------------------------------------------------------- +Sun Mar 27 14:54:45 UTC 2022 - Dirk Müller + +- update to 1.6.0: + * fix for masked array inputs + * improved performance of the num2date algorithm, in some cases providing + an over 100x speedup + * fix for date2index for select != 'exact' when select='exact' works + * silently change calendar='gregorian' to 'standard' internally, + since 'gregorian' deprecated in CF v1.9 + * add "is_leap_year" function + * wheels that work on Apple M1 (arm64) available on pypi. + * added support for "common_year" and "common_years" units for "noleap" + and "365_day" calendars + * check consistency of year arg and has_year_zero kwarg in cftime.datetime + (issue #248). Also assume if has_year_zero not specified it should be True + if year=0. Allow replace method to change has_year_zero. Issue UserWarning + if year set to zero and calendar default is changed from False to True + (so that user is aware the resulting instance will not be CF compliant). + * '360_day' was missing from list of 'idealized' calendars. + * fixed a bug that led to subclasses losing their type identity upon + pickling + * Change default behavior of proleptic_gregorian to has_year_zero=T + (to be consistent with ISO-8601 since CF does not specify the year zero convention + for this calendar). Issue warning when trying to + to create a cftime.datetime instance that is not allowed in CF + * clean-up deprecated calendar specific subclasses + * added string formatting support to `cftime.datetime` objects + (via `cftime.datetime.__format__`) + * add support for astronomical year numbering (including year zero) for + real-world calendars using 'has_year_zero' cftime.datetime kwarg + Default is False for 'real-world' calendars ('julian', 'gregorian'/'standard', + 'proleptic_gregorian'). Ignored for idealized calendars like '360_day + (they always have year zero). + * add "change_calendar" cftime.datetime method to switch to another + 'real-world' calendar. Enable comparison of cftime.datetime instances + with different 'real-world' calendars (using the new change_calendar method) + * remove legacy `utime` class, and legacy `JulianDayFromDate` and + `DateFromJulianDay` functions (replaced by `cftime.datetime.toordinal` + and `cftime.datetime.fromordinal`). + * Change ValueError to TypeError in __sub__ + +------------------------------------------------------------------- +Tue Mar 2 05:51:33 UTC 2021 - Steve Kowalik + +- Update to 1.4.1: + + * Restore use of calendar-specific sub-classes in `cftime.num2date`, + `cftime.datetime.__add__`, and `cftime.datetime.__sub__`. The use of them + will be removed in a later release. + * add 'fromordinal' static method to create a cftime.datetime instance + from a julian day ordinal and calendar (inverse of 'toordinal'). + * `cftime.date2num` will now always return an array of integers, if the units + and times allow. Previously this would only be true if the units were + 'microseconds' (PR #225). In other circumstances, as before, `cftime.date2num` + will return an array of floats. + * Rewrite of julian day/calendar functions (_IntJulianDayToCalendar and + _IntJulianDayFromCalendar) to remove GPL'ed code. cftime license + changed to MIT (to be consistent with netcdf4-python). + * Added datetime.toordinal() (returns julian day, kwarg 'fractional' + can be used to include fractional day). + * cftime.datetime no longer uses calendar-specific sub-classes. + * fix for issue #211 (PR #212) bug in masked array handling in date2num) + * switch from travis/appveyor to github actions for CI/CD (PR #215). + * switch to cython language_level=3 (no more support for python 2) (PR #217). + * add __init__.py to test dir so pytest coverage works again. Add Coveralls + step to github actions workflow to upload coverage data to coveralls.io (PR + #217). + * move package under 'src' directory so cftime can be imported + from install dir (PR #218 - see + https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure). + * zero pad years in strtime (issue #194) + * have cftime.datetime constuctor create 'calendar-aware' instances (default is + 'standard' calendar, if calendar='' or None the instance is not calendar aware and some + methods, like dayofwk, dayofyr, __add__ and __sub__, will not work). Fixes issue #198. + The calendar specific sub-classes are now deprecated, but remain for now + as stubs that just instantiate the base class and override __repr__. + * update regex in _cpdef _parse_date so reference years with more than four + digits can be handled. + * Change default calendar in cftime.date2num from 'standard' to None + (calendar associated with first input datetime object is used). + * add `cftime.datetime.tzinfo=None` for compatibility with python datetime + (issue #208). + * num2date uses 'proleptic_gregorian' scheme when basedate is post-Gregorian but date is pre-Gregorian + (issue #182). + * fix 1.2.0 regression (date2num no longer works with numpy scalar array inputs, issue #185). + * Fix for issue #187 (have date2num round to the nearest second when within 1 + microsecond). + * Fix for issue #189 (leap years calculated incorrectly for negative years in + proleptic_gregorian calendar). +- No longer build for Python 3.6, due to no NumPy. +- Correct license file name. + +------------------------------------------------------------------- +Thu Jul 9 04:32:49 UTC 2020 - Steve Kowalik + +- Update to 1.2.0: + * Return the default values of dayofwk and dayofyr when calendar + is '' (issue #173). + * fix treatment of masked arrays in num2date and date2num (issue #175). + Also make sure masked arrays are output from num2date/date2num if + masked arrays are input. + * Where possible, use timedelta arithmetic to decode times exactly within + num2date (issue #171). + * Make taking the difference between two cftime datetimes to produce a + timedelta exact to the microsecond; depending on the units encoding, + this enables date2num to be exact as well (issue #109). + * utime.date2num/utime.num2date now just call module level functions. + JulianDayFromDate/DateFromJulianDay no longer used internally (PR #180). + * add isoformat method for compatibility with python datetime (issue #152). + * make 'standard' default calendar for cftime.datetime + so that dayofwk,dayofyr methods don't fail (issue #169). + * change dayofwk and dayofyr attributes into properties (issue #158) + * fix for issue #165 (python datetime should be returned when + only_use_cftime_datimes=False). + * include pyproject.toml in MANIFEST.in so it gets + included in source tarball (issue #154). + * fix microsecond formatting issue, ensure identical results + computed for arrays and scales (issue #143, PR #146). + * improved exceptions for time differences (issue #128, PR #131). + * fix intersphinx entries (issue #133, PR #133) + * make only_use_cftime_datetimes=True by default, so cftime datetime + instances are returned by default by num2date (instead of returning python + datetime instances where possible). Issue #136, PR #135. + * Add daysinmonth attribute (issue #137, PR #138). + * If only_use_python_datetimes=True and only_use_cftime_datetimes=False, + num2date only returns python datetime instances and raises an exception + if this is not possible. + * Fix for fractional seconds in reference date in units string +- Add numpy-devel to BuildRequires. + +------------------------------------------------------------------- +Fri Jan 24 15:13:06 UTC 2020 - Marketa Calabkova + +- update to 1.0.4.2 + * fix for date2num error when converting a DatetimeProlepticGregorian + object + +------------------------------------------------------------------- +Thu Mar 7 10:15:40 UTC 2019 - Tomáš Chvátal + +- Update to 1.0.3.4: + * fixes for python2.7 + * Various flake fixes + * More tests + * python 3.8 support + +------------------------------------------------------------------- +Thu May 17 10:04:22 UTC 2018 - tchvatal@suse.com + +- Initial commit, needed by python-netCDF4 diff --git a/python-cftime.spec b/python-cftime.spec new file mode 100644 index 0000000..d090237 --- /dev/null +++ b/python-cftime.spec @@ -0,0 +1,64 @@ +# +# spec file for package python-cftime +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-cftime +Version: 1.6.5 +Release: 0 +Summary: Time-handling functionality from netcdf4-python +License: MIT +URL: https://github.com/Unidata/cftime +Source: https://files.pythonhosted.org/packages/source/c/cftime/cftime-%{version}.tar.gz + +BuildRequires: %{python_module Cython >= 0.29.20} +BuildRequires: %{python_module numpy-devel} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools >= 18.0} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-numpy +%python_subpackages + +%description +Time-handling functionality from netcdf4-python. +Was split out from netcfd4-python in 2016. + +%prep +%autosetup -p1 -n cftime-%{version} +# do not require cov/xdist/etc +rm setup.cfg + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} + +%check +%pytest_arch + +%files %{python_files} +%license LICENSE +%doc README.md +%{python_sitearch}/cftime +%{python_sitearch}/cftime-%{version}.dist-info + +%changelog