6.7. Abstract Interface

This is the abstract interface that is used as the base for all ASE based calculations.

It is not intended to be used directly, but rather as a base for other interfaces.

class pharmaforge.interfaces.abstractio.AbstractIO[source]

Bases: ABC

Methods

ObtainDeepData(filename)

Obtain the system data from the DeepIO interface and converts each configuration to an ASE atoms object.

ObtainQueryData(queryresults)

Obtain the system data from a query

calculate([limit, verbose, num_workers])

Calculate the energies and forces of the system using the interface.

find_clusters(structure[, cutoff])

Identify clusters of atoms in a structure based on a distance cutoff.

process_structure

ObtainDeepData(filename)[source]

Obtain the system data from the DeepIO interface and converts each configuration to an ASE atoms object.

Parameters:

filename (str) – The name of the file containing the system data.

Return type:

None

ObtainQueryData(queryresults)[source]

Obtain the system data from a query

Parameters:

queryresults (str) – The results of a query to obtain the system data.

Return type:

None

See also

pharmaforge.queries.Query.results_to_ase

Function to convert query results to ASE atoms object.

calculate(limit=0, verbose=False, num_workers=1)[source]

Calculate the energies and forces of the system using the interface.

Parameters:
  • limit (int) – The maximum number of calculations to perform. Default is 0 (no limit).

  • verbose (bool) – Whether to print progress information. Default is False.

  • num_workers (int) – The number of worker processes to use for multiprocessing. Default is 1.

Returns:

  • energies (dict) – A dictionary containing the energies of the system.

  • forces (dict) – A dictionary containing the forces acting on the atoms in the system.

Raises:

ValueError – If no system data is found. If no calculator is found.

static find_clusters(structure, cutoff=10.0)[source]

Identify clusters of atoms in a structure based on a distance cutoff.

Parameters:
  • structure (ase.Atoms) – The ASE atoms object containing the system data.

  • cutoff (float) – The distance cutoff for identifying clusters.

Returns:

clusters – A list of ASE atoms objects, each representing a cluster.

Return type:

list of ase.Atoms

static process_structure(args)[source]