Skip to content

Commit

Permalink
Merge pull request #227 from Unidata/v1.4.0rel
Browse files Browse the repository at this point in the history
prepare for v1.4.0 release
  • Loading branch information
jswhit authored Jan 31, 2021
2 parents 59cd60e + 603f47a commit 0b95e72
Show file tree
Hide file tree
Showing 12 changed files with 768 additions and 759 deletions.
7 changes: 5 additions & 2 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
version 1.4.0 (not yet released)
================================
version 1.4.0 (release tag v1.4.0.rel)
======================================
* `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.

version 1.3.1 (release tag v1.3.1rel)
=====================================
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Time-handling functionality from netcdf4-python
## News
For details on the latest updates, see the [Changelog](https://github.com/Unidata/cftime/blob/master/Changelog).

2/1/2021: Version 1.4.0 released. License changed to MIT (GPL'ed code replaced).
Roundtrip accuracy improved for units other than microseconds. Added
cftime.datetime.toordinal method, returns integer julian day number.

1/17/2021: Version 1.3.1 released.

11/16/2020: Version 1.3.0 released. **API change**: The `cftime.datetime` constructor now creates
Expand Down
8 changes: 4 additions & 4 deletions docs/_build/html/_static/pygments.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #eeffcc; }
.highlight .c { color: #408090; font-style: italic } /* Comment */
Expand Down
11 changes: 11 additions & 0 deletions docs/_build/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@
day number within the current year starting with 1 for January 1st.</p>
</dd></dl>

<dl class="py method">
<dt id="cftime.datetime.toordinal">
<code class="sig-name descname">toordinal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">self</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cftime.datetime.toordinal" title="Permalink to this definition"></a></dt>
<dd><p>Return julian day ordinal.</p>
<p>January 1 of the year -4713 is day 0 for the julian,gregorian and standard
calendars.</p>
<p>November 11 of the year -4714 is day 0 for the proleptic gregorian calendar.</p>
<p>January 1 of the year zero is day 0 for the 360_day, 365_day, 366_day and
no_leap calendars.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
Expand Down
2 changes: 2 additions & 0 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ <h2 id="T">T</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api.html#cftime.datetime.timetuple">timetuple() (cftime.datetime method)</a>
</li>
<li><a href="api.html#cftime.datetime.toordinal">toordinal() (cftime.datetime method)</a>
</li>
</ul></td>
</tr></table>
Expand Down
5 changes: 4 additions & 1 deletion docs/_build/html/objects.inv
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
# Project: cftime
# Version:
# The remainder of this file is compressed using zlib.
xڕ��J�0��}��^[t�{[X���O0&�60�!I���Ic�V��KHf�/&iy�Bf��2b$dw �l���&G�[VW|ƚ3|pF=�$A�aJb7j���~U8ir"zF�������{��)�B���~5�)�u��ɋ���PjWڦ�S"b�~��zT��r�ռp���3NA�����=š%�X.��֧Wd�!����ؖ�(�yB�T�a���� ��pV�9vj/U�:� xGJ���%M������D� ���rKt�n^C*����/�۩^�y���\�UvGk�x)zk{LJ��c�y��z�>��Q
xڕ��j� ��y
��&�{���ҲK[}���&���h޾�fSJ�^Dg�O�Q� 2;�!{``e�Ew9R߳���!��3�<�}�1��A� �f����I�� �M'�~v�O)rM�������B$/��C�]i��N�����Y
�A��-�W��5қ�q
��.0�Fl)-�r��<�"#a�t�b�Rm*��;QvM �c!���;� �� �Y��ء=U��'��)!s4s�4��{�+"��H�n���y�i��*��o�zNd�5����֎�R�����k1Dz��-tX}L��.
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
SRCDIR = os.path.join(BASEDIR,'src')
CMDS_NOCYTHONIZE = ['clean','clean_cython','sdist']
COMPILER_DIRECTIVES = {}
DEFINE_MACROS = None
DEFINE_MACROS = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
FLAG_COVERAGE = '--cython-coverage' # custom flag enabling Cython line tracing
NAME = 'cftime'
CFTIME_DIR = os.path.join(SRCDIR, NAME)
Expand Down Expand Up @@ -78,7 +78,7 @@ def description():
'warn.maybe_uninitialized': False,
'warn.unreachable': False,
'warn.unused': False}
DEFINE_MACROS = [('CYTHON_TRACE', '1'),
DEFINE_MACROS += [('CYTHON_TRACE', '1'),
('CYTHON_TRACE_NOGIL', '1')]
if FLAG_COVERAGE in sys.argv:
sys.argv.remove(FLAG_COVERAGE)
Expand Down
14 changes: 8 additions & 6 deletions src/cftime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from ._cftime import utime, JulianDayFromDate, DateFromJulianDay, UNIT_CONVERSION_FACTORS
from ._cftime import _parse_date, date2index, time2index, datetime, real_datetime
from ._cftime import DatetimeNoLeap, DatetimeAllLeap, Datetime360Day, DatetimeJulian, \
DatetimeGregorian, DatetimeProlepticGregorian
from ._cftime import datetime, real_datetime, _parse_date
from ._cftime import num2date, date2num, date2index, time2index, num2pydate
from ._cftime import microsec_units, millisec_units, \
sec_units, hr_units, day_units, min_units
from ._cftime import num2date, date2num, date2index, num2pydate
sec_units, hr_units, day_units, min_units,\
UNIT_CONVERSION_FACTORS
from ._cftime import __version__
# legacy functions in _cftime_legacy.pyx
from ._cftime import DatetimeNoLeap, DatetimeAllLeap, Datetime360Day, DatetimeJulian, \
DatetimeGregorian, DatetimeProlepticGregorian
from ._cftime import utime, JulianDayFromDate, DateFromJulianDay
Loading

0 comments on commit 0b95e72

Please sign in to comment.