From 8ffd4995f491d9d42109006f18ef599e3827a14c Mon Sep 17 00:00:00 2001 From: frostedoyster Date: Thu, 29 Feb 2024 03:27:07 +0100 Subject: [PATCH 1/3] Move `normalize.py` to utils of `alchemical_model` --- src/metatensor/models/experimental/alchemical_model/model.py | 2 +- src/metatensor/models/experimental/alchemical_model/train.py | 2 +- .../{ => experimental/alchemical_model}/utils/normalize.py | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/metatensor/models/{ => experimental/alchemical_model}/utils/normalize.py (100%) diff --git a/src/metatensor/models/experimental/alchemical_model/model.py b/src/metatensor/models/experimental/alchemical_model/model.py index d0eab958e..3fe62ab05 100644 --- a/src/metatensor/models/experimental/alchemical_model/model.py +++ b/src/metatensor/models/experimental/alchemical_model/model.py @@ -18,7 +18,7 @@ from ... import ARCHITECTURE_CONFIG_PATH from ...utils.composition import apply_composition_contribution -from ...utils.normalize import apply_normalization +from .utils.normalize import apply_normalization from .utils import systems_to_torch_spex_dict diff --git a/src/metatensor/models/experimental/alchemical_model/train.py b/src/metatensor/models/experimental/alchemical_model/train.py index 7e3063967..b6e87bd02 100644 --- a/src/metatensor/models/experimental/alchemical_model/train.py +++ b/src/metatensor/models/experimental/alchemical_model/train.py @@ -22,7 +22,7 @@ from ...utils.merge_capabilities import merge_capabilities from ...utils.model_io import load_checkpoint, save_model from ...utils.neighbors_lists import get_system_with_neighbors_lists -from ...utils.normalize import ( +from .utils.normalize import ( get_average_number_of_atoms, get_average_number_of_neighbors, ) diff --git a/src/metatensor/models/utils/normalize.py b/src/metatensor/models/experimental/alchemical_model/utils/normalize.py similarity index 100% rename from src/metatensor/models/utils/normalize.py rename to src/metatensor/models/experimental/alchemical_model/utils/normalize.py From ccdb428133c504c4651232768ff9baf3a2ae8360 Mon Sep 17 00:00:00 2001 From: frostedoyster Date: Thu, 29 Feb 2024 04:11:25 +0100 Subject: [PATCH 2/3] Also remove it from the docs --- docs/src/dev-docs/utils/index.rst | 1 - docs/src/dev-docs/utils/normalize.rst | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 docs/src/dev-docs/utils/normalize.rst diff --git a/docs/src/dev-docs/utils/index.rst b/docs/src/dev-docs/utils/index.rst index 357f5d9f3..e95a13c87 100644 --- a/docs/src/dev-docs/utils/index.rst +++ b/docs/src/dev-docs/utils/index.rst @@ -18,6 +18,5 @@ This is the API for the ``utils`` module of ``metatensor-models``. merge_capabilities model-io neighbors_lists - normalize omegaconf output_gradient diff --git a/docs/src/dev-docs/utils/normalize.rst b/docs/src/dev-docs/utils/normalize.rst deleted file mode 100644 index 3328960e2..000000000 --- a/docs/src/dev-docs/utils/normalize.rst +++ /dev/null @@ -1,9 +0,0 @@ -Normalization -============= - -Utilities to normalize the target values used for training. - -.. automodule:: metatensor.models.utils.normalize - :members: - :undoc-members: - :show-inheritance: From df8a2a392e961f11f852f9449cb88e148020dc58 Mon Sep 17 00:00:00 2001 From: frostedoyster Date: Thu, 29 Feb 2024 04:17:09 +0100 Subject: [PATCH 3/3] Lint --- src/metatensor/models/experimental/alchemical_model/model.py | 2 +- src/metatensor/models/experimental/alchemical_model/train.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/metatensor/models/experimental/alchemical_model/model.py b/src/metatensor/models/experimental/alchemical_model/model.py index 3fe62ab05..8e2521c38 100644 --- a/src/metatensor/models/experimental/alchemical_model/model.py +++ b/src/metatensor/models/experimental/alchemical_model/model.py @@ -18,8 +18,8 @@ from ... import ARCHITECTURE_CONFIG_PATH from ...utils.composition import apply_composition_contribution -from .utils.normalize import apply_normalization from .utils import systems_to_torch_spex_dict +from .utils.normalize import apply_normalization DEFAULT_HYPERS = OmegaConf.to_container( diff --git a/src/metatensor/models/experimental/alchemical_model/train.py b/src/metatensor/models/experimental/alchemical_model/train.py index b6e87bd02..3b07d80d1 100644 --- a/src/metatensor/models/experimental/alchemical_model/train.py +++ b/src/metatensor/models/experimental/alchemical_model/train.py @@ -22,11 +22,11 @@ from ...utils.merge_capabilities import merge_capabilities from ...utils.model_io import load_checkpoint, save_model from ...utils.neighbors_lists import get_system_with_neighbors_lists +from .model import DEFAULT_HYPERS, Model from .utils.normalize import ( get_average_number_of_atoms, get_average_number_of_neighbors, ) -from .model import DEFAULT_HYPERS, Model logger = logging.getLogger(__name__)