Skip to content

Commit

Permalink
Merge pull request #235 from Unidata/fixtests
Browse files Browse the repository at this point in the history
remove legacy code, update tests that used it
  • Loading branch information
jswhit authored Mar 26, 2021
2 parents 4e527df + 0495249 commit d8fb27f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 537 deletions.
11 changes: 8 additions & 3 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ version 1.5.0 (not yet released)
real-world calendars using 'has_year_zero' cftime.datetime kwarg (PR #234).
Default is False for 'real-world' calendars and True
for idealized calendars.
* PR #234 also added "change_calendar" cftime.datetime method to switch to another
'real-world' calendar. Enables comparison of cftime.datetime instances
with different 'real-world' calendars.
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`). PR #235.

version 1.4.1 (release tag v1.4.1.rel)
======================================
Expand Down
17 changes: 9 additions & 8 deletions src/cftime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from ._cftime import datetime, real_datetime, _parse_date
from ._cftime import (datetime, real_datetime,
_parse_date, _dateparse, _datesplit)
from ._cftime import num2date, date2num, date2index, time2index, num2pydate
from ._cftime import microsec_units, millisec_units, \
sec_units, hr_units, day_units, min_units,\
UNIT_CONVERSION_FACTORS
from ._cftime import (microsec_units, millisec_units,
sec_units, hr_units, day_units, min_units,
UNIT_CONVERSION_FACTORS)
from ._cftime import __version__, CFWarning
from ._cftime import DatetimeNoLeap, DatetimeAllLeap, Datetime360Day, DatetimeJulian, \
DatetimeGregorian, DatetimeProlepticGregorian
# legacy functions in _cftime_legacy.pyx
from ._cftime import utime, JulianDayFromDate, DateFromJulianDay
# these will be removed in a future release
from ._cftime import (DatetimeNoLeap, DatetimeAllLeap, Datetime360Day,
Datetime360Day, DatetimeJulian,
DatetimeGregorian, DatetimeProlepticGregorian)
3 changes: 0 additions & 3 deletions src/cftime/_cftime.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,3 @@ but allows for dates that don't exist in the proleptic gregorian calendar.
def __init__(self, *args, **kwargs):
kwargs['calendar']='proleptic_gregorian'
super().__init__( *args, **kwargs)

# include legacy stuff no longer used by cftime.datetime
include "_cftime_legacy.pyx"
Loading

0 comments on commit d8fb27f

Please sign in to comment.