Check the velocity model matches the domain before writing e3d.par - #138
Draft
lispandfound wants to merge 1 commit into
Draft
Check the velocity model matches the domain before writing e3d.par#138lispandfound wants to merge 1 commit into
lispandfound wants to merge 1 commit into
Conversation
lispandfound
force-pushed
the
nz_check
branch
from
September 2, 2026 02:23
ad57ae5 to
f88e058
Compare
lispandfound
force-pushed
the
nz_check
branch
from
September 2, 2026 02:52
f88e058 to
c2756c5
Compare
The downstream half of #131. That change made `create-e3d-par` write `nz + 1`, because `velocity_modelling` generates one more layer than the domain implies: EMOD3D shifts the model down a gridpoint for the free surface and so never reads the last layer (`genmodel.c`). This adds the check that the two halves actually agree. A velocity model whose grid does not match the domain in `e3d.par` does not fail loudly. EMOD3D reads whatever is there and runs on a silently misaligned model. The sizes are fully determined by nx, ny and nz, so compare the three binaries against what the domain implies before templating the parameter file. `padded_nz` is now the single definition of that padded count, used both for the `e3d.par` value and for the check. They must not compute it separately: a check that drifts from the value it is checking is worse than no check at all. A size mismatch is an error. A missing or unreadable file is not: `create-e3d-par` is routinely run in a container where the velocity model paths are only being templated and nothing is on disk yet, so raising there would break workflows that are behaving correctly. That is handled per file rather than around the loop, so an absent first file does not stop the remaining two from being checked -- otherwise a genuinely mis-sized model can hide behind a missing one. Bumps the `velocity-modelling` floor to 2026.8.1, the release that generates the padding row. #131 made the workflow depend on that behaviour without raising the floor; the lockfile happened to resolve high enough, but `pip install workflow` -- which is what the container does -- reads the floor, not the lock. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lispandfound
force-pushed
the
nz_check
branch
from
September 4, 2026 01:44
c2756c5 to
4062120
Compare
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.
The downstream half of #131. That change made
create-e3d-parwritenz + 1, becausevelocity_modellinggenerates one more layer than thedomain implies: EMOD3D shifts the model down a gridpoint for the free
surface and so never reads the last layer (
genmodel.c). This adds thecheck that the two halves actually agree.
A velocity model whose grid does not match the domain in
e3d.pardoesnot fail loudly. EMOD3D reads whatever is there and runs on a silently
misaligned model. The sizes are fully determined by nx, ny and nz, so
compare the three binaries against what the domain implies before
templating the parameter file.
padded_nzis now the single definition of that padded count, used bothfor the
e3d.parvalue and for the check. They must not compute itseparately: a check that drifts from the value it is checking is worse
than no check at all.
A size mismatch is an error. A missing or unreadable file is not:
create-e3d-paris routinely run in a container where the velocitymodel paths are only being templated and nothing is on disk yet, so
raising there would break workflows that are behaving correctly. That is
handled per file rather than around the loop, so an absent first file
does not stop the remaining two from being checked -- otherwise a
genuinely mis-sized model can hide behind a missing one.
Bumps the
velocity-modellingfloor to 2026.8.1, the release thatgenerates the padding row. #131 made the workflow depend on that
behaviour without raising the floor; the lockfile happened to resolve
high enough, but
pip install workflow-- which is what the containerdoes -- reads the floor, not the lock.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Stack created with GitHub Stacks CLI • Give Feedback 💬