Skip to content

Commit

Permalink
Equistore was renamed to metatensor
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed Aug 31, 2023
1 parent e69e8bb commit 4a7ed7e
Show file tree
Hide file tree
Showing 102 changed files with 598 additions and 596 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
CIBW_BUILD_VERBOSITY: 2
CIBW_MANYLINUX_X86_64_IMAGE: rustc-manylinux2014_x86_64
CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude libequistore.so -w {dest_dir} {wheel}"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude libmetatensor.so -w {dest_dir} {wheel}"

- uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ myst-parser # markdown => rst translation, used in extensions/rascaline_json

# dependencies for the tutorials
--extra-index-url https://download.pytorch.org/whl/cpu
equistore[torch] @ https://github.com/lab-cosmo/equistore/archive/ee5ab99.zip
metatensor[torch] @ https://github.com/lab-cosmo/metatensor/archive/32ad5bb.zip
torch
chemfiles
matplotlib
Expand Down
6 changes: 3 additions & 3 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sys.path.append(os.path.join(ROOT, "docs", "extensions"))

os.environ["RASCALINE_IMPORT_FOR_SPHINX"] = "1"
os.environ["EQUISTORE_IMPORT_FOR_SPHINX"] = "1"
os.environ["METATENSOR_IMPORT_FOR_SPHINX"] = "1"

# -- Project information -----------------------------------------------------

Expand Down Expand Up @@ -45,7 +45,7 @@ def build_cargo_docs():
"--package",
"rascaline",
"--package",
"equistore",
"metatensor",
"--no-deps",
],
env=environment,
Expand Down Expand Up @@ -137,7 +137,7 @@ def setup(app):
intersphinx_mapping = {
"ase": ("https://wiki.fysik.dtu.dk/ase/", None),
"chemfiles": ("https://chemfiles.org/chemfiles.py/latest/", None),
"equistore": ("https://lab-cosmo.github.io/equistore/latest/", None),
"metatensor": ("https://lab-cosmo.github.io/metatensor/latest/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"skmatter": ("https://scikit-matter.readthedocs.io/en/latest/", None),
Expand Down
10 changes: 5 additions & 5 deletions docs/src/devdoc/how-to/new-calculator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ system, already implemented or not.
In this tutorial, our goal is to write a new struct implementing
`CalculatorBase`_. This implementation will take as input a slice of boxed
`System`_ trait objects, and using data from those fill up a `TensorMap`_
(defined in the equistore crate).
(defined in the metatensor crate).

.. _System: ../reference/rust/rascaline/systems/trait.System.html
.. _CalculatorBase: ../reference/rust/rascaline/calculators/trait.CalculatorBase.html
.. _Calculator: ../reference/rust/rascaline/struct.Calculator.html
.. _TensorMap: ../reference/rust/equistore/tensor/struct.TensorMap.html
.. _TensorMap: ../reference/rust/metatensor/tensor/struct.TensorMap.html

Implementation
--------------
Expand Down Expand Up @@ -181,8 +181,8 @@ center species and one neighbor species. This key builder requires a ``cutoff``
(to determine which neighbors it should use) and ``self_pairs`` indicated
whether atoms should be considered to be their own neighbor or not.

.. _Labels: ../reference/rust/equistore/labels/struct.Labels.html
.. _LabelsBuilder: ../reference/rust/equistore/labels/struct.LabelsBuilder.html
.. _Labels: ../reference/rust/metatensor/labels/struct.Labels.html
.. _LabelsBuilder: ../reference/rust/metatensor/labels/struct.LabelsBuilder.html

.. literalinclude:: ../../../../rascaline/src/tutorials/moments/s2_metadata.rs
:language: rust
Expand Down Expand Up @@ -378,7 +378,7 @@ requested, then we can skip the calculation for this pair. We also use
:dedent: 4


.. _Labels::position: ../reference/rust/equistore/labels/struct.Labels.html#method.position
.. _Labels::position: ../reference/rust/metatensor/labels/struct.Labels.html#method.position

Now, we can check if the samples are present, and if they are, iterate over the
requested features, compute the moments for the current pair distance, and
Expand Down
6 changes: 3 additions & 3 deletions docs/src/explanations/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ Descriptors: data storage for atomistic machine learning

After using a calculator on one or multiple systems, users will get the
numerical representation of their atomic systems in a ``descriptor`` object.
Rascaline uses `equistore`_ ``TensorMap`` type when returning descriptors.
Rascaline uses `metatensor`_ ``TensorMap`` type when returning descriptors.

.. _equistore: https://lab-cosmo.github.io/equistore/latest/
.. _metatensor: https://lab-cosmo.github.io/metatensor/latest/

A ``TensorMap`` can be seen as a dictionary mapping some keys to a set of data
blocks. Each block contains both data (and gradients) arrays — i.e.
Expand All @@ -80,4 +80,4 @@ representations will have keys for the different equivariance classes
(``spherical_harmonics_l`` for SO(3) equivariants, *etc.*).

For more information on ``TensorMap`` and what can be done with one, please see
the `equistore`_ documentation.
the `metatensor`_ documentation.
42 changes: 21 additions & 21 deletions docs/src/get-started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ The build and installation can be configures with a few cmake options, using
| RASCALINE_ENABLE_CHEMFILES | Enable the usage of chemfiles for reading | ON |
| | structures from files | |
+--------------------------------------+-----------------------------------------------+----------------+
| RASCALINE_FETCH_EQUISTORE | Automatically fetch, build and install | OFF |
| | equistore (a dependency of rascaline) | |
| RASCALINE_FETCH_METATENSOR | Automatically fetch, build and install | OFF |
| | metatensor (a dependency of rascaline) | |
+--------------------------------------+-----------------------------------------------+----------------+

Using the Rust library
Expand Down Expand Up @@ -125,28 +125,28 @@ dependencies:
python -c "import torch; print(torch.utils.cmake_prefix_path)"
- :ref:`the C++ interface of rascaline <install-c-lib>`, which itself requires
the `C++ interface of equistore`_;
- the `TorchScript interface of equistore`_. We can download and build an
the `C++ interface of metatensor`_;
- the `TorchScript interface of metatensor`_. We can download and build an
appropriate version of it automatically by setting the cmake option
``-DRASCALINE_TORCH_FETCH_EQUISTORE_TORCH=ON``
``-DRASCALINE_TORCH_FETCH_METATENSOR_TORCH=ON``

If any of these dependencies is not in a standard location, you should specify
the installation directory when configuring cmake with ``CMAKE_PREFIX_PATH``.
Other useful configuration options are:

+---------------------------------------+-----------------------------------------------+----------------+
| Option | Description | Default |
+=======================================+===============================================+================+
| CMAKE_BUILD_TYPE | Type of build: debug or release | release |
+---------------------------------------+-----------------------------------------------+----------------+
| CMAKE_INSTALL_PREFIX | Prefix in which the library will be installed | ``/usr/local`` |
+---------------------------------------+-----------------------------------------------+----------------+
| CMAKE_PREFIX_PATH | ``;``-separated list of path where CMake will | |
| | search for dependencies. | |
+---------------------------------------+-----------------------------------------------+----------------+
| RASCALINE_TORCH_FETCH_EQUISTORE_TORCH | Should CMake automatically download and | OFF |
| | install equistore-torch? | |
+---------------------------------------+-----------------------------------------------+----------------+

.. _C++ interface of equistore: https://lab-cosmo.github.io/equistore/latest/get-started/installation.html#installing-the-c-and-c-library
.. _TorchScript interface of equistore: https://lab-cosmo.github.io/equistore/latest/get-started/installation.html#for-usage-from-c
+----------------------------------------+-----------------------------------------------+----------------+
| Option | Description | Default |
+========================================+===============================================+================+
| CMAKE_BUILD_TYPE | Type of build: debug or release | release |
+----------------------------------------+-----------------------------------------------+----------------+
| CMAKE_INSTALL_PREFIX | Prefix in which the library will be installed | ``/usr/local`` |
+----------------------------------------+-----------------------------------------------+----------------+
| CMAKE_PREFIX_PATH | ``;``-separated list of path where CMake will | |
| | search for dependencies. | |
+----------------------------------------+-----------------------------------------------+----------------+
| RASCALINE_TORCH_FETCH_METATENSOR_TORCH | Should CMake automatically download and | OFF |
| | install metatensor-torch? | |
+----------------------------------------+-----------------------------------------------+----------------+

.. _C++ interface of metatensor: https://lab-cosmo.github.io/metatensor/latest/get-started/installation.html#installing-the-c-and-c-library
.. _TorchScript interface of metatensor: https://lab-cosmo.github.io/metatensor/latest/get-started/installation.html#for-usage-from-c
4 changes: 2 additions & 2 deletions docs/src/get-started/rascaline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ There exist several libraries able to compute such structural representations,
such as `DScribe`_, `QUIP`_, and many more. Rascaline tries to distinguish
itself by focussing on speed and memory efficiency of the calculations, with the
explicit goal of running molecular simulations with ML potentials. In
particular, memory efficiency is achieved by using the `equistore`_ to store the
particular, memory efficiency is achieved by using the `metatensor`_ to store the
structural representation. Additionally, rascaline is not limited to a single
representation but supports several:

Expand All @@ -21,4 +21,4 @@ representation but supports several:

.. _DScribe: https://singroup.github.io/dscribe/
.. _QUIP: https://www.libatoms.org
.. _equistore: https://lab-cosmo.github.io/equistore/
.. _metatensor: https://lab-cosmo.github.io/metatensor/
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
]

dependencies = [
"equistore-core @ https://github.com/lab-cosmo/equistore/archive/ee5ab99.zip#subdirectory=python/equistore-core",
"metatensor-core @ https://github.com/lab-cosmo/metatensor/archive/32ad5bb.zip#subdirectory=python/metatensor-core",
]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion python/rascaline-torch/build-backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# we are building from a git checkout

# add a random uuid to the file url to prevent pip from using a cached
# wheel for equistore-core, and force it to re-build from scratch
# wheel for metatensor-core, and force it to re-build from scratch
uuid = uuid.uuid4()
RASCALINE_DEP = f"rascaline @ file://{RASCALINE}?{uuid}"
else:
Expand Down
2 changes: 1 addition & 1 deletion python/rascaline-torch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ requires = [
"wheel >=0.38",
"cmake",
"torch >= 1.11",
"equistore-torch @ https://github.com/lab-cosmo/equistore/archive/ee5ab99.zip#subdirectory=python/equistore-torch",
"metatensor-torch @ https://github.com/lab-cosmo/metatensor/archive/32ad5bb.zip#subdirectory=python/metatensor-torch",
]

# use a custom build backend to add a dependency on the right version of rascaline
Expand Down
6 changes: 3 additions & 3 deletions python/rascaline-torch/rascaline/torch/_c_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from collections import namedtuple

import equistore.torch
import metatensor.torch
import torch

import rascaline
Expand Down Expand Up @@ -107,9 +107,9 @@ def _check_dll(path):


def _load_library():
# Load rascaline & equistore-torch shared library in the process first, to ensure
# Load rascaline & metatensor-torch shared library in the process first, to ensure
# the rascaline_torch shared library can find them
equistore.torch._c_lib._load_library()
metatensor.torch._c_lib._load_library()

rascaline._c_lib._get_library()

Expand Down
14 changes: 7 additions & 7 deletions python/rascaline-torch/rascaline/torch/calculator_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Optional, Union

import equistore.torch
import metatensor.torch
import torch

from .system import System
Expand All @@ -11,13 +11,13 @@

def register_autograd(
systems: Union[List[System], System],
precomputed: equistore.torch.TensorMap,
precomputed: metatensor.torch.TensorMap,
forward_gradients: Optional[List[str]] = None,
) -> equistore.torch.TensorMap:
) -> metatensor.torch.TensorMap:
"""
Register autograd nodes between ``system.positions`` and ``system.cell`` for each of
the systems and the values in the ``precomputed``
:py:class:`equistore.torch.TensorMap`.
:py:class:`metatensor.torch.TensorMap`.
This is an advanced function must users should not need to use.
Expand All @@ -27,7 +27,7 @@ def register_autograd(
system's cell ``requires_grad``, ``precomputed`` must contain ``"cell"`` gradients.
:param systems: list of system used to compute ``precomputed``
:param precomputed: precomputed :py:class:`equistore.torch.TensorMap`
:param precomputed: precomputed :py:class:`metatensor.torch.TensorMap`
:param forward_gradients: which gradients to keep in the output, defaults to None
"""
if forward_gradients is None:
Expand Down Expand Up @@ -87,7 +87,7 @@ def compute(
systems: Union[System, List[System]],
gradients: Optional[List[str]] = None,
use_native_system: bool = True,
) -> equistore.torch.TensorMap:
) -> metatensor.torch.TensorMap:
"""Runs a calculation with this calculator on the given ``systems``.
.. seealso::
Expand Down Expand Up @@ -127,7 +127,7 @@ def forward(
systems: List[System],
gradients: Optional[List[str]] = None,
use_native_system: bool = True,
) -> equistore.torch.TensorMap:
) -> metatensor.torch.TensorMap:
"""forward just calls :py:meth:`CalculatorModule.compute`"""

return self.compute(
Expand Down
4 changes: 2 additions & 2 deletions python/rascaline-torch/rascaline/torch/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import equistore.torch
import metatensor.torch

import rascaline

Expand All @@ -13,7 +13,7 @@
[
_rascaline_torch_cmake_prefix,
rascaline.utils.cmake_prefix_path,
equistore.torch.utils.cmake_prefix_path,
metatensor.torch.utils.cmake_prefix_path,
]
)
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import List, Optional, Union

import torch
from equistore.torch import Labels, TensorBlock, TensorMap
from metatensor.torch import Labels, TensorBlock, TensorMap

import rascaline.utils.power_spectrum

Expand All @@ -20,7 +20,7 @@
)
module = importlib.util.module_from_spec(spec)
# This module only exposes a handful of things, defined here. Any changes here MUST also
# be made to the `equistore/operations/_classes.py` file, which is used in non
# be made to the `metatensor/operations/_classes.py` file, which is used in non
# TorchScript mode.
module.__dict__["Labels"] = Labels
module.__dict__["TensorBlock"] = TensorBlock
Expand Down
8 changes: 4 additions & 4 deletions python/rascaline-torch/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

RASCALINE_TORCH = os.path.join(ROOT, "..", "..", "rascaline-torch")
if not os.path.exists(RASCALINE_TORCH):
# we are building from a sdist, which should include equistore-torch
# we are building from a sdist, which should include metatensor-torch
# sources as a tarball
cxx_sources = os.path.join(ROOT, "rascaline-torch.tar.gz")

Expand All @@ -38,7 +38,7 @@ class cmake_ext(build_ext):
"""Build the native library using cmake"""

def run(self):
import equistore.torch
import metatensor.torch
import torch

import rascaline
Expand All @@ -52,7 +52,7 @@ def run(self):
# Tell CMake where to find rascaline & torch
cmake_prefix_path = [
rascaline.utils.cmake_prefix_path,
equistore.torch.utils.cmake_prefix_path,
metatensor.torch.utils.cmake_prefix_path,
torch.utils.cmake_prefix_path,
]

Expand Down Expand Up @@ -140,7 +140,7 @@ def run(self):
sys.exit(
"Aborting implicit building of eggs. "
+ "Use `pip install .` or `python setup.py bdist_wheel && pip "
+ "install dist/equistore-*.whl` to install from source."
+ "install dist/metatensor-*.whl` to install from source."
)


Expand Down
2 changes: 1 addition & 1 deletion python/rascaline/examples/compute-soap.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

# %%
#
# The descriptor is an equistore ``TensorMap``, containing multiple blocks. We
# The descriptor is a metatensor ``TensorMap``, containing multiple blocks. We
# can transform it to a single block containing a dense representation, with one
# sample for each atom-centered environment by using ``keys_to_samples`` and
# ``keys_to_properties``
Expand Down
Loading

0 comments on commit 4a7ed7e

Please sign in to comment.