Repository navigation
Match only the named series when merging output files - #970
Merged
Merged
Conversation
The outputfiles_merge command line globbed basefilename + "*.h5", so any HDF5 file whose name started with the base name was merged as a trace. Merging cylinder_Bscan_2D next to a cylinder_Bscan_2D_wet run silently produced a B-scan with the extra traces, and --remove-files then deleted the other series too. Next to the shipped cylinder_Bscan_2D_study outputs the documented command failed with "Receiver identity StudyID differs between files". The base name was also used as a glob pattern, so a path containing [ or ] found no files. Use discover_files, which the SEG-Y, SEG-2 and DT1 exporters already use, so only the base name followed by an optional run number is merged.
Member
|
Thanks—this is a focused correction that reuses the existing series-discovery helper. Our tests confirmed that unrelated study files are neither merged nor deleted, including paths containing literal brackets. Real 3D, TM and two-cell TE scans preserved all merged field samples exactly. The merge implementation and solver physics are unchanged. Looks suitable to merge. |
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 #969
Follow-up to #953. The
outputfiles_mergecommand line still found its inputs withglob(basefilename + "*.h5"), so any HDF5 file starting with the base name was merged as a trace. Next to another plain run such ascylinder_Bscan_2D_wet, mergingcylinder_Bscan_2Dsilently added the extra traces and--remove-filesdeleted that other series too. Next to the shippedcylinder_Bscan_2D_studyoutputs the documented merge command failed with "Receiver identity StudyID differs between files". A base path containing[or]found nothing.Changes:
discover_filesfromoutputfiles_trace.py, the same rule the SEG-Y, SEG-2 and DT1 exporters use since Match only the named series when exporting A-scan files #953: the base name is escaped and only stems made of the base name plus an optional run number are accepted. The old_mergedexclusion and natural sort are covered by it, and the-odestination is still skipped.merge_filesitself is unchanged.tests/toolboxes/test_outputfiles_merge.pywith a second series sharing the prefix, run with--remove-filesin a plain folder and in a folder with brackets.Testing:
assert (3, 5) == (3, 3)for the plain folder, exit status 2 forsurvey[1]) and passes with the fix.pytest tests/toolboxes/test_outputfiles_merge.py tests/toolboxes/test_outputfiles_segy.py tests/toolboxes/test_outputfiles_seg2.py tests/toolboxes/test_outputfiles_dt1.py tests/toolboxes/test_output_path_safety.py tests/toolboxes/test_plotting_outputs.py tests/toolboxes/test_receiver_identity.py: 117 passed, 1 skipped (reframe not installed).cylinder_Bscan_2D -n 3plus a 2-tracecylinder_Bscan_2D_wetrun now merges 3 traces and leaves the wet files in place. With both shipped examples run in one folder, mergingcylinder_Bscan_2Dandcylinder_Bscan_2D_studyeach gives 60 traces, and abr[1]folder works.