Repository navigation
fix: resolve gathered bscan plotting filename collision - #876
Conversation
|
Thanks—the filename correction looks right. The regression test currently calls the plotting function with trace_group="gathered" explicitly, so it does not exercise the changed -gather CLI path and also passes on the unpatched code. Could you add a CLI-level regression test using an output file with at least two receivers?
|
|
Thanks for the review and the excellent point about exercising the CLI path directly. I've updated The test now uses a synthetic output file with two receivers, generates the normal plots, records the I verified locally that this test reliably fails on the unpatched code and passes cleanly with the |
|
Thanks—the revised test now exercises the actual CLI path and catches the original regression. I independently confirmed that it fails before the fix and passes afterwards, with the individual receiver plot preserved. All checks are green. This is ready to merge. |
Bug Report: B-scan Gather Overwrites Highest Receiver Plot
Description
When running
plot_Bscan.pywith the-gatherflag, the script collects traces across all receivers into a single gathered matrix. However, it passesnrx(the highest receiver index) as therxnumbertompl_plot().By default,
mpl_plot()names its saved output files using a suffix based onrxnumber, i.e.,_rx{rxnumber}.png. For a gathered B-scan, this causes the output file to be incorrectly named as..._rx{nrx}.png. If a user also plots the individual receivers separately (either before or after the gather operation without clearing), the gathered plot will incorrectly overwrite the B-scan plot corresponding to the highest numbered receiver.Fix
In
plot_Bscan.pywhere-gatherinvokesmpl_plot(), explicit naming context is provided by passingtrace_group="gathered". This overrides therxnumberderived trace ID insidempl_plot(), generating output files named cleanly with a_gathered.pngsuffix, thus resolving the file collision. The unusednrxargument has been replaced with1.Tests
A regression test (
test_plot_bscan_gather_filename) has been added totests/toolboxes/test_plotting_outputs.pyvalidating that gathered output produces a_gathered.pngoutput file successfully without raising an exception.