scine_puffin.utilities.compound_and_flask_helpers¶
Functions
|
Construct the compound or flask object depending on the type. |
- scine_puffin.utilities.compound_and_flask_helpers.get_compound_or_flask(object_id: db.ID, object_type: db.CompoundOrFlask, compounds: db.Collection, flasks: db.Collection) db.Compound | db.Flask [source]¶
Construct the compound or flask object depending on the type. Flask and Compound have a large set of functions in common. Through this function, we do not have to differentiate between them at every point.
- Parameters:
- object_iddb.ID
The ID of the object to construct.
- object_typedb.CompoundOrFlask
The label for Compound or Flaks.
- compoundsdb.Collection
The compounds collection.
- flasksdb.Collection
The flasks collection.
- Returns:
- Either the flask or compound object.
- Raises:
- RuntimeError
If the object_type is unknown.