shnitsel.data.tree¶
Exceptions¶
Inappropriate argument value (of correct type). |
Classes¶
Sentinel value for |
Functions¶
|
Transforms a DataTree into a single stacked Dataset |
Module Contents¶
- exception InconsistentAttributeError¶
Bases:
ValueErrorInappropriate argument value (of correct type).
- class MissingValue¶
Sentinel value for
tree_to_frames
- tree_to_frames(tree, allow_inconsistent=None)¶
Transforms a DataTree into a single stacked Dataset
- Parameters:
tree – The DataTree to transform
allow_inconsistent (set | None) – A list specifying attributes that should not be checked for consistency, whereas they normally would be. By default None
optional – A list specifying attributes that should not be checked for consistency, whereas they normally would be. By default None
- Returns:
A single Dataset with trajectories stacked along a dimension
frame;attributes required to be consistent across trajectories remain attributes;
attributes permitted to vary across trajectories become coordinates;
other Dataset-level attributes are ignored and omitted.
Variable-level attributes are checked for consistency and propagated to the
result.
- Raises:
InconsistentAttributeError – If any of those attributes required to be unique across trajectories violate this condition, or if any of them are missing in all trajectories (in which case their value is consistent but invalid); this error can be suppressed by specifying the appropriate attribute names in the
allow_inconsistentparameter. Note that suppression only works for Dataset-level attributes; inconsistency amongst Variable-level attributes always raises.- Return type:
Examples
>>> frames = tree_to_frames(dt['/unknown'], allow_inconsistent={'delta_t'})