-
-
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
DataArray throws error in contains_cftime_datetimes() -> _data vs data (with fix?) #7966
Comments
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! |
Related open issue over at geocat: NCAR/geocat-comp#381 |
Indeed as of #7494 it no longer does. Per the type hint it only accepts
See here for more explanation of public vs. private API in xarray. |
Related issue: #7645 If you want to continue using non-public functions, change xr.core.common.contains_cftime_datetimes(d_arr) to this xr.core.common.contains_cftime_datetimes(d_arr.variable) |
Thanks, I'll give it a look |
What happened?
When attempting to run a GeoCats tutorial, the
<class 'xarray.core.dataarray.DataArray'>
throws the errorAttributeError: 'DataArray' object has no attribute '_data'
Is there a reason that DataArray would not contain _data attribute?
What did you expect to happen?
DataArray appears not to have the attribute
_data
. The class DataArray appears to be expectingdata
but by passing thecontains_cftime_datetimes
function a DataArray, it will attempt to call theDataArray._data
and thrown an error since that class does not have a _data attribute.Does
contains_cftime_datetimes
not accept DataArrays?Working on a separate branch on this function, by replacing
var._data
withvar.data
I no longer encountered any errors and was able to complete as expected (common.py at Line 2013)I have included a minimal example to recreate this issue, which originally arose while using GeoCat in conda
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
The text was updated successfully, but these errors were encountered: