Add a synthetic dataset for local testing - #4
Open
lispandfound wants to merge 1 commit into
Open
Conversation
lispandfound
added this pull request to stack #6
September 10, 2026 06:56
Benchmark for 5a74360Click to view benchmark
|
Running `nzcvm generate` end to end has needed the real NZCVM data root: a DEM, a Vs30 raster, a coastline, a tomography model and a directory of basin meshes. That makes local iteration awkward and keeps the whole generate path out of the test suite. `nzcvm/synthetic.py` defines a small analytic world over a 48 x 44 km patch of coast: elevation falls west to east and crosses sea level three quarters of the way across, Vs30 tracks elevation, two paraboloid basins sit inland, and a tomography block fills the rest. Every field is closed form, so the data regenerates identically anywhere and a test can work out the expected answer by hand. `nzcvm synthetic` serialises those fields in the formats the production readers already accept, so the synthetic files flow through the same converters and layers as the real ones — surfaces go out as modeller-style HDF5 for `nzcvm surface convert`, the tomography block as an EP2020 CSV for `nzcvm tomography convert`, and each basin as an outline plus a basement surface for `nzcvm basin main`. `just synthetic` chains the lot into a data root under `synthetic/`, which `examples/synthetic.toml` then generates a velocity model from. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lispandfound
force-pushed
the
synthetic-data
branch
from
September 10, 2026 07:04
d847673 to
d0f8cb1
Compare
Benchmark for ca8b094Click to view benchmark
|
lispandfound
removed this pull request from stack #6
September 10, 2026 10:39
lispandfound
added this pull request to stack #9
September 10, 2026 10:39
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.
Running
nzcvm generateend to end has needed the real NZCVM data root:a DEM, a Vs30 raster, a coastline, a tomography model and a directory of
basin meshes. That makes local iteration awkward and keeps the whole
generate path out of the test suite.
nzcvm/synthetic.pydefines a small analytic world over a 48 x 44 km patchof coast: elevation falls west to east and crosses sea level three quarters
of the way across, Vs30 tracks elevation, two paraboloid basins sit inland,
and a tomography block fills the rest. Every field is closed form, so the
data regenerates identically anywhere and a test can work out the expected
answer by hand.
nzcvm syntheticserialises those fields in the formats the productionreaders already accept, so the synthetic files flow through the same
converters and layers as the real ones — surfaces go out as modeller-style
HDF5 for
nzcvm surface convert, the tomography block as an EP2020 CSV fornzcvm tomography convert, and each basin as an outline plus a basementsurface for
nzcvm basin main.just syntheticchains the lot into a data root undersynthetic/, whichexamples/synthetic.tomlthen generates a velocity model from.Testing
tests/test_synthetic.pyasserts the analytic properties the rest of thesuite leans on (the shoreline is where elevation crosses zero, a basin closes
to zero thickness on its own outline) and reads each written file back through
the matching production reader. Building the basin meshes goes through gmsh
and is left to
just, which is too slow for a unit test.🤖 Generated with Claude Code
Stack created with GitHub Stacks CLI • Give Feedback 💬