from_dict#

static AtomComponent.from_dict(
data: json,
frac: bool = False,
lattice: Lattice | None = None,
) AtomComponent#

Construct an AtomComponent from a Python dict

The Prim reference documents the expected format:

data = {
    "coordinate": [r1, r2, r3],
    "name": "<atom_name>",
    "properties": {
      "<property_name>": {
        "value": [v1, ...],
      },
      ...
    }
}
Parameters:
  • data (dict) – The Python dict representation of the AtomComponent

  • frac (bool = False) – If True, read coordinate as fractional.

  • lattice (Optional[Lattice] = None) – The lattice, required if frac is True.

Returns:

lattice – The Lattice.

Return type:

Lattice