xdl.readwrite.validation module

xdl.readwrite.validation.check_attrs_are_valid(attrs: Dict[str, str], target_class: type) None[source]

Check that attrs can be passed into target_class like target_class(**attrs).

Parameters
  • attrs (Dict[str, str]) – Attribute dict to check all keys are args of target_class.__init__ method.

  • target_class (type) – target_class to check attrs are args of __init__ method.

Raises

XDLError – Error raised if any of attrs aren’t args of target_class.__init__ method.

xdl.readwrite.validation.check_reagents_are_all_declared(steps: List[xdl.steps.core.step.Step], reagents: List[xdl.reagents.Reagent]) None[source]

Check all reagents used in steps are declared in Reagents section.

Parameters
  • steps (List[Step]) – List of steps to check.

  • reagents (List[Reagent]) – List of reagents to check steps against.

Raises

XDLError – Error raised if reagent used in step but not declared in Reagents section.

xdl.readwrite.validation.check_vessels_are_all_declared(steps: List[xdl.steps.core.step.Step], components: List[xdl.hardware.Component]) None[source]

Check all components used in steps are declared in Hardware section.

Parameters
  • steps (List[Step]) – List of steps to check.

  • components (List[Component]) – List of components to check steps against.

Raises

XDLError – Error raised if component used in step but not declared in Hardware section.

xdl.readwrite.validation.get_valid_attrs(target_class: type) List[str][source]

Get valid attrs for passing to target_class.__init__ methods.

Parameters

target_class (type) – Class to get valid attrs for __init__ method.

Returns

List of arg names for target_class.__init__ method.

Return type

List[str]