pyfrag_plotter.plot package#

Submodules#

pyfrag_plotter.plot.plot_details module#

pyfrag_plotter.plot.plot_details.replace_overlapping_keys(func: Callable) Callable[source]#

A decorator that replaces overlapping keys between kwargs and function arguments with top-level input.

This decorator is used to ensure that the correct input is used for a function when both positional arguments and keyword arguments are used. It replaces overlapping keys between kwargs and function arguments with top-level input.

Parameters:

func (Callable) – The function to decorate.

Returns:

The decorated function.

Return type:

Callable

pyfrag_plotter.plot.plot_details.set_axes_details(*args, **kwargs)[source]#
pyfrag_plotter.plot.plot_details.set_figure_details(*args, **kwargs)[source]#

pyfrag_plotter.plot.plotter module#

class pyfrag_plotter.plot.plotter.PlotInfo(irc_coord: str, irc_coord_label: str, colours: List[str] = NOTHING, line_styles: List[str] = NOTHING, peak_type: str | None = NOTHING)[source]#

Bases: object

Class to hold information about the plot to be generated.

irc_coord#

The IRC coordinate to plot on the x-axis.

Type:

str

irc_coord_label#

The label for the x-axis.

Type:

str

colours#

The list of colours to use for the plot.

Type:

List[str]

line_styles#

The list of line styles to use for the plot.

Type:

List[str]

peak_type#

The type of peak to plot, if any.

Type:

Optional[str]

colours: List[str]#
irc_coord: str#
irc_coord_label: str#
line_styles: List[str]#
peak_type: str | None#
class pyfrag_plotter.plot.plotter.Plotter(name: str, plot_dir: str, pyfrag_objects: Sequence[PyFragResultsObject], irc_coord: Sequence[str])[source]#

Bases: object

This class provides methods for plotting the results of the PyFrag calculations. It supports plotting of activation strain model terms, energy decomposition terms, and extra strain terms. The plots are saved to a specified directory.

Additionally, the “standard_plot_routine” method can be used to plot any key (or a combination of) in the PyFragResultsObject and the user may create specicifed functions using this method.

name#

The name of the plotter object.

Type:

str

objects#

A list of PyFragResultsObject objects that contain the data to be plotted.

Type:

Sequence[PyFragResultsObject]

path#

The directory to save the plots to.

Type:

str

plot_info#

An instance of the PlotInfo class that contains information about the plot, such as the line styles and colors.

Type:

PlotInfo

Note: The plotter object can be used with a “with” statement to ensure that the plot directory is removed if it’s empty.

plot_arbitrary_keys(**kwargs)[source]#
plot_asm(**kwargs)[source]#
plot_eda(**kwargs)[source]#
plot_extra_strain(**kwargs)[source]#
plot_population(**kwargs)[source]#
standard_plot_routine(keys: Sequence[str], ax: Axes | None = None, markers: Sequence[str] | None = None)[source]#

The standard plot routine for the EDA, ASM and extra strain plots.

This method plots the specified keys for each PyFragResultsObject in the plotter. It supports plotting of multiple keys on the same axes, and allows for customization of the line styles and markers.

Parameters:
  • keys (Sequence[str]) – The keys to plot. These should match the keys in the corresponding dictionary type (asm, eda or extra_strain).

  • ax (Optional[plt.Axes], optional) – The axes to plot on. If None, the current axes is used. Defaults to None.

  • markers (Optional[Sequence[str]], optional) – The markers to use for the lines. If None, no markers are used. Defaults to None.

pyfrag_plotter.plot.plotter.plot_logger(log_level=20)[source]#

Module contents#