-
Notifications
You must be signed in to change notification settings - Fork 17
Feature/datatree #185
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
Feature/datatree #185
Conversation
…d of having to supply filters
|
Looks like GitHub updated their default macOS runner. "macos-latest" is now Apple silicon and only supports Python >= 3.9. I think I am going to update master to reflect this. |
|
Also, can you make a Feature Request issue for this? |
|
#187 Feature request |
|
@EricEngle-NOAA I made a requirement for the datatree pieces that xarray 2024.10.0 need to be installed to be able to enable the datatree register and the test_datatree_backend. |
|
This is an awesome feature! I had have some knowledge of DataTree but have not used them nor did I think to use it as a mechanism to handle the various types of GRIB2 message that can exist in a file. Really good stuff! I will likely move the level mapping table to inside |
|
Thanks @EricEngle-NOAA. I think it's a really interesting use case of it. I was working on another project where I needed to read and provide campaign forecasts for a field experiment. A better mapping would be fantastic. We may even be able to map some things like |
|
When I approve the pull request, I am going to go merge it into 187-xarray-datatree branch |
|
Another reason to merge into a feature branch is to build out the table mapping. |
524b2bc
into
NOAA-MDL:187-xarray-datatree
* adding a datatree method to be able to open an entire gribfile instead of having to supply filters * Add additional human-readable names to LEVEL_NAME_MAPPING * Add tests for DataTree structure and filtering in GRIB2 files * remove accidental submodule * remove datatree interp test * require xarray >= 2023.4.0 * make datatree optional * Add DataTree support checks and refactor DataTree accessor registration * increase datatree xarray requirement * Add additional level mappings for cloud layers in LEVEL_NAME_MAPPING * Fix syntax error in LEVEL_NAME_MAPPING by adding missing comma
* adding a datatree method to be able to open an entire gribfile instead of having to supply filters * Add additional human-readable names to LEVEL_NAME_MAPPING * Add tests for DataTree structure and filtering in GRIB2 files * remove accidental submodule * remove datatree interp test * require xarray >= 2023.4.0 * make datatree optional * Add DataTree support checks and refactor DataTree accessor registration * increase datatree xarray requirement * Add additional level mappings for cloud layers in LEVEL_NAME_MAPPING * Fix syntax error in LEVEL_NAME_MAPPING by adding missing comma
* Feature/datatree (#185) * adding a datatree method to be able to open an entire gribfile instead of having to supply filters * Add additional human-readable names to LEVEL_NAME_MAPPING * Add tests for DataTree structure and filtering in GRIB2 files * remove accidental submodule * remove datatree interp test * require xarray >= 2023.4.0 * make datatree optional * Add DataTree support checks and refactor DataTree accessor registration * increase datatree xarray requirement * Add additional level mappings for cloud layers in LEVEL_NAME_MAPPING * Fix syntax error in LEVEL_NAME_MAPPING by adding missing comma * Adding a custom level naming table. Adding "table_4_5_grib2io_level_name". This is a table that maps code values from table 4.5 to a custom name. The name is either mapped directly to a CF-conventions standard name or is a custom name for grib2io. These names are used to define the DataTree. * Update for xarray backend Level names now being pulled from new custom grib2io table for GRIB2 table 4.5. * Renaming xarray datatree test. [skip ci] * Update _grib2io.py Add to_section3() method for Grib2GridDef class. * Update tests/test_to_grib2.py Remove dtype attr for leadTime before decode. This is a temporary change. * Update Grib2GridDef and some code clean up. Clean up of Grib2GridDef property returns and ProjParameters class. * Update build_linux.yml to gcc-14. * Update license in pyproject.toml Modify setup.py with test prints to diagnose finding omp.h * Update setup.py * Update setup.py Added find_openmp_include() * Update setup.py * Update setup.py Clean up of setup.py * Clean up setup.py [skip ci] * Update macOS testing to gcc-14. * Update setup.py Make sure full omp include path is returned Minor update to GRIB2 tables. --------- Co-authored-by: Barry Baker <[email protected]> Co-authored-by: Eric Engle <[email protected]>
This PR allows for the ability to open a grib file requiring a lot of filters to access multiple data arrays into a single
xarray.DataTree. This creates a tree'd structure which users can then go in and access without knowing the filters needed beforehand.Enhancements to
DataTreeTest Coverage:tests/test_datatree_backend.py: Added multiple new test cases to validate the structure, optimization, subsetting, and interpolation ofDataTreeobjects created from GRIB2 files. These include tests for basic structure, level organization, PDTN optimizations, perturbation structures, subsetting by levels, and interpolation to new grids.Minor Code Cleanup:
tests/test_xarray_backend.py: Removed an unnecessary blank line in thetest_named_filterfunction for better readability.