trajectory_setup¶
Classes¶
Functions¶
|
Function to assign all required settings to the dataset. |
|
Function to assign all assigned optional settings to a dataset. |
|
Helper function to create a statecombination coordinate if it is missing, based on the states registered. |
|
Function to initialize an xr.Dataset with appropriate variables and coordinates to acommodate loaded data. |
Module Contents¶
- class RequiredTrajectorySettings¶
-
- input_format: Literal['sharc', 'newtonx', 'ase', 'pyrai2md']¶
- input_type: Literal['static', 'dynamic', 'unknown']¶
- class OptionalTrajectorySettings¶
- assign_required_settings(dataset, settings)¶
Function to assign all required settings to the dataset.
Just a handy tool so all values are assigned because all fields in settings should be assigned upon its creation
- Parameters:
dataset (xr.Dataset) – The dataset to write the required settings into
settings (RequiredTrajectorySettings) – The fully assigned settings object containing all keys and values to be assigned.
- Return type:
None
- assign_optional_settings(dataset, settings)¶
Function to assign all assigned optional settings to a dataset.
Just a handy tool so we can be sure the settings are assigned with the correct keys.
- Parameters:
dataset (xr.Dataset) – The dataset to write the optional settings into
settings (OptionalTrajectorySettings) – The dataclass object that has all optional setting keys with optional values. Only assigned settings (not None) will be inserted.
- Return type:
None
- get_statecomb_coordinate(states)¶
Helper function to create a statecombination coordinate if it is missing, based on the states registered.
- Parameters:
states (xr.DataArray) – The state coordinate
- Returns:
The new coordinate having all non-ordered state combinations
- Return type:
xr.Coordinates
- create_initial_dataset(num_time_steps, num_states, num_atoms, format_name, loading_parameters, **kwargs)¶
Function to initialize an xr.Dataset with appropriate variables and coordinates to acommodate loaded data.
All arguments are used to accurately size the dimensions of the dataset or assign. Also returns the default attributes associated with the variables in the dataset for later assignment of certain values like “time” which is not initialized with values.
- Parameters:
num_time_steps (int) – The number of expected time steps in this trajectory. Set to 0 to not create a “time” dimension.
num_states (int) – The number of states within the datasets.
num_atoms (int) – The number of atoms within the datasets. Set to 0 to remove all observables tied to an “atom” index.
format_name (Literal['sharc', 'newtonx', 'ase', 'pyrai2md'])
loading_parameters (shnitsel.io.helpers.LoadingParameters | None)
- Returns:
An xarray Dataset with appropriately sized DataArrays and coordinates also including default attributes for all variables. Dict: The key-value dict, where the key is the name of standard variables/coordinates in Shnitsel terminology and the value is the dict of default attributes associated with this variable in this format.
- Return type:
xr.Dataset