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 type: Literal['ElementFilter'] = 'ElementFilter'
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

str

classmethod fail_reason()[source]

Returns a friendly description of why a molecule would fail to pass the component.

Return type

str

classmethod properties()[source]

Returns the runtime properties of the component such as parallel safe.

Return type

openff.qcsubmit.common_structures.ComponentProperties

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

Dict

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
Returns

A component result class which handles collecting together molecules that pass and fail the component

Return type

openff.qcsubmit.workflow_components.utils.ComponentResult

classmethod info()

Returns a dictionary of the friendly descriptions of the class.

Return type

Dict[str, str]

classmethod is_available()

Check if any of the requested backend toolkits can be used.

Return type

bool