ocpapi.client.models

Contents

ocpapi.client.models#

Classes#

_DataModel

Base class for all data models.

Model

Stores information about a single model supported in the API.

Models

Stores the response from a request for models supported in the API.

Bulk

Stores information about a single bulk material.

Bulks

Stores the response from a request to fetch bulks supported in the API.

Adsorbates

Stores the response from a request to fetch adsorbates supported in the

Atoms

Subset of the fields from an ASE Atoms object that are used within this

SlabMetadata

Stores metadata about a slab that is returned from the API.

Slab

Stores all information about a slab that is returned from the API.

Slabs

Stores the response from a request to fetch slabs for a bulk structure.

AdsorbateSlabConfigs

Stores the response from a request to fetch placements of a single

AdsorbateSlabRelaxationsSystem

Stores the response from a request to submit a new batch of adsorbate

AdsorbateSlabRelaxationsRequest

Stores the request to submit a new batch of adsorbate slab relaxations.

Status

Relaxation status of a single adsorbate placement on a slab.

AdsorbateSlabRelaxationResult

Stores information about a single adsorbate slab configuration, including

AdsorbateSlabRelaxationsResults

Stores the response from a request for results of adsorbate slab

Module Contents#

class ocpapi.client.models._DataModel#

Base class for all data models.

other_fields: dataclasses_json.CatchAll#

Fields that may have been added to the API that all not yet supported explicitly in this class.

class ocpapi.client.models.Model#

Bases: _DataModel

Stores information about a single model supported in the API.

id: str#

The ID of the model.

class ocpapi.client.models.Models#

Bases: _DataModel

Stores the response from a request for models supported in the API.

models: List[Model]#

The list of models that are supported.

class ocpapi.client.models.Bulk#

Bases: _DataModel

Stores information about a single bulk material.

src_id: str#

The ID of the material.

formula: str#

The chemical formula of the material.

elements: List[str]#

The list of elements in the material.

class ocpapi.client.models.Bulks#

Bases: _DataModel

Stores the response from a request to fetch bulks supported in the API.

bulks_supported: List[Bulk]#

List of bulks that can be used in the API.

class ocpapi.client.models.Adsorbates#

Bases: _DataModel

Stores the response from a request to fetch adsorbates supported in the API.

adsorbates_supported: List[str]#

List of adsorbates that can be used in the API.

class ocpapi.client.models.Atoms#

Bases: _DataModel

Subset of the fields from an ASE Atoms object that are used within this API.

cell: Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]]#

3x3 matrix with unit cell vectors.

pbc: Tuple[bool, bool, bool]#

Whether the structure is periodic along the a, b, and c lattice vectors, respectively.

numbers: List[int]#

The atomic number of each atom in the unit cell.

positions: List[Tuple[float, float, float]]#

The coordinates of each atom in the unit cell, relative to the cartesian frame.

tags: List[int]#

Labels for each atom in the unit cell where 0 represents a subsurface atom (fixed during optimization), 1 represents a surface atom, and 2 represents an adsorbate atom.

to_ase_atoms() ase.Atoms#

Creates an ase.Atoms object with the positions, element numbers, etc. populated from values on this object.

Returns:

ase.Atoms object with values from this object.

class ocpapi.client.models.SlabMetadata#

Bases: _DataModel

Stores metadata about a slab that is returned from the API.

bulk_src_id: str#

The ID of the bulk material from which the slab was derived.

millers: Tuple[int, int, int]#

The Miller indices of the slab relative to bulk structure.

shift: float#

The position along the vector defined by the Miller indices at which a cut was taken to generate the slab surface.

top: bool#

If False, the top and bottom surfaces for this millers/shift pair are distinct and this slab represents the bottom surface.

class ocpapi.client.models.Slab#

Bases: _DataModel

Stores all information about a slab that is returned from the API.

atoms: Atoms#

The structure of the slab.

metadata: SlabMetadata#

Extra information about the slab.

class ocpapi.client.models.Slabs#

Bases: _DataModel

Stores the response from a request to fetch slabs for a bulk structure.

slabs: List[Slab]#

The list of slabs that were generated from the input bulk structure.

class ocpapi.client.models.AdsorbateSlabConfigs#

Bases: _DataModel

Stores the response from a request to fetch placements of a single absorbate on a slab.

adsorbate_configs: List[Atoms]#

List of structures, each representing one possible adsorbate placement.

slab: Slab#

The structure of the slab on which the adsorbate is placed.

class ocpapi.client.models.AdsorbateSlabRelaxationsSystem#

Bases: _DataModel

Stores the response from a request to submit a new batch of adsorbate slab relaxations.

system_id: str#

Unique ID for this set of relaxations which can be used to fetch results later.

config_ids: List[int]#

The list of IDs assigned to each of the input adsorbate placements, in the same order in which they were submitted.

class ocpapi.client.models.AdsorbateSlabRelaxationsRequest#

Bases: _DataModel

Stores the request to submit a new batch of adsorbate slab relaxations.

adsorbate: str#

Description of the adsorbate.

adsorbate_configs: List[Atoms]#

List of adsorbate placements being relaxed.

bulk: Bulk#

Information about the original bulk structure used to create the slab.

slab: Slab#

The structure of the slab on which adsorbates are placed.

model: str#

The type of the ML model being used during relaxations.

ephemeral: bool | None#

Whether the relaxations can be deleted (assume they cannot be deleted if None).

adsorbate_reaction: str | None#

If possible, an html-formatted string describing the reaction will be added to this field.

class ocpapi.client.models.Status(*args, **kwds)#

Bases: enum.Enum

Relaxation status of a single adsorbate placement on a slab.

NOT_AVAILABLE = 'not_available'#

The configuration exists but the result is not yet available. It is possible that checking again in the future could yield a result.

FAILED_RELAXATION = 'failed_relaxation'#

The relaxation failed for this configuration.

SUCCESS = 'success'#

The relaxation was successful and the requested information about the configuration was returned.

DOES_NOT_EXIST = 'does_not_exist'#

The requested configuration does not exist.

__str__() str#
class ocpapi.client.models.AdsorbateSlabRelaxationResult#

Bases: _DataModel

Stores information about a single adsorbate slab configuration, including outputs for the model used in relaxations.

The API to fetch relaxation results supports requesting a subset of fields in order to limit the size of response payloads. Optional attributes will be defined only if they are including the response.

config_id: int#

ID of the configuration within the system.

status: Status#

The status of the request for information about this configuration.

system_id: str | None#

The ID of the system in which the configuration was originally submitted.

cell: Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | None#

3x3 matrix with unit cell vectors.

pbc: Tuple[bool, bool, bool] | None#

Whether the structure is periodic along the a, b, and c lattice vectors, respectively.

numbers: List[int] | None#

The atomic number of each atom in the unit cell.

positions: List[Tuple[float, float, float]] | None#

The coordinates of each atom in the unit cell, relative to the cartesian frame.

tags: List[int] | None#

Labels for each atom in the unit cell where 0 represents a subsurface atom (fixed during optimization), 1 represents a surface atom, and 2 represents an adsorbate atom.

energy: float | None#

The energy of the configuration.

energy_trajectory: List[float] | None#

The energy of the configuration at each point along the relaxation trajectory.

forces: List[Tuple[float, float, float]] | None#

The forces on each atom in the relaxed structure.

to_ase_atoms() ase.Atoms#

Creates an ase.Atoms object with the positions, element numbers, etc. populated from values on this object.

The predicted energy and forces will also be copied to the new ase.Atoms object as a SinglePointCalculator (a calculator that stores the results of an already-run simulation).

Returns:

ase.Atoms object with values from this object.

class ocpapi.client.models.AdsorbateSlabRelaxationsResults#

Bases: _DataModel

Stores the response from a request for results of adsorbate slab relaxations.

configs: List[AdsorbateSlabRelaxationResult]#

List of configurations in the system, each representing one placement of an adsorbate on a slab surface.

omitted_config_ids: List[int]#

List of IDs of configurations that were requested but omitted by the server. Results for these IDs can be requested again.