vdmtools.plotting.VdMPlotter

class vdmtools.plotting.VdMPlotter(strategy: IStrategyPlugin)

Skeleton class for all VdM plotting strategies.

Soul driver of the VdM plotting framework. It delegates all the plotting logic to the provided IStrategyPlugin instance. This class is simply responsible for providing the loop strucure as specified by the the strategy and calling the strategy hooks at the appropriate times.

Important

From the prespective of this class, the data used for plotting as well as the context object are completely opaque. No assumptions are to be made about the data by this class. As a results, the implementors of the IStrategyPlugin child classes are souly responsible for correctly using the data and context objects.

Note

The only (reasonable) assumption that can be made about the context object is that it implements the MutableMapping interface. This is a fancy way of saying that the context object must behave like a dictionary (even if it is not a pure python dictionary).

Important

The communication between this class and the strategy is done through the context object. As of now, the only context that is set by this class is the current value of all the active iterators. The keys for these values are of the form current_<iterator_id> where iterator_id is the id of the iterator as specified by the strategy. For example, if the strategy specifies an iterator with id fits, then the current value of this iterator will be set in the context under the key current_fit.

Parameters:

strategy (IStrategyPlugin) – The strategy that will be used to do the actual plotting. This object is responsible for providing the loop structure as well as the hook scheme that will be used by this class.

Methods

run(data[, context])

Run the plotting strategy.

run(data, context: Optional[MutableMapping[str, Any]] = None)

Run the plotting strategy.

Parameters:
  • data (Any) – The data that will be used for plotting. This object is completely opaque to this class. It is up to the strategy to decide how to use this data.

  • context (MutableMapping, optional) – The context that will be used for plotting. This object is completely opaque to this class apart from the fact that it must implement the MutableMapping interface. It is also up to the strategy to decide how to use this context.