# openforcefield.typing.chemistry.ChemicalEnvironment

class `openforcefield.typing.chemistry.``ChemicalEnvironment`(smirks=None, label=None, validate_parsable=True, validate_valence_type=True, toolkit_registry=None)

  Chemical environment abstract base class used for validating SMIRKS

  Methods

  `get_type`(self[, toolkit_registry]) | Return the valence type implied by the connectivity of the bound atoms in this ChemicalEnvironment.
  `validate`(self[, validate_valence_type, …]) | Returns True if the underlying smirks is the correct valence type, False otherwise.
  `validate_smirks`(smirks[, validate_parsable, …]) | Check the provided SMIRKS string is valid, and if requested, tags atoms appropriate to the specified valence type.

  `__init__`(self, smirks=None, label=None, validate_parsable=True, validate_valence_type=True, toolkit_registry=None)

    Initialize a chemical environment abstract base class.

    smirks = string, optional

      if smirks is not None, a chemical environment is built from the provided SMIRKS string

    label = anything, optional

      intended to be used to label this chemical environment could be a string, int, or float, or anything

    validate_parsable: bool, optional, default=True

      If specified, ensure the provided smirks is parsable

    validate_valence_typebool, optional, default=True

      If specified, ensure the tagged atoms are appropriate to the specified valence type

    toolkit_registry = string or ToolkitWrapper or ToolkitRegistry. Default = None

      Either a ToolkitRegistry, ToolkitWrapper, or the strings ‘openeye’ or ‘rdkit’, indicating the backend to use for validating the correct connectivity of the SMIRKS during initialization. If None, this function will use the GLOBAL_TOOLKIT_REGISTRY

    Raises
      SMIRKSParsingError

        if smirks was unparsable

      SMIRKSMismatchError

        if smirks did not have expected connectivity between tagged atoms and validate_valence_type=True

  Methods

  `__init__`(self[, smirks, label, …]) | Initialize a chemical environment abstract base class.
  `get_type`(self[, toolkit_registry]) | Return the valence type implied by the connectivity of the bound atoms in this ChemicalEnvironment.
  `validate`(self[, validate_valence_type, …]) | Returns True if the underlying smirks is the correct valence type, False otherwise.
  `validate_smirks`(smirks[, validate_parsable, …]) | Check the provided SMIRKS string is valid, and if requested, tags atoms appropriate to the specified valence type.