xnn.common.models.registry#

Name -> class registry so new models are added without touching the core.

For example:

from xnn.common.models.registry import register_model, build_model

@register_model("mymodel")
class MyModel(InteratomicPotential):
    @classmethod
    def from_config(cls, cfg): ...

A model becomes usable from any config (YAML/Hydra/argparse) the moment it is imported and registered. This is the extension point referenced in the README.

Functions

add_dispersion(model, spec)

Wrap model in a D3 or D4 dispersion correction.

available_models()

List the names of all currently registered models.

build_model(cfg)

Instantiate a registered model from a configuration dataclass.

register_model(name)

Return a class decorator that registers a model under name.