Skip to content

Commit dc4fbea

Browse files
authored
A few clarifying updates to the design doc.
1 parent 2979826 commit dc4fbea

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

design_docs/generalize_calendar.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ between two dates) and of making plots that are consistent with these calendars.
5252

5353
<h2> Requirement: The 'Time' coordinate of xarray data sets must support at least years
5454
0001 and 9999, and preferably any conceivable value<br>
55-
Date last modified: 2017/02/09 <br>
55+
Date last modified: 2017/02/16 <br>
5656
Contributors: Xylar Asay-Davis
5757
</h2>
5858

@@ -94,8 +94,8 @@ performed with the calendar-aware functions `netCDF4.date2num` and
9494
(for efficiency and simplicity of calling code) in addition to single values.
9595

9696
Curve ploting can be supported with `matplotlib.pyplot.plot_date`, which takes a date
97-
of exactly the format used here (days since 0001-01-01), which was part of the reason
98-
for choosing this format for the date.
97+
of exactly the format used here (days since 0001-01-01). The compatibility with `plot_date`
98+
was part of the reason for choosing this format for the date.
9999

100100
<h2> Design solution: The 'Time' coordinate of xarray data sets must support at least years
101101
0001 and 9999, and preferably any conceivable value<br>
@@ -106,14 +106,14 @@ Contributors: Xylar Asay-Davis
106106
Same as above. In theory, the use of days since 0001-01-01 would allow any year
107107
to be supported, not just the range from 0001 to 9999. However, the conversions
108108
to `datetime.datetime` objects for mathematical manipulation will constrain
109-
the dates to be between datetime.min (0001-01-01) and datetime.max (9999-12-31).
109+
the dates to be between `datetime.min` (0001-01-01) and `datetime.max` (9999-12-31).
110110

111111

112112
<h1> Design and Implementation </h1>
113113

114114
<h2> Implementation: The 'Time' coordinate of xarray data sets must be consistent
115115
with the MPAS calendar <br>
116-
Date last modified: 2017/02/11 <br>
116+
Date last modified: 2017/02/16 <br>
117117
Contributors: Xylar Asay-Davis
118118
</h2>
119119

@@ -131,18 +131,19 @@ from ..timekeeping.utility import string_to_days_since_date, \
131131
days_to_datetime, datetime_to_days
132132
```
133133
**This violates the first requirement in the
134-
[MpasXarray class design doc](https://github.com/xylar/MPAS-Analysis/blob/design_doc_variable_mapping_reorg/design_docs/mpas_xarray_class.md).
134+
[Design Document: Moving variable mapping out of mpas_xarray](https://github.com/xylar/MPAS-Analysis/blob/design_doc_variable_mapping_reorg/design_docs/variable_mapping_reorg.md).
135135
I am open to alternative solutions for keeping `mpas_xarray` separate from the rest
136136
of analysis but these 3 functions do not conceptually belong in `mpas_xarray`. The
137137
problem is exacerbated by the fact that there are analysis-specific functions in
138138
`timekeeping`, meaning that this cannot easily be made a submodule of `mpas_xarray`
139139
(nor would this make very much logical sense). Having 2 `timekeeping` modules, one
140140
for `mpas_xarray` and one for MPAS-Analysis, seems unnecessarily confunsing.**
141141

142-
The methods and helper functions named `open_multifile_dataset` haave been updated
143-
to use this method for parsing times. This involves removing the `year_offset` argument
144-
and adding an optional `simulation_start_time` argument for supplying a date to use to
145-
convert variables like `daysSinceStartOfSim` to days since 0001-01-01.
142+
The functions `generalized_reader.open_multifile_dataset` and
143+
`mpas_xarray.open_multifile_dataset` have been updated to use this method for parsing
144+
times. This involves removing the `year_offset` argument and adding an optional
145+
`simulation_start_time` argument for supplying a date to use to convert variables
146+
like `daysSinceStartOfSim` to days since 0001-01-01.
146147

147148
An example of opening a data set and manipulating times withe the new approach in
148149
the OHC script is:
@@ -279,16 +280,13 @@ Date last modified: 2017/02/11 <br>
279280
Contributors: Xylar Asay-Davis
280281
</h2>
281282
In [xylar/generalize_calendar](https://github.com/xylar/MPAS-Analysis/tree/generalize_calendar),
282-
unit testing has been added for timekeeping and mpas_xarray and MpasAnsalysisXarray that checks
283-
both the `gregorian` and `gregorian_noleap` calendars under simple test conditions. However, we
284-
have no data sets that test `gregorian`, so we have a somewhat limited ability to test this
285-
calendar option. Fortunately, there are also no immediate plans to run with `gregorian`.
286-
287-
I have tested that the results (except `regriddedSeaIceConcThick`, which I'm not able to run on my
288-
laptop) of a G240km ACME test case are bit-for-bit identical to those from `develop`.
283+
unit testing has been added for `timekeeping` and `mpas_xarray` that checks both the `gregorian`
284+
and `gregorian_noleap` calendars under simple test conditions. However, we have no data sets
285+
that test `gregorian`, so we have a somewhat limited ability to test this calendar option.
286+
Fortunately, there are also no immediate plans to run with `gregorian`.
289287

290-
I will make sure all tests with config files in the configs/lanl directory produce bit-for-bit
291-
results with the current develop.
288+
I will make sure all tests with config files in the `configs/lanl` and `configs/edison`
289+
directories produce bit-for-bit results with the current `develop`.
292290

293291
<h2> Testing and Validation: The 'Time' coordinate of xarray data sets must support at least years
294292
0001 and 9999, and preferably any conceivable value<br>
@@ -300,5 +298,6 @@ Unit tests have been added to ensure that dates both close to 0001-01-01 and typ
300298
calendar dates (e.g. 2017-01-01) function as expected.
301299

302300
@akturner's MPAS-SeaIce run with real dates (mentioned in
303-
[#81](https://github.com/MPAS-Dev/MPAS-Analysis/issues/81)) will also be analyzed to make sure
304-
we are supporting a range of years starting in 1958.
301+
[#81](https://github.com/MPAS-Dev/MPAS-Analysis/issues/81)) has been successfully
302+
run with the proposed approach. This run started in 1958, and had presented a problem
303+
for MPAS-Analysis with the previous calendar.

0 commit comments

Comments
 (0)