Restrict native grid vertical extent for z-restricted downloads#366
Open
glwagner wants to merge 7 commits into
Open
Restrict native grid vertical extent for z-restricted downloads#366glwagner wants to merge 7 commits into
glwagner wants to merge 7 commits into
Conversation
A `BoundingBox`/`Column` `z = (z_bottom, z_top)` already restricts the CopernicusMarine/GLORYS download. Extend it so the native grid built from the restricted file follows the file's vertical extent rather than the dataset's full-column `Nz`. - GLORYS `region_suffix` appends a `z_suffix` so a z-restricted download caches to a distinct file; `skip_existing` no longer returns the full-column file. Regions without `z` keep their existing filenames. - New `vertical_size` helper: an explicit z-interface vector sets `Nz` to `length(z) - 1`; a tuple/`nothing` keeps the dataset's full-column `Nz`. Wired into all three `construct_native_grid` methods. - Docstring updates for `BoundingBox` `z`. - Tests: `vertical_size` units, depth-bounds mapping, z-restricted grid shrink + field load, and a distributed-vs-serial GLORYS `set\!` check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ative-grid # Conflicts: # test/test_metadata.jl
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| using Oceananigans.DistributedComputations | ||
| using Oceananigans.DistributedComputations: reconstruct_global_grid | ||
|
|
||
| # h5py/hdf5 are required to write the CopernicusMarine subset; add them once on |
Member
There was a problem hiding this comment.
I think this has been fixes in CopernicusMarine v0.1.2. But, given that the new CopernicusMarine does not use python, we probably do not need it
Co-authored-by: Simone Silvestri <silvestri.simone0@gmail.com>
simone-silvestri
approved these changes
Jun 25, 2026
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.
Summary
A
BoundingBox/Columnz = (z_bottom, z_top)already restricts the CopernicusMarine/GLORYS download (via the already-mergeddepth_bounds_kw). This PR extends that so the native grid built from the restricted file follows the file's vertical extent rather than the dataset's full-columnNz.region_suffixappends az_suffixso a z-restricted download caches to a distinct file —skip_existingno longer hands back the full-column file. Regions withoutzkeep their existing filenames (backward compatible).vertical_sizehelper: an explicit z-interface vector setsNztolength(z) - 1; a tuple/nothingkeeps the dataset's full-columnNz. Wired into all threeconstruct_native_gridmethods (::Nothing,BoundingBox,Column).BoundingBoxzkeyword.Tests
vertical_sizeunit tests (vector →length-1, tuple → fullNz)depth_bounds_kwmapping (negative-downwardz→ positive Copernicus depth bounds; empty bbox → unrestricted)Nzmatching the file, and the field loads onto itset!check acrossPartition(4,1),(1,4),(2,2)Notes
Project.tomldependency changes.zkeep prior filenames and fullNz.🤖 Generated with Claude Code