Skip to content

Headless mode access to plot by means to save #172

@sadielbartholomew

Description

@sadielbartholomew

Out plotting functionality creates an illustrative plot for a given configuration, but as an end result it only opens this in a GUI window via (matplotlib's) plt.show() - which doesn't work in a headless context - notably when on remote servers like JASMIN using SSH or in automated scripts. So in these cases, there's no (non-contrived, e.g. without setting up some sort of GUI window support e.g. via X) way to access the plot. Which would become a major deficiency given CATS v2 is targeting HPC/HTC application.

To get around this problem, I suggest we implement the following:

  • logic to detect if headless i.e. querying os.environ.get("DISPLAY") or similar, in which case save the plot to the current working directory with a default name;
  • an extra config. option --save-plot taking a (path and) filename argument for saving the plot instead of opening it (upon which you do generally get given an option to save from the GUI widgets), as an optional override the user can set.

Happy to take other ideas, though!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions