-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ded5c0d
commit e1b2b9b
Showing
15 changed files
with
123 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,80 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
import os | ||
import re | ||
import sys | ||
from datetime import datetime | ||
|
||
import tomli # Replace by tomllib from std library once docs are build with Python 3.11 | ||
|
||
import metatensor_models | ||
|
||
|
||
ROOT = os.path.abspath(os.path.join("..", "..")) | ||
sys.path.insert(0, ROOT) | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'metatensor-models' | ||
copyright = '2023, metatensor-models developers' | ||
author = 'metatensor-models developers' | ||
# The master toctree document. | ||
master_doc = "index" | ||
|
||
# Parse the version from the module. | ||
with open(os.path.join(os.path.dirname(__file__), '..', '..', 'src', 'metatensor_models', '__init__.py')) as f: | ||
version = re.match(r".*__version__ = \"(.*?)\"", f.read(), re.S).group(1) | ||
release = version | ||
with open(os.path.join(ROOT, "pyproject.toml"), "rb") as fp: | ||
project_dict = tomli.load(fp)["project"] | ||
|
||
project = project_dict["name"] | ||
author = ", ".join(a["name"] for a in project_dict["authors"]) | ||
|
||
# -- General configuration --------------------------------------------------- | ||
copyright = f"{datetime.now().date().year}, {author}" | ||
|
||
needs_sphinx = "4.0.0" | ||
# The full version, including alpha/beta/rc tags | ||
release = metatensor_models.__version__ | ||
|
||
python_use_unqualified_type_names = True | ||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
'sphinx_rtd_dark_mode', | ||
"sphinx.ext.viewcode", | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.intersphinx", | ||
"sphinx_toggleprompt", | ||
] | ||
|
||
default_dark_mode = True | ||
python_use_unqualified_type_names = True | ||
|
||
autoclass_content = "both" | ||
autodoc_member_order = "bysource" | ||
autodoc_typehints = "both" | ||
autodoc_typehints_format = "short" | ||
|
||
intersphinx_mapping = { | ||
"ase": ("https://wiki.fysik.dtu.dk/ase/", None), | ||
"python": ("https://docs.python.org/3", None), | ||
"torch": ("https://pytorch.org/docs/stable/", None), | ||
"metatensor": ("https://lab-cosmo.github.io/metatensor/latest/", None), | ||
"rascaline": ("https://luthaf.fr/rascaline/latest/", None), | ||
} | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'alabaster' | ||
html_static_path = ['_static'] | ||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = "furo" | ||
|
||
html_theme_options = { | ||
"footer_icons": [ | ||
{ | ||
"name": "GitHub", | ||
"url": "https://github.com/ceriottm/MeshLODE", | ||
"html": "", | ||
"class": "fa-brands fa-github fa-2x", | ||
}, | ||
], | ||
} | ||
|
||
# font-awesome logos (used in the footer) | ||
html_css_files = [ | ||
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css", | ||
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/solid.min.css", | ||
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/brands.min.css", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Dataset | ||
####### | ||
|
||
.. automodule:: metatensor_models.utils.data.dataset | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Utilitliy API | ||
============= | ||
|
||
This is the API for the ``utils`` module of ``metatensor-models``. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
dataset | ||
readers/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Structure and Target data Readers | ||
================================= | ||
|
||
The main entry point for reading structure and target information are the two reader | ||
functions | ||
|
||
.. automodule:: metatensor_models.utils.data.readers | ||
:members: | ||
|
||
Based on the provided filename they chose which child reader they use. For details on | ||
these refer to their documentation | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
structure | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Structure Readers | ||
################# | ||
|
||
Parsers for obtaining information from structures. All readers return a :py:class:`list` | ||
of :py:class:`rascaline.torch.system.System`. The mapping which reader is used for which | ||
file type is stored in | ||
|
||
.. autodata:: metatensor_models.utils.data.readers.structures.STRUCTURE_READERS | ||
|
||
Implemented Readers | ||
------------------- | ||
|
||
.. autofunction:: metatensor_models.utils.data.readers.structures.read_ase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Target data Readers | ||
################### | ||
|
||
Parsers for obtaining information from structures. All readers return a of | ||
:py:class:`metatensor.torch.TensorMap`. The mapping which reader is used for which file | ||
type is stored in | ||
|
||
.. autodata:: metatensor_models.utils.data.readers.targets.TARGET_READERS | ||
|
||
Implemented Readers | ||
------------------- | ||
|
||
.. autofunction:: metatensor_models.utils.data.readers.targets.read_ase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/metatensor_models/utils/data/readers/structures/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .ase import read_ase | ||
|
||
STRUCTURE_READERS = {".xyz": read_ase} | ||
""":py:class:`dict`: dictionary mapping file suffixes to a structure reader""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .ase import read_ase | ||
|
||
TARGET_READERS = {".xyz": read_ase} | ||
""":py:class:`dict`: dictionary mapping file suffixes to a target structure reader""" |