Skip to content

Resolve "Add plot creator that works nicely with ParamSpaceGroup data"

Utopia Developers requested to merge 31-psp-plot-creator into master

What does this MR do?

This MR adds two new plot creators, based on ExternalPlotCreator, that work with data stored in a ParamSpaceGroup and aim to make plotting data from all universes or from single universes (but looped) more convenient.

MultiversePlotCreator

This interfaces with the ParamSpaceGroup.select method and prepares that data before calling the plot function. The arguments are given via the select key in the plot configuration, which is not passed on.

Plot functions using this creator will need to accept an mv_data argument.

UniversePlotCreator

The aim of this (more intricate) creator is to make plotting of data from multiple universes (but with the same plot function) more convenient. To that end, it parses the given plot configuration and the universes argument and – before plotting starts – adjust the configuration such that an iteration over a parameter space occurs, where each point corresponds to a selection of universes.

The universes argument can be any of the following:

  • 'all': will loop over all universes
  • 'single' or 'first': will only select the first available universe
  • 'random' or 'any': will select a random universe
  • a dict of subspace selectors: will select parameter subspace to loop over. Argument can be anything that paramspace.ParamSpace.activate_subspace accepts.

Plot functions using this creator will need to accept two new keyword-arguments: uni_data and coords.

Can this MR be accepted?

  • Implemented the changes
  • Tests added or adjusted, coverage on the changes and additions is 100%
  • Pipeline passes
  • Changelog entry added
  • Approved by @...

Anything to double-check?

Phew… don't think so.

Related issues

Closes #31 (closed)

Edited by Utopia Developers

Merge request reports