apstools icon indicating copy to clipboard operation
apstools copied to clipboard

Disabling plots in lineup plan

Open canismarko opened this issue 2 years ago • 5 comments

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:

  1. Add an argument to the plan that determines whether enable_plots gets called (e.g. def lineup(..., enable_plots=True))
  2. Only call bec.enable_plots() if the bec comes from the ipython shell namespace, allowing me to use bec.disable_plots() before passing the bec as the bec argument to lineup().

The first one seems simpler to me, but happy to submit a PR for either one.

canismarko avatar Feb 20 '23 22:02 canismarko