flowrep.storage module
Convenience tools for accessing :cls:`flowrep.retrospective.LiveWorkflow` data stored in bagofholding H5Bag objects using “lexical” paths (node names, “inputs”/”outputs”, and port names).
- class flowrep.storage.LexicalBagBrowser(bag: H5Bag | str | pathlib.Path)[source]
Bases:
objectA convenience class for browsing and loading data from :cls:`LiveWorkflow` objects serialized in a bagofholding :cls:`H5Bag`.
Lets you access data using the “lexical” paths (i.e. “.”-joined paths of node names, “inputs/outputs”, and port names) instead of the actual H5 path inside the file.
- browse() LexicalBagTree | list[str][source]
Look at (but don’t load and instantiate) the available content.
- load(path: str) AtomicData | DagData | FlowControlData | InputDataPort | OutputDataPort[source]
Load a node or IO port using its lexical path.
- widget() LexicalBagTree[source]
A jupyter-notebook widget for graphical browsing
- flowrep.storage.list_lexical_paths(bag: H5Bag) list[str][source]
Look through the bag and return a list of “.”-separated lexical paths for nodes and ports.
- flowrep.storage.load_from_bag(bag: H5Bag, lexical_path: str) retrospective.AtomicData | retrospective.DagData | retrospective.FlowControlData | retrospective.InputDataPort | retrospective.OutputDataPort[source]
Load data from a :cls:`LiveNode` stored in a bagofholding by using its lexical path.
- Parameters:
bag (H5Bag) – The bag containing the saved node data.
lexical_path (str) – The dot-separated path of node names, IO references, and/or port names.
- Returns:
A retrospective data node or IO data port