-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dataset global attributes dropped when performing operations against numpy data type #3490
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
Labels
topic-metadata
Relating to the handling of metadata (i.e. attrs and encoding)
Comments
Confirmed as a bug. Not sure exactly what's going on, it may be on the numpy side. NB this does work (swapping order): In [4]: dset * np.float64(1.0)
Out[4]:
<xarray.Dataset>
Dimensions: (space: 3, time: 4)
Coordinates:
* time (time) datetime64[ns] 2000-01-01 2000-01-02 2000-01-03 2000-01-04
* space (space) <U2 'IA' 'IL' 'IN'
Data variables:
test (time, space) float64 0.3565 0.09687 0.4536 ... 0.9714 0.6803
Attributes:
attr1: val1
attr2: val2 |
Perhaps reflected operators (i.e., |
dcherian
added a commit
to dcherian/xarray
that referenced
this issue
Jul 2, 2020
Closes pydata#3490 Closes pydata#4065 Closes pydata#3433 Closes pydata#3595
3 tasks
dcherian
added a commit
to dcherian/xarray
that referenced
this issue
Aug 15, 2020
Closes pydata#3490 Closes pydata#4065 Closes pydata#3433 Closes pydata#3595
dcherian
added a commit
that referenced
this issue
Oct 14, 2020
* Propagate attrs with unary, binary functions Closes #3490 Closes #4065 Closes #3433 Closes #3595 * Un xfail test * bugfix * Some progress. Still need keep_attrs in DataArray._unary_op * Fix dataset attrs * whats-new * small fix * Fix imag, real * fix variable tests * fix multiple return variables. * review comments * Update doc/whats-new.rst * Propagate attrs with DataArray unary ops * More tests * Small cleanup * Review comments. * Fix duplication Co-authored-by: Maximilian Roos <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Operations against numpy data types seem cause global attributes in dataset to be dropped, example below. I also noticed in a real dataset with multiple dimensions that the order of
dset.coords
was swapped.The text was updated successfully, but these errors were encountered: