ord_schema.macros

ord_schema.macros.solutions

Macros for programmatic message creation.

ord_schema.macros.solutions.brine(volume=None)
ord_schema.macros.solutions.simple_solution(solvent_smiles: str, solute_smiles: str | None = None, volume: None | str | Volume = None, concentration: None | str | Concentration = None, saturated: bool = False) list[Compound]

Creates a solution with at most one solvent and one solute.

Parameters:
  • solvent_smiles – SMILES of the solvent.

  • solute_smiles – SMILES of the solute. If not specified, a pure solvent is generated.

  • volume – Volume of solution (total volume including the solute).

  • concentration – Concentration of solution. If both concentration and volume are specified, a solute quantity is computed. The schema does not currently have a way to represent an unknown volume of solution with a known concentration.

  • saturated – Whether the solution is saturated. Saturated and concentrated cannot both be specified.

Returns: A list of solvent/solute Compounds.

ord_schema.macros.workups

Macros for quickly creating workup steps.

Example usage:

from ord_schema.macros import workups from ord_schema.macros import solutions

The reaction was quenched with 300 ml of 0.5M NaHCO3 solution and the phases were separated. The aqueous layer was back-extracted twice with 100 ml of EtOAc. The organic layers were combined and washed with 200 ml of saturated NaCl solution, dried over MgSO4 and filtered. Upon concentration to an oil, the crude product was purified by normal phase column chromatography

reaction.workups.MergeFrom([
workups.add_solution(solutions.simple_solution(

solvent_smiles=’O’, solute_smiles=’[Na+][HCO3-]’, volume=’300mL’, concentration=’0.5M’)),

workups.separate_phases(keep_phase=’organic’), workups.add_solution(solutions.simple_solution(

solvent_smiles=’CC(=O)OCC’, volume=’100mL’), type=’EXTRACTION’),

workups.separate_phases(keep_phase=’organic’), workups.add_solution(solutions.simple_solution(

solvent_smiles=’CC(=O)OCC’, volume=’100mL’), type=’EXTRACTION’),

workups.separate_phases(keep_phase=’organic’), workups.add_solution(solutions.brine(‘200mL’), type=’WASH’), workups.drying_agent(‘[Mg+2].[O-]S([O-])(=O)=O’), workups.filter(keep_phase=’filtrate’), workups.rotovap(), reaction_pb2.ReactionWorkup(type=’OTHER_CHROMATOGRAPHY’),

])

ord_schema.macros.workups.add_solution(solution: Iterable[Compound], workup_type: str = 'ADDITION') ReactionWorkup

Create a workup representing addition of a solution.

type is commonly one of ‘ADDITION’, ‘EXTRACTION’, or ‘WASH’; see ReactionWorkup.WorkupType enum for full list of possible values.

ord_schema.macros.workups.drying_agent(agent_smiles: str) ReactionWorkup

Create a workup representing addition of a drying agent.

ord_schema.macros.workups.filtration(keep_phase: str) ReactionWorkup

Create a workup representing a filtration step.

keep_phase should be one of ‘filtrate’ or ‘solid’.

ord_schema.macros.workups.rotovap() ReactionWorkup

Create a workup representing a rotary evaporation step.

ord_schema.macros.workups.separate_phases(keep_phase: str) ReactionWorkup

Create a workup representing a phase separation.

keep_phase is commonly either ‘aqueous’ or ‘organic’.