Add FieldTimeSeries round-trip test harness across writers and grids#5654
Add FieldTimeSeries round-trip test harness across writers and grids#5654glwagner wants to merge 2 commits into
Conversation
Parametrized harness that writes output, reconstructs a FieldTimeSeries, and compares grid (type/size/topology) and field values. Covers the four reconstruction-sensitive grid categories that lacked coverage — stretched rectilinear, immersed boundary, stretched lat-lon, and orthogonal spherical shell (tripolar, immersed tripolar, cubed-sphere panel) — across the JLD2, NetCDF, and Zarr writers. JLD2 round-trips all six grids. NetCDF/Zarr gaps (e.g. #5639) surface as plain test failures rather than being hidden. Set ENV["FTS_ROUND_TRIP_WRITERS"] (e.g. "jld2") to run a subset; only the needed writer extension packages are loaded. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@vopikamm this is the test we talked about |
| topology=(Periodic, Periodic, Bounded)) | ||
| immersed_rectilinear = ImmersedBoundaryGrid(underlying_rectilinear, GridFittedBottom((x, y) -> -0.5)) | ||
|
|
||
| stretched_z_deep = [-1000.0, -600.0, -300.0, -100.0, 0.0] |
There was a problem hiding this comment.
Is that all that "stretched" means? Non-equidistant in z? Or am I missing something? That would make almost all configurations I came across "stretched"
| end | ||
| end | ||
|
|
||
| function grids_match(reconstructed, original) |
There was a problem hiding this comment.
Here we test only size and other metadata of the grid. We do not test the coordinate values themselves, shouldn't we? Otherwise the stretching of coordinates will not be detected anywhere.
vopikamm
left a comment
There was a problem hiding this comment.
Very useful tests! My only concern is if the difference between "stretched" or "not stretched" is just the values of the z coord, but we never assess those values, there is no test of the stretched case? I would guess that the grid will still be reconstructed and the tests pass even if they shouldn't
Summary
Adds a parametrized test harness that exercises FieldTimeSeries reconstruction from disk across the cross-product of output writers and grid types. Motivated by #5639 and the observation that round-trip coverage was essentially limited to uniform
RectilinearGrid(the Langmuir-turbulence example); the four reconstruction-sensitive grid categories had noFieldTimeSeriesround-trip test.The harness writes a short simulation, reconstructs via
FieldTimeSeries(path, name), and asserts on:ImmersedBoundaryGrid)NaN)Coverage
Grids (the four categories + OSSG variants):
RectilinearGridRectilinearGrid(GridFittedBottom)LatitudeLongitudeGridTripolarGridTripolarGridConformalCubedSpherePanelGridWriters:
JLD2Writer,NetCDFWriter,ZarrWriter.Status
@test_broken.Set
ENV["FTS_ROUND_TRIP_WRITERS"](e.g."jld2"or"jld2,netcdf") to run a subset; only the needed writer extension packages (Zarr/NCDatasets) are loaded.Draft: NetCDF/Zarr columns are expected to fail until the corresponding reconstruction paths are completed — this PR is the spec.
🤖 Generated with Claude Code