<jupyter_start><jupyter_text>Managing flowsheets  Retrieve any Unit, Stream or System object by ID `find` has access to Flowsheet objects where all BioSTEAM objects are registered. The main flowsheet defaults to the 'Default' flowsheet:<jupyter_code>import biosteam as bst
bst.find<jupyter_output><empty_output><jupyter_text>Find a Unit object:<jupyter_code>bst.Stream.species = bst.Species('Water', 'Ethanol')
unit = bst.units.Mixer('M1')
bst.find('M1')<jupyter_output><empty_output><jupyter_text>Find a Stream object:<jupyter_code>bst.find('d1')<jupyter_output>Stream: d1  from  Mixer-M1
 phase: 'l', T: 298.15 K, P: 101325 Pa
 flow: 0<jupyter_text>All Unit objects can be viewed as a diagram:<jupyter_code>bst.units.Mixer('M2')
bst.find.diagram()<jupyter_output><empty_output><jupyter_text>All Stream, Unit, and System objects are stored as Register objects in `find`:<jupyter_code>bst.find.stream
bst.find.unit
bst.find.system<jupyter_output><empty_output><jupyter_text>Access items in a register:<jupyter_code>bst.find.unit.M1<jupyter_output><empty_output><jupyter_text>Switch between flowsheets A new flowsheet may be created and set as the main flowsheet:<jupyter_code>bst.find.set_flowsheet(bst.Flowsheet('new_flowsheet'))
bst.find<jupyter_output><empty_output><jupyter_text>Now all new objects will be registered in the new flowsheet:<jupyter_code>unit = bst.units.Mixer('M3')
bst.find.diagram()<jupyter_output><empty_output><jupyter_text>Note that objects in the original flowsheet are not defined anymore and searching them would raise an error:<jupyter_code>bst.find('M1')<jupyter_output><empty_output><jupyter_text>All Flowsheet objects are added to the `flowsheet` registry. Switching between flowsheets is easy:<jupyter_code>bst.find.set_flowsheet(bst.find.flowsheet['default']) # Switch back to default flowsheet
bst.find<jupyter_output><empty_output><jupyter_text>As an example, the `lipidcane` biorefinery defines its own flowsheet and leaves it as the main flowsheet when you import it:<jupyter_code>from biosteam.biorefineries.lipidcane import system
bst.find
bst.find.diagram()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10291353383458647, 'fraction_numerical': 0.009868421052631578, 'mean_word_length': 8.37885462555066, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '140912', 'license': 'MIT', 'n_tokens_mistral': 772, 'n_tokens_neox': 746, 'n_words': 174, 'path': 'docs/tutorial/Managing flowsheets.ipynb', 'repo_name': 'lilanyu/biosteam', 'size': '2128'}