-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time limitation (between years 1678 and 2262) restrictive to climate community #789
Comments
@jhamman and @shoyer, do you know if more general support for times will be provided? I would say this is a potential roadblock inhibiting easy adoption of this library within the climate community. For example, this is creating problems when we setup and analyze climate models (cc @akturner, @douglasjacobsen, @milenaveneziani). There are obvious work arounds, but they are hacks, e.g., I just add 1700 or some arbitrary year within my wrapper to MPAS at https://github.com/pwolfram/mpas_xarray_wrapper. However, this does not appear to be a viable long-term solution. Does anyone have some advice on how to better deal with this problem? |
There are two issues here:
Unfortunately, I don't see easy fixes to either of these, though if I had to guess, adding support for other datetime precisions (perhaps only sub-second resolution) to pandas would be easier than fixing up NumPy's datetime64 itself (which is already pretty hacky). |
Thank you, @pwolfram, for bringing this up. I just wanted to add that this limitation is important for analyzing so-called fixed-conditions climate model experiments, in which the model is run with fixed greenhouse gases conditions for a particular year (say, fixed levels of CO2 concentration representative of levels for the year 1850, for example). In these cases, time is simply measured with respect to start of simulation (year 0, or year 1) and each year is a no-leap year of 365 days. |
Thank you very much @shoyer for your very fast reply. If we fixed the issue in pandas (e.g., your 1) would that be sufficient to resolve the issue or do we also need to enhance |
👍 I hit this problem months back when analyzing CESM runs. It seems silly that the adoption of xarray by the climate modeling community should rest on these highly technical issues. But that seems to be the reality. The challenge is to raise the profile of these issues within the numpy and pandas communities such that they become a high priority. Even better would be dedicated developer time (e.g. from someone at UNIDATA) to implement fixes. |
Well, the good news is that non-standard calendars like 365 are actually a bit easier than the Gregorian calendar, at least if you were starting from scratch. As much as I love pushing fixes upstream, the most sane approach is to probably write a
This might make slightly more sense in a related but distinct project to xarray. NumPy and pandas developers will listen sympathetically, but ultimately nobody is going to work on this unless there is funding or they need it for their own work -- that's just how open source works. Fixing the underlying technology so these problems can be solved the "right" way is on the roadmap, but only in a vague, we'll get to it eventually kind of way. |
Periods can go back much further, depending on the precision you need: In [26]: pd.Period('1000', freq='D')
Out[26]: Period('1000-01-01', 'D') |
@shoyer - are you thinking I actually don't think it would be all that hard to do this. @jswhit's I'd be happy to help pull this together, although, I won't be able to make significant contributions until the summer. Is anyone chomping at the bit to work on something like this? |
Just curious, has anyone tried to open an issue in pandas for this? |
@brews - I think this issue (pandas-dev/pandas#7307) covers the main gist of what we're talking about here. |
Pandas has created a poll on their mailing list about this issue...I encourage everybody to speak up there: https://groups.google.com/forum/#!topic/pydata/kk04maBGw1U (Will blast this to xarray mailing list also) |
Closed by #1252 ? |
The restriction of
is a potential roadblock inhibiting easy adoption of this library in the climate community.
The text was updated successfully, but these errors were encountered: