-
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
Add wrappers for opening datasets and data variables #81
Conversation
Codecov Report
@@ Coverage Diff @@
## main #81 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 5 +1
Lines 85 138 +53
=========================================
+ Hits 85 138 +53
Continue to review full report at Codecov.
|
open_dataset
wrapper to apply common operations initiallydce6966
to
0f5744c
Compare
5697cf7
to
5b303ed
Compare
5b303ed
to
c6ab44d
Compare
- Add dataset.py and variable.py which stores wrappers - Update .gitignore - Update axis.py to bounds.py to explicitly express intent - Update readthedocs.yml - Update setup.py with requirements list - Update package imports in meta.yaml and api.rst - Add `get_bounds_for_all_coords()` method
c6ab44d
to
b076b44
Compare
I just found out an interesting behavior related to the bounds accessor class and its attributes. When you open a DataArray/Dataset with an accessor class and add attributes, then make a copy of it, the attributes don't propagate to the copy (which means you lose them). This sounds like it will cause problems with data integrity as you work with variables, make copies, pass to functions, try to access the bounds, etc. Extending xarray using accessors seems best for computed properties and not persistent object attributes, or if you don't need to make copies of the original variable. Code example:
Alternate SolutionThe alternative solution is to store bounds inside the DataArray coordinates instead of attributes of the bounds accessor class. Pros:
Cons:
Notes:
Related GitHub Issues: |
Description
Checklist
If applicable: