Skip to content

Commit

Permalink
restore default behavior (don't change proleptic gregorian to has_yea…
Browse files Browse the repository at this point in the history
…r_zero=True)
  • Loading branch information
jswhit committed Mar 25, 2021
1 parent c0ab8fb commit 1f2e090
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 82 deletions.
15 changes: 2 additions & 13 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,8 @@ version 1.5.0 (not yet released)
(via `cftime.datetime.__format__`) PR #232.
* add support for astronomical year numbering (including year zero) for
real-world calendars using 'has_year_zero' cftime.datetime kwarg (PR #234).
Default is False for 'julian','gregorian'/'standard', but True
for 'proleptic_gregorian' (since ISO 8601 has a year zero).
The change for proleptic_gregorian is not backwards-compatible, users
who have been employing dates before 1-1-1 must now set has_year_zero=False
explicitly.
The calendar-specific defaults conform to the proposed updated CF standard
(https://github.com/cf-convention/cf-conventions/issues/298).
Ignored for idealized calendars like '360_day'
(they always have year zero). Strictly speaking, CF
does not allow for dates before 1-1-1 in the 'julian'
or 'gregorian'/'standard' calendars, or dates before 1-1-1 in
the 'proleptic_gregorian' calendar without a year zero, but cftime will
but will issue a warning without raising an exception.
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.
Expand Down
Binary file modified docs/_build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/installing.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_static/language_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_static/pygments.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pre { line-height: 125%; margin: 0; }
pre { line-height: 125%; }
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; }
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for the full-text search.
*
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
38 changes: 19 additions & 19 deletions docs/_build/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Installation" href="installing.html" />
Expand Down Expand Up @@ -59,10 +58,8 @@
is used and the year zero exists. If set to False for real-world
calendars, then historical year numbering is used and the year 1 is
preceded by year -1 and no year zero exists.
The defaults are set to conform with
CF conventions (False for ‘julian’, ‘gregorian’/’standard’, True
for ‘proleptic_gregorian’ (ISO 8601) and True for the idealized
calendars ‘noleap’/’365_day’, ‘360_day’, 366_day’/’all_leap’)
The defaults are False for real-world calendars
and True for idealized calendars.
The defaults can only be over-ridden for the real-world calendars,
for the the idealized calendars the year zero
always exists and the has_year_zero kwarg is ignored.
Expand Down Expand Up @@ -100,10 +97,8 @@
is used and the year zero exists. If set to False for real-world
calendars, then historical year numbering is used and the year 1 is
preceded by year -1 and no year zero exists.
The defaults are set to conform with
CF conventions (False for ‘julian’, ‘gregorian’/’standard’, True
for ‘proleptic_gregorian’ (ISO 8601) and True for the idealized
calendars ‘noleap’/’365_day’, ‘360_day’, 366_day’/’all_leap’)
The defaults are False for real-world calendars
and True for idealized calendars.
The defaults can only be over-ridden for the real-world calendars,
for the the idealized calendars the year zero
always exists and the has_year_zero kwarg is ignored.
Expand Down Expand Up @@ -137,10 +132,8 @@
is used and the year zero exists. If set to False for real-world
calendars, then historical year numbering is used and the year 1 is
preceded by year -1 and no year zero exists.
The defaults are set to conform with
CF conventions (False for ‘julian’, ‘gregorian’/’standard’, True
for ‘proleptic_gregorian’ (ISO 8601) and True for the idealized
calendars ‘noleap’/’365_day’, ‘360_day’, 366_day’/’all_leap’)
The defaults are False for real-world calendars
and True for idealized calendars.
The defaults can only be over-ridden for the real-world calendars,
for the the idealized calendars the year zero
always exists and the has_year_zero kwarg is ignored.
Expand All @@ -152,11 +145,20 @@
instances.</p>
<p>The default format of the string produced by strftime is controlled by self.format
(default %Y-%m-%d %H:%M:%S).</p>
<dl class="py method">
<dt id="cftime.datetime.change_calendar">
<code class="sig-name descname">change_calendar</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">self</span></em>, <em class="sig-param"><span class="n">calendar</span></em>, <em class="sig-param"><span class="n">has_year_zero</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cftime.datetime.change_calendar" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="cftime.datetime.fromordinal">
<em class="property">static </em><code class="sig-name descname">fromordinal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">jday</span></em>, <em class="sig-param"><span class="n">calendar</span><span class="o">=</span><span class="default_value">'standard'</span></em>, <em class="sig-param"><span class="n">has_year_zero</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#cftime.datetime.fromordinal" title="Permalink to this definition"></a></dt>
<dd><p>Create a datetime instance from a julian day ordinal, calendar
and (optionally) year zero convention (inverse of toordinal).</p>
and (optionally) year zero convention (inverse of toordinal). The
Julian day number is the number of days since noon UTC January 1, 4713
in the proleptic julian calendar with no year zero (November 24, 4713
in the proleptic gregorian calendar that includes the year zero). For
idealized calendars, the origin is noon UTC of the year zero.</p>
</dd></dl>

<dl class="py method">
Expand Down Expand Up @@ -234,10 +236,8 @@
is used and the year zero exists. If set to False for real-world
calendars, then historical year numbering is used and the year 1 is
preceded by year -1 and no year zero exists.
The defaults are set to conform with
CF conventions (False for ‘julian’, ‘gregorian’/’standard’, True
for ‘proleptic_gregorian’ (ISO 8601) and True for the idealized
calendars ‘noleap’/’365_day’, ‘360_day’, 366_day’/’all_leap’)
The defaults are False for real-world calendars
and True for idealized calendars.
The defaults can only be over-ridden for the real-world calendars,
for the the idealized calendars the year zero
always exists and the has_year_zero kwarg is ignored.
Expand Down Expand Up @@ -347,7 +347,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Jeff Whitaker.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.3.1</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.4.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
7 changes: 5 additions & 2 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="#" />
<link rel="search" title="Search" href="search.html" />

Expand Down Expand Up @@ -57,6 +56,10 @@ <h2 id="C">C</h2>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api.html#cftime.datetime.change_calendar">change_calendar() (cftime.datetime method)</a>
</li>
</ul></td>
</tr></table>

<h2 id="D">D</h2>
Expand Down Expand Up @@ -200,7 +203,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Jeff Whitaker.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.3.1</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.4.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

</div>
Expand Down
3 changes: 1 addition & 2 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Installation" href="installing.html" />
Expand Down Expand Up @@ -116,7 +115,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Jeff Whitaker.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.3.1</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.4.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
3 changes: 1 addition & 2 deletions docs/_build/html/installing.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="API" href="api.html" />
Expand Down Expand Up @@ -132,7 +131,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Jeff Whitaker.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.3.1</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.4.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
3 changes: 1 addition & 2 deletions docs/_build/html/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />

Expand Down Expand Up @@ -111,7 +110,7 @@ <h3 id="searchlabel">Quick search</h3>
&copy;2018, Jeff Whitaker.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.3.1</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.4.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script src="_static/searchtools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="#" />
<script src="searchindex.js" defer></script>
Expand Down Expand Up @@ -102,7 +102,7 @@ <h3>Related Topics</h3>
&copy;2018, Jeff Whitaker.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.3.1</a>
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.4.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

</div>
Expand Down
Loading

0 comments on commit 1f2e090

Please sign in to comment.