DataArray accessor bounds attributes don't persist for all xarray functions that return new DataArrays #99
Labels
type: bug
Inconsistencies or issues which will cause an issue or problem for users or implementors.
What are the steps to reproduce this issue?
xcdat.dataset.open_dataset()
xcdat.variable.open_variable()
(e.g., "ts")ts.bounds.bounds
) -- existsts.bounds.bounds
) -- does not exist anymoreWhat happens? Any logs, error output, etc?
Accessor attributes that are set will get dropped by any xarray DataArray methods that return new objects. Many of the xarray methods are not in-place operations, but instead return new objects. This will be a major problem with data integrity as users manipulate variables (bounds will be dropped).
What were you expecting to happen?
I would hope that the attributes would remain cached, but it is not persistent.
Accessor classes are great for extending Datasets and DataArrays ONLY IF the class methods and attributes are not dependent on other objects. For example, computed properties using the object's existing metadata.
Any other comments?
Attempted Fixes
bnds
/bounds
dimension, which changes the shape of the original data (shared dims)Proposed Solutions
Work on the Dataset level
Pros:
Cons:
ds.ts
vs. justts
) --The text was updated successfully, but these errors were encountered: