Exclusions

class Exclusion(atom_a: Atom, atom_b: Atom)[source]

Bases: object

Represents non-bonded interactions between two atoms in a molecular system.

Parameters:
  • atom_a (Atom) – The first atom involved in the exclusion.

  • atom_b (Atom) – The second atom involved in the exclusion.

classmethod from_dict(data: Dict[str, int | float], atoms: List['Atom']) Exclusion[source]

Create a new Exclusion from a dictionary (such as that created with Exclusion.to_dict()) and list of Atoms.

The structure of the dictionary is as below: {‘atom_a’: self.atom_a.atom_id, ‘atom_b’: self.atom_b.atom_id}

Parameters:
  • data (dict) – dictionary containing data to make an Exclusion, generate with ‘to_dict()’.

  • atoms (List["Atom"]) – list of Atoms. The list may contain more than 2 atoms, as long as the id’s of the two atoms specified in the data dict are present.

Returns:

a new Exclusion

Return type:

Exclusion

classmethod from_line(line: str, atoms: List['Atom'], indexes=[0, 1]) Exclusion[source]

Class method to construct Exclusion from the line of an ITP file and a list of all Atom’s present in the topology.

Parameters:
  • line (str) – the ITP file line

  • atoms (List["Atom"]) – list of all Atoms in the Topology

  • indexes (list, optional) – optional tuple of values to index into elements of the line, defaults to [0, 1]

Returns:

the new Exclusion

Return type:

Exclusion

remove()[source]

Delete self from all related Atoms. Used to cleanup and remove attributes during Polymer.extend().

to_dict() dict[source]

Convert this Exclusion to a dictionary representation.

The structure of the dictionary is as below: {‘atom_a’: self.atom_a.atom_id, ‘atom_b’: self.atom_b.atom_id}

Returns:

a dictionary containing the id’s of the Exclusion’s Atoms.

Return type:

dict