ElementFilter
- pydantic model openff.qcsubmit.workflow_components.ElementFilter[source]
Filter the molecules based on a list of allowed elements.
Note
The allowed_elements attribute can take a list of either symbols or atomic numbers and will resolve them to a common internal format as required.
Example
Using atomic symbols or atomic numbers in components.
`python >>> from openff.qcsubmit.workflow_components import ElementFilter >>> efil = ElementFilter() # set the allowed elements to H,C,N,O >>> efil.allowed_elements = ['H', 'C', 'N', 'O'] >>> efil.allowed_elements = [1, 6, 7, 8] `
Show JSON schema
{ "title": "ElementFilter", "description": "Filter the molecules based on a list of allowed elements.\n\nNote:\n The `allowed_elements` attribute can take a list of either symbols or atomic numbers and will resolve them to a\n common internal format as required.\n\nExample:\n Using atomic symbols or atomic numbers in components.\n\n ```python\n >>> from openff.qcsubmit.workflow_components import ElementFilter\n >>> efil = ElementFilter()\n # set the allowed elements to H,C,N,O\n >>> efil.allowed_elements = ['H', 'C', 'N', 'O']\n >>> efil.allowed_elements = [1, 6, 7, 8]\n ```", "type": "object", "properties": { "type": { "title": "Type", "default": "ElementFilter", "enum": [ "ElementFilter" ], "type": "string" }, "allowed_elements": { "title": "Allowed Elements", "description": "The list of allowed elements as symbols or atomic number ints.", "default": [ "H", "C", "N", "O", "F", "P", "S", "Cl", "Br", "I" ], "type": "array", "items": { "anyOf": [ { "type": "integer" }, { "type": "string" } ] } } } }
- Config
allow_mutation: bool = True
validate_assignment: bool = True
- Fields
allowed_elements (List[Union[int, str]])
type (Literal['ElementFilter'])
- Validators
check_allowed_elements
»allowed_elements
- field allowed_elements: List[Union[int, str]] = ['H', 'C', 'N', 'O', 'F', 'P', 'S', 'Cl', 'Br', 'I']
The list of allowed elements as symbols or atomic number ints.
- Validated by
check_allowed_elements
- classmethod description()[source]
Returns a friendly description of the workflow component.
- Return type
- classmethod fail_reason()[source]
Returns a friendly description of why a molecule would fail to pass the component.
- Return type
- classmethod properties()[source]
Returns the runtime properties of the component such as parallel safe.
- provenance(toolkit_registry)[source]
Generate version information for all of the software used during the running of this component.
- Returns
A dictionary of all of the software used in the component along wither their version numbers.
- Parameters
toolkit_registry (openff.toolkit.utils.toolkit_registry.ToolkitRegistry) –
- Return type
Note
The element class in OpenMM is used to match the elements so the OpenMM version is given.
- apply(molecules, toolkit_registry, processors=None, verbose=True)
This is the main feature of the workflow component which should accept a molecule, perform the component action and then return any resulting molecules.
- Parameters
molecules (List[openff.toolkit.topology.molecule.Molecule]) – The list of molecules to be processed by this component.
toolkit_registry (openff.toolkit.utils.toolkit_registry.ToolkitRegistry) – The openff.toolkit.utils.ToolkitRegistry which declares the available backend toolkits to be used.
processors (Optional[int]) – The number of processor the component can use to run the job in parallel across molecules, None will default to all cores.
verbose (bool) – If true a progress bar should be shown on screen.
- Returns
A component result class which handles collecting together molecules that pass and fail the component
- Return type