Generated scripts default to plot_over=True. In this case, if there is a current active figure with Bragg peaks, it will try to reset them though they will no longer exist as the figure will have been wiped previously in the script. This PR sets plot_over=False on the first line plotted, and plot_over=True on subsequent lines.
When plotting a cut with plot_over=False, the workspace name cached on the CutPlot was not updated. This filtered through to any script generated from the plot. This has been fixed, though the script issue has also been resolved by...
When adding overplot features to a cut plot, generated scripts now use the workspace variable rather than the workspace name. Due to the appending of _(1) etc, on duplicate cuts, the name of a workspace cannot be assumed based upon the workspace it is taken from.
Test coverage has been added for any new functionality.
I have updated .format to f strings in the relevant files.
To test:
Follow instructions left by @mducle in the linked issue, see all resolved.
Description of work:
This PR fixes various scripting issues:
plot_over=True
. In this case, if there is a current active figure with Bragg peaks, it will try to reset them though they will no longer exist as the figure will have been wiped previously in the script. This PR setsplot_over=False
on the first line plotted, andplot_over=True
on subsequent lines.plot_over=False
, the workspace name cached on theCutPlot
was not updated. This filtered through to any script generated from the plot. This has been fixed, though the script issue has also been resolved by..._(1)
etc, on duplicate cuts, the name of a workspace cannot be assumed based upon the workspace it is taken from.Test coverage has been added for any new functionality.
I have updated
.format
to f strings in the relevant files.To test:
Follow instructions left by @mducle in the linked issue, see all resolved.
Fixes issues seen in #913.