-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Bug]: OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 2262-05-01 00:00:00 #282
Comments
Addendum that this has apparently been addressed in xarray (but not for non-CF time, which we are supporting in this case). |
* initial solution for #278 add unit test add comments for test, cleanup extraneous code initial work on #282 Bugfix/278 cannot generate bounds (#281) * initial solution for #278 * add unit test * add comments for test, cleanup extraneous code * PR review refactor - Add `types-python-dateutil` to `mypy` dependencies - Update `ref_date` var to `ref_dt_obj` to avoid mypy error `error: Unsupported operand types for + ("str" and "relativedelta")` - Use dictionary unpacking for units variable - Use `datetime.strptime` instead of `pd.datetime()` which runs into the `pd.Timestamp` limitation - Add logger.warning when non-CF compliant time coords cannot be decoded * Consider calendar type when decoding non-Cf time - Fix tests * Update xcdat/dataset.py Co-authored-by: pochedls <[email protected]> * Update xcdat/dataset.py Co-authored-by: pochedls <[email protected]> * Fix datetime reference * return more specific cftime datetime types * removing extraneous calendar specification * Refactor using xarray methods - Move try and except statements into `decode_non_cf_time()` - Extract function `_get_cftime_coords()` to encapsulate related logic from `decode_non_cf_time()` * Update docstrings and silence logger warnings in tests * Fix Timestamp limitation from dtype - Update logger warning * Add space in logger warning Co-authored-by: tomvothecoder <[email protected]>
@pochedls @tomvothecoder was this to be fixed in OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 2315-07-01 00:00:00 The offending file ...
float time(time) ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:units = "months since 1955-01-01 00:00:00" ;
time:axis = "T" ;
time:climatology = "climatology_bounds" ;
...
In [8]: xc.__version__
Out[8]: '0.3.0' Is |
@durack1 This is fixed in #283, which is merged on the latest We are addressing a few more bugs so |
What happened?
In opening a dataset with time units months since 1800-01-01 I am getting the following error:
OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 2262-05-01 00:00:00
.What did you expect to happen?
Ideally, xcdat could handle this situation and open the dataset.
Minimal Complete Verifiable Example
Relevant log output
Anything else we need to know?
This seems to be related to a known limitation of pandas. Maybe using
errors="coerce"
could help?Environment
main branch
The text was updated successfully, but these errors were encountered: