2018-05-17 10:14:13 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-cftime
|
|
|
|
|
#
|
2023-08-30 11:44:19 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2018-05-17 10:14:13 +00:00
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2019-03-07 10:20:43 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-05-17 10:14:13 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
2023-12-01 11:35:29 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2018-05-17 10:14:13 +00:00
|
|
|
Name: python-cftime
|
2023-12-01 11:35:29 +00:00
|
|
|
Version: 1.6.3
|
2018-05-17 10:14:13 +00:00
|
|
|
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
|
2023-08-30 11:44:19 +00:00
|
|
|
BuildRequires: %{python_module Cython >= 0.29.20}
|
- 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.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cftime?expand=0&rev=10
2020-07-09 04:37:52 +00:00
|
|
|
BuildRequires: %{python_module numpy-devel}
|
2018-05-17 10:14:13 +00:00
|
|
|
BuildRequires: %{python_module numpy}
|
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
|
BuildRequires: %{python_module setuptools >= 18.0}
|
|
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2023-08-30 11:44:19 +00:00
|
|
|
Requires: python-Cython >= 0.29.20
|
2018-05-17 10:14:13 +00:00
|
|
|
Requires: python-numpy
|
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
2019-03-07 10:20:43 +00:00
|
|
|
Time-handling functionality from netcdf4-python.
|
2018-05-17 10:19:30 +00:00
|
|
|
Was split out from netcfd4-python in 2016.
|
2018-05-17 10:14:13 +00:00
|
|
|
|
|
|
|
|
%prep
|
2023-08-30 11:44:19 +00:00
|
|
|
%autosetup -p1 -n cftime-%{version}
|
2019-03-07 10:20:43 +00:00
|
|
|
# do not require cov/xdist/etc
|
|
|
|
|
rm setup.cfg
|
2018-05-17 10:14:13 +00:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%python_install
|
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
|
|
|
|
|
|
|
|
|
%check
|
2019-03-07 10:20:43 +00:00
|
|
|
%python_expand PYTHONPATH="%{buildroot}%{$python_sitearch}" py.test-%{$python_bin_suffix} -v
|
2018-05-17 10:14:13 +00:00
|
|
|
|
|
|
|
|
%files %{python_files}
|
- 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.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cftime?expand=0&rev=12
2021-03-02 05:54:51 +00:00
|
|
|
%license LICENSE
|
2019-03-07 10:20:43 +00:00
|
|
|
%doc README.md
|
2018-05-17 10:14:13 +00:00
|
|
|
%{python_sitearch}/*
|
|
|
|
|
|
|
|
|
|
%changelog
|