ase_notebook.atoms_convert module

Module for serializing ase.Atoms.

class ase_notebook.atoms_convert.ASEEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

JSON Encoder for ase.Atoms serialization.

default(obj)[source]

Parse object.

ase_notebook.atoms_convert.ase_decoder_hook(dct)[source]

JSON decoder hook for ase.Atoms de-serialization.

ase_notebook.atoms_convert.convert_to_atoms(obj)[source]

Attempt to convert an object to an ase.Atoms object.

ase_notebook.atoms_convert.create_ndarray(shape, dtype, data)[source]

Create ndarray from shape, dtype and flattened data.

ase_notebook.atoms_convert.deserialize_atoms(json_string: str) → ase.atoms.Atoms[source]

Deserialize a JSON string to an ase.Atoms instance.

ase_notebook.atoms_convert.numpyfy(obj)[source]

Convert an object to numpy array(s) recursively.

ase_notebook.atoms_convert.serialize_atoms(atoms: ase.atoms.Atoms, description: str = '') → str[source]

Serialize an ase.Atoms instance to a dictionary.

ase_notebook.atoms_convert.try_int(obj)[source]

Try conversion of object to int.