dynsight.trajectory.OnionSmoothInsight

class dynsight.trajectory.OnionSmoothInsight(labels, state_list, meta=<factory>)[source]

Contains a smooth onion-clustering analysis.

Parameters:
  • labels (NDArray[np.int64])

  • state_list (list[StateUni] | list[StateMulti])

  • meta (dict[str, Any])

labels

The labels assigned by the clustering algorithm.

state_list

List of the onion-clustering Gaussian states.

Type:

list[StateUni] | list[StateMulti]

meta

A dictionary containing the relevant parameters.

Type:

dict[str, Any]

Methods

dump_colored_trj

Save an .xyz file with the clustering labels for each atom.

dump_to_json

Save the OnionSmoothInsight object to JSON and .npy for labels.

load_from_json

Load the OnionSmoothInsight from JSON and associated .npy file.

plot_one_trj

Plot one particle's trajectory colored according to clustering.

plot_output

Plot the overall onion clustering result.

plot_sankey

Plot the Sankey diagram of the onion clustering.

plot_state_populations

Plot each state's population along the trajectory.

Attributes

dump_colored_trj(trj, file_path)[source]

Save an .xyz file with the clustering labels for each atom.

Parameters:
  • trj (Trj)

  • file_path (Path)

Return type:

None

dump_to_json(file_path)[source]

Save the OnionSmoothInsight object to JSON and .npy for labels.

Parameters:

file_path (Path)

Return type:

None

classmethod load_from_json(file_path, mmap_mode=None)[source]

Load the OnionSmoothInsight from JSON and associated .npy file.

Parameters:
  • file_path (Path) – Path to the .json file.

  • mmap_mode (Literal['r', 'r+', 'w+', 'c'] | None) – If given, used as np.load(…, mmap_mode=mmap_mode) for memory mapping.

Raises:

ValueError – if required keys are missing.

Return type:

OnionSmoothInsight

plot_one_trj(file_path, data_insight, particle_id)[source]

Plot one particle’s trajectory colored according to clustering.

Parameters:
  • file_path (Path)

  • data_insight (Insight)

  • particle_id (int)

Return type:

None

plot_output(file_path, data_insight)[source]

Plot the overall onion clustering result.

Parameters:
  • file_path (Path)

  • data_insight (Insight)

Return type:

None

plot_sankey(file_path, frame_list)[source]

Plot the Sankey diagram of the onion clustering.

Parameters:
  • file_path (Path)

  • frame_list (list[int])

Return type:

None

plot_state_populations(file_path)[source]

Plot each state’s population along the trajectory.

Parameters:

file_path (Path)

Return type:

None