mattertune.configs.data.db

class mattertune.configs.data.db.DBDatasetConfig(*, type='db', src, energy_key=None, forces_key=None, stress_key=None, preload=True)[source]

Configuration for a dataset stored in an ASE database.

Parameters:
  • type (Literal['db'])

  • src (Database | str | Path)

  • energy_key (str | None)

  • forces_key (str | None)

  • stress_key (str | None)

  • preload (bool)

type: Literal['db']

Discriminator for the DB dataset.

src: Database | str | Path

Path to the ASE database file or a database object.

energy_key: str | None

Key for the energy label in the database.

forces_key: str | None

Key for the force label in the database.

stress_key: str | None

Key for the stress label in the database.

preload: bool

Whether to load all the data at once or not.

create_dataset()[source]
class mattertune.configs.data.db.DatasetConfigBase[source]
abstract create_dataset()[source]
Return type:

Dataset[Atoms]

prepare_data()[source]

Prepare the dataset for training.

Use this to download and prepare data. Downloading and saving data with multiple processes (distributed settings) will result in corrupted data. Lightning ensures this method is called only within a single process, so you can safely add your downloading logic within this method.

classmethod ensure_dependencies()[source]

Ensure that all dependencies are installed.

This method should raise an exception if any dependencies are missing, with a message indicating which dependencies are missing and how to install them.