trajectory_verification

Attributes

_required_shnitsel_variables

_optional_shnitsel_variables

_required_shnitsel_attributes

_optional_shnitsel_attributes

Functions

check_shnitsel_trajectory_data(trajectory[, report])

Function to check whether all required and only denoted optional variables and meta information is available on a shnitsel-loaded trajectory.

_true_on_all_leaves(root)

verify_trajectory_format(obj[, asserted_properties])

is_permitted_traj_result(obj)

has_required_properties(traj[, asserted_properties])

Module Contents

_required_shnitsel_variables = ['energy', 'time']
_optional_shnitsel_variables = ['atXYZ', 'nacs', 'dip_perm', 'dip_trans', 'forces', 'socs', 'state_names', 'state_types',...
_required_shnitsel_attributes = ['input_format', 'input_format_version', 'input_type', 'completed', 'max_ts', 'delta_t',...
_optional_shnitsel_attributes = ['has_forces', 'DataTree_Level', 'trajectory_input_path', 'trajid', '__original_dataset',...
check_shnitsel_trajectory_data(trajectory, report=False)

Function to check whether all required and only denoted optional variables and meta information is available on a shnitsel-loaded trajectory.

Parameters:
  • trajectory (Trajectory | xr.Dataset) – The trajectory to check for the presence of variables and settings

  • report (bool, optional) – Whether to raise an error if discrepancies were found. Defaults to False.

Raises:

ValueError – If missing variables or attributes or unexpected variables or attributes are encountered in the provided trajectory and report=True is set.

Returns:

The sets of missing required variables, present unexpected variables, missing required attributes and present unexpected attributes. None: No discrepancies found.

Return type:

Tuple[Set[str], Set[str], Set[str], Set[str]]

_true_on_all_leaves(root)
Parameters:

root (dict | bool)

Return type:

bool

verify_trajectory_format(obj, asserted_properties=None)
Parameters:
  • obj (Any)

  • asserted_properties (List[str] | None)

Return type:

bool

is_permitted_traj_result(obj)
Parameters:

obj (Any)

Return type:

bool

has_required_properties(traj, asserted_properties=None)
Parameters:
  • traj (List[shnitsel.data.trajectory_format.Trajectory] | shnitsel.data.trajectory_format.Trajectory)

  • asserted_properties (List[str] | None)

Return type:

bool