-
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
Extract method _postprocess_dataset()
and make bounds generation optional
#223
Conversation
- Add option `add_bounds` for optionally adding bounds - Update docstrings to reduce redundancy and increase conciseness - Update variable names for clarity - Update reference to "regular" data vars to "non-bounds" data vars - Update optional function arg `data_var` to required arg `key` - Update line spacing and make sure there is a line break with return statements
Codecov Report
@@ Coverage Diff @@
## main #223 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 8 -1
Lines 742 700 -42
=========================================
- Hits 742 700 -42
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update docstrings
This PR extracts the
_postprocess_dataset()
function fromxcdat.open_dataset()
andxcdat.open_mfdataset()
to reduce code duplication.It also adds the optional boolean kwarg
add_bounds
(defaults toFalse
) to both dataset opening functions, since generating missing bounds might not be desired in some cases. If the user ends up needing to generate bounds, they can either callds.bounds.add_missing_bounds()
to generate bounds that are missing for all supported axis (time, lat, lon), ords.bounds.add_bounds("key_of_coords")
for a specific axis.Summary of Changes
add_bounds
for adding bounds to dataset opening functions, defaults toFalse
.data_var
to required argkey
BoundsAccessor
property names for clarityDescription
open_dataset()
andopen_mfdataset()
#220Checklist
If applicable: