feat: save start and end date of files - #190
Merged
Merged
Conversation
refactor: output rasters using structured netCDF4 function from `geoid-toolkit` fix: include additional attributes to output files for CF compliance refactor: spherical harmonic errors using euler's formula and `np.einsum`
There was a problem hiding this comment.
Pull request overview
This PR updates GRACE/GRACE-FO time metadata handling and output-file metadata, while also refactoring several spherical-harmonic-to-spatial computations and modernizing test formatting.
Changes:
- Add start/end date parsing as
datetime/numpy.datetime64metadata and propagate temporal coverage metadata into output products. - Refactor raster/grid output writing (notably NetCDF4) to use a structured writer and align dimensions/attributes for improved CF-style compliance.
- Refactor some spherical-harmonic error/spatial summations using
np.einsumand Euler-formula-based expressions; update/clean tests accordingly.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_units.py | Formatting/style updates for unit-factor tests. |
| test/test_time.py | Formatting/style updates for time conversion tests. |
| test/test_sea_level.py | Formatting/style updates for sea-level solver tests. |
| test/test_point_masses.py | Formatting/style updates for point-mass tests. |
| test/test_masks.py | Formatting/style updates for mask I/O tests. |
| test/test_love_numbers.py | Formatting/style updates for love-number reader tests. |
| test/test_legendre.py | Formatting/style updates for Legendre polynomial tests. |
| test/test_harmonics.py | Formatting/style updates for harmonic conversion/object tests. |
| test/test_gia.py | Improve robustness of GIA download fixture (xfail on network errors) + formatting. |
| test/test_download_and_read.py | Improve robustness of download tests (handle additional connection/login failures) + formatting. |
| test/conftest.py | Style/quoting updates for pytest CLI options/fixtures. |
| gravity_toolkit/time.py | Add parse() helper and return datetime objects from file parsers; add astype option to calendar_days; internal datetime import cleanup. |
| gravity_toolkit/scripts/scale_grace_maps.py | Add richer output attributes (incl. temporal/geospatial coverage) and refactor harmonic-error calculations with einsum/Euler approach. |
| gravity_toolkit/scripts/monte_carlo_degree_one.py | Comment clarifications aligned with new einsum-based summation approach. |
| gravity_toolkit/scripts/grace_spatial_maps.py | Add temporal/geospatial coverage attributes and minor refactors around output naming. |
| gravity_toolkit/scripts/grace_spatial_error.py | Add temporal/geospatial coverage attributes; refactor error-map computation and output object naming. |
| gravity_toolkit/scripts/grace_raster_grids.py | Switch to structured NetCDF4 output via geoid_toolkit; reorder output dimensions; add CF-style attributes. |
| gravity_toolkit/scripts/calc_degree_one.py | Comment clarifications aligned with new einsum-based summation approach. |
| gravity_toolkit/read_GRACE_harmonics.py | Use Python datetime for start/end date calculations; rename output dict variable for clarity; improve MMAX default handling. |
| gravity_toolkit/read_gfc_harmonics.py | Use Python datetime for start/end date calculations; rename output dictionary to gfc for consistency. |
| gravity_toolkit/grace_input_months.py | Store per-file start/end dates alongside monthly harmonics for later propagation into outputs. |
| gravity_toolkit/grace_date.py | Store start/end dates as numpy.datetime64 arrays when indexing GRACE files by month. |
| doc/source/notebooks/GRACE-Spatial-Error.ipynb | Update notebook computations to match new einsum/Euler-based approach and related API usage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor: output rasters using structured netCDF4 function from
geoid-toolkitfix: include additional attributes to output files for CF compliance
refactor: spherical harmonic errors using euler's formula and
np.einsum