Repository navigation
Match only the named series when exporting A-scan files - #953
Merged
agianno merged 2 commits intoNov 12, 2026
Merged
Conversation
discover_files globbed basefilename + "*.h5", so any HDF5 file whose name started with the base name was exported as a trace. With the shipped cylinder_Bscan_2D and cylinder_Bscan_2D_study examples run in the same folder, exporting cylinder_Bscan_2D to SEG-Y, SEG-2 or DT1 silently added the study traces. The base name was also used as a glob pattern, so a path containing [ or ] found no files. Escape the base name and accept only stems that are the base name followed by an optional run number.
rehanxt5
pushed a commit
to rehanxt5/gprMax
that referenced
this pull request
Nov 10, 2026
…mponents test_rotated_virtual_fields[True-double-+-1-2-TE] failed twice on hosted CI (PRs gprMax#953 and gprMax#955, neither of which touches the solver) with a "relative error" of 2e-3 while the actual difference between the reference and virtual runs was ~5e-13 on a field of amplitude 216. The comparison scaled each trace component by its own peak with a floor of 1e-12 of the global peak, so the three identically-zero out-of-plane components of a reduced 2D run were compared against an absolute tolerance of ~4e-18, far below double round-off. Any residual there, however small, failed the test. The divergence itself only appears on the hosted runners and could not be reproduced locally with MKL or OpenBLAS numpy, any thread count, repeated in-process runs or CPU contention. Add normalized_trace_error() to the 2D validation module: components that carry signal are still scaled by their own peak, while components whose reference peak is below 1e-6 of the global peak are measured against the global peak. Use it in the three tests that shared the old floor, and hold the inactive grid components of the reduced run to the same round-off bound instead of exact zero. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Member
|
The implementation looks correct and fixes a genuine file-series mixing problem. Our independent discovery, ordering, CLI and simulation-export checks found no regression. Before merging, please update from current master to include #956’s SIBC comparison-test correction and obtain green CI on the updated candidate. The existing failed CPU test does not call the changed exporter code. No exporter or waveport-physics change is requested. |
Contributor
Author
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.
Fixes #952
The SEG-Y, SEG-2 and DT1 exporters find their input series with
discover_files, which globbedbasefilename + "*.h5". Any HDF5 file starting with the base name was exported as a trace, so running the two shipped examplescylinder_Bscan_2D.inandcylinder_Bscan_2D_study.ininexamples/gpr/basic/and then exportingcylinder_Bscan_2Dsilently appended all the study traces. The base name was also used as a glob pattern, so a folder likerun[1]found nothing.Changes:
discover_filesnow escapes the base name for glob and keeps only files whose stem is the base name followed by an optional run number. The old_mergedexclusion is covered by this.tests/toolboxes/test_outputfiles_segy.pywith a second series sharing the prefix, run once in a plain folder and once in a folder with brackets.Testing:
assert 5 == 3for the plain folder, no files found forsurvey[1]) and passes with the fix.pytest tests/toolboxes/test_outputfiles_segy.py tests/toolboxes/test_outputfiles_seg2.py tests/toolboxes/test_outputfiles_dt1.py: 37 passed.outputfiles_merge.pyhas the sameglob(basefilename + "*.h5")pattern in its__main__block. I left it alone here to keep this small, but I can follow up if you want the same rule there.