apstools
apstools copied to clipboard
Disabling plots in lineup plan
The lineup plan (apstools.plans.alignment.lineup
) uses a best effort callback to capture results, either through the bec argument or from the ipython shell namespace. Either way, it calls bec.enable_plots()
. This is a sensible default, but caused problems for me in using this plan in a CI environment.
I could see two remedies:
- Add an argument to the plan that determines whether enable_plots gets called (e.g.
def lineup(..., enable_plots=True)
) - Only call
bec.enable_plots()
if the bec comes from the ipython shell namespace, allowing me to usebec.disable_plots()
before passing the bec as the bec argument tolineup()
.
The first one seems simpler to me, but happy to submit a PR for either one.