shnitsel.vis.datasheet#

Submodules#

Classes#

Datasheet

Class to generate overview plots for a collection of trajectories.

Package Contents#

class Datasheet(data, state_selection=None, structure_selection=None, *, name=None, spectra_times=None, col_state=None, col_inter=None)#

Class to generate overview plots for a collection of trajectories.

Multiple individual plots are possible. Available plots include: - per_state_histograms: Histograms of energy, forces and transition dipoles per state - separated_spectra_and_hists: Histograms of transition dipoles and time plots - noodle: Noodle plots of structure over time for each states - structure: Plot of the moleculare structure given either all positions or a smiles map - nacs_histograms: A histogram of the nacs between states as well as energy and force histograms - timeplots: Plot of the active states over time.

Parameters:
data_source: shnitsel.data.tree.node.TreeNode[Any, shnitsel.data.dataset_containers.shared.ShnitselDataset | xarray.Dataset] | shnitsel.data.dataset_containers.shared.ShnitselDataset | xarray.Dataset#
datasheet_pages: dict[str, shnitsel.vis.datasheet.datasheet_page.DatasheetPage]#
name: str | None = None#
_copy_data(old)#

Create a copy of an existing Datasheet instance.

Parameters:

old (Self) – The old instance to copy

calc_all()#

Method to precalculate all relevant properties on all (sub-)DatasheetPages

property pages: Mapping[str, shnitsel.vis.datasheet.datasheet_page.DatasheetPage]#

Retrieve the mapping of individual pages contained in this datasheet.

Returns:

The keys of the pages are the individual paths in a hierarchical structure, whereas the values are the DataSheetPage instances.

Return type:

Mapping[str, DatasheetPage]

plot(include_per_state_hist=False, include_coupling_page=True, include_pca_page=False, include_meta_page=False, borders=False, consistent_lettering=True, single_key=None, path=None, **kwargs)#

Function to plot datasheets for all trajectory groups/datasets in this Datasheet instance.

Will output the multi-page figure to a file at path if provided. Always returns an array of all generated figures to process further.

Parameters:
  • include_per_state_hist (bool, optional) – Flag to include per-state histograms in the plot. Defaults to False.

  • include_coupling_page (bool, optional) – Flag to create a full page with state-coupling plots. Defaults to False.

  • include_pca_page (bool, optional) – Flag to create a PCA analysis page with details on PCA results. Defaults to True.

  • include_meta_page (bool, optional) – Flag to add a page with meta-information about the trajectory data. Defaults to False

  • borders (bool, optional) – A flag whether to draw borders around plots. Defaults to False.

  • consistent_lettering (bool, optional) – Flag to decide, whether same plots should always have the same letters. Defaults to True.

  • single_key (str, optional) – Key to a single entry in this set to plot. Keys are specified as paths in the ShnitselDB structure.

  • path (str | PathLike | None, optional) – Optional path to write a (multi-page) pdf of the resulting datasheets to. Defaults to None.

  • **kwargs – Can provide keyword arguments to be used in the pdf metadata dictionary. Among others: ‘title’, ‘author’, ‘subject’, ‘keywords’.

Returns:

  • dict[str, Figure] – Map of the keys of the individual datasets to the resulting figure containing all of the Datasheet plots. If no key is available e.g. because a single trajectory was provided, the default key will be “root”.

  • Figure – If a single_key is specified, will only return that single figure.

Return type:

dict[str, list[matplotlib.figure.Figure]] | list[matplotlib.figure.Figure]

_test_subfigures(include_per_state_hist=False, borders=False)#

Internal function to test whether subfigure plotting works as intended

Parameters:
  • include_per_state_hist (bool, optional) – Flag to include per-state histograms. Defaults to False.

  • borders (bool, optional) – Whether the figures should have borders. Defaults to False.

plot_per_state_histograms(shape=None)#

Helper method to get the results of the call to plot_per_state_histograms() on each page.

Parameters:

shape (tuple[int, int] | None, optional) – The desired grid shape as (rows,columns), by default None

Returns:

The resulting plots per datasheet page.

Return type:

Sequence[dict[str, Axes]]

plot_timeplots()#

Helper method to get the results of the call to plot_timeplots() on each page.

Returns:

The resulting plots per datasheet page.

Return type:

Sequence[dict[str, Axes]]

plot_separated_spectra_and_hists(current_multiplicity=1)#

Helper method to get the results of the call to plot_per_state_histograms() on each page.

Parameters:

current_multiplicity (int, default = 1) – The target multiplicity for which the spectra and histograms should be plotted, by default None

Returns:

The resulting plots per datasheet page.

Return type:

Sequence[dict[str, Axes]]

plot_separated_spectra_and_hists_groundstate()#

Helper method to get the results of the call to plot_separated_spectra_and_hists_groundstate() on each page.

Returns:

The resulting plots per datasheet page.

Return type:

Sequence[dict[str, Axes]]

plot_nacs_histograms()#

Helper method to get the results of the call to plot_nacs_histograms() on each page.

Returns:

The resulting plots per datasheet page.

Return type:

Sequence[dict[str, Axes]]

plot_noodle()#

Helper method to get the results of the call to plot_noodle() on each page.

Returns:

The resulting plots per datasheet page.

Return type:

Sequence[Axes]

plot_energy_bands()#

Helper method to get the results of the call to plot_energy_bands() on each page.

Returns

Return type:

Sequence[dict[str, matplotlib.axes.Axes]]

plot_structure()#

Helper method to get the results of the call to plot_structure() on each page.

Parameters:

shape (tuple[int, int] | None, optional) – The desired grid shape as (rows,columns), by default None

Returns:

The resulting plots per datasheet page.

Return type:

Sequence[dict[str, Axes]]

plot_pca_structure()#

Helper method to get the results of the call to plot_pca_structure() on each page.

Returns:

The resulting plots per datasheet page.

Return type:

Sequence[dict[str, Axes]]