mcgibbon / sympl

A toolkit for building planetary/Earth system models in Python
http://sympl.readthedocs.io
Other
50 stars 14 forks source link

Added alterative calendar support through netcdftime #21

Closed mcgibbon closed 6 years ago

mcgibbon commented 6 years ago

It seems that netcdftime has the support we need for alternative calendars. I would just tell users to use its objects, but it feels like it's missing a unified interface for creating objects with different calendars (netcdftime.datetime is just netcdftime.DatetimeProlepticGregorian), so I made one. It uses the standard Python datetime for the proleptic Gregorian calendar, and attempts to use netcdftime for other calendars. If netcdftime is not installed, it complains to the user. I also updated the documentation with all of this info. I only included basic tests for the datetimes, since these are extensively tested in netcdftime.

codecov-io commented 6 years ago

Codecov Report

Merging #21 into master will increase coverage by 0.19%. The diff coverage is 85.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
+ Coverage   74.94%   75.13%   +0.19%     
==========================================
  Files          14       15       +1     
  Lines        1257     1283      +26     
==========================================
+ Hits          942      964      +22     
- Misses        315      319       +4
Impacted Files Coverage Δ
sympl/__init__.py 100% <100%> (ø) :arrow_up:
sympl/_core/time.py 84% <84%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d14a696...0f05e8d. Read the comment docs.