shnitsel.data.shnitsel_db.db_trajectory_group¶
Attributes¶
Classes¶
Class to hold auxiliaryt info of a group of Trajectories in ShnitselDB |
|
DataTree node to keep track of a group of trajectories where properties defining the group can be set |
Module Contents¶
- T¶
- class GroupInfo¶
Class to hold auxiliaryt info of a group of Trajectories in ShnitselDB
- class TrajectoryGroup(group_info=None, children=None)¶
Bases:
xarray.DataTreeDataTree node to keep track of a group of trajectories where properties defining the group can be set
- Parameters:
group_info (GroupInfo | None)
children (Mapping[str, shnitsel.data.shnitsel_db.db_trajectory_data.TrajectoryData | Self] | None)
- is_level(target_level)¶
Check whether we are at a certain level
- get_group_info()¶
Reconstruct the Group info object from settings stored in this node’s attributes
- Returns:
The group information
- Return type:
- collect_trajectories()¶
Function to retrieve all trajectories in this subtree
- Returns:
List of all nodes with TrajectoryData type
- Return type:
List[TrajectoryData]
- map_over_trajectories(map_func, result_as_dict=False, result_var_name='result')¶
Method to apply a function to all trajectories in this subtree.
- Parameters:
map_func (Callable[[Trajectory], T]) – Function to be applied to each individual trajectory in this database structure.
result_as_dict (bool, optional) – Whether to return the result as a dict or as a TrajectoryGroup structure. Defaults to False which yields a CompoundGroup.
result_var_name (str,optional) – The name of the result variable to be assigned in either the result dataset or in the result dict.
- Returns:
The result, either again as a TrajectoryGroup structure or as a layered dict structure.
- Return type:
- merge_with(other)¶
Function to merge two TrajectoryGroups into one.
Called when merging two database states. Will fail if group_info differs between compounds to avoid loss of information.
- Parameters:
other (CompoundGroup) – The other CompoundGroup to be merged
- Raises:
ValueError – Raised if the compound_info differs.
- Returns:
A CompoundGroup object holding the entire merged subtree
- Return type: