Skip to content

Commit 1f58fd8

Browse files
Update documentation (#223)
1 parent a4e85f3 commit 1f58fd8

File tree

11 files changed

+397
-85
lines changed

11 files changed

+397
-85
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ See the [developer guide](https://stfc.github.io/aiida-mlip/developer_guide/inde
122122
Contributors to this project were funded by
123123

124124
[![PSDI](https://raw.githubusercontent.com/stfc/aiida-mlip/main/docs/source/images/psdi-100.webp)](https://www.psdi.ac.uk/)
125-
[![ALC](https://raw.githubusercontent.com/stfc/aiida-mlip/main/docs/source/images/alc-100.webp)](https://adalovelacecentre.ac.uk/)
125+
[<img src="docs/source/images/alc.svg" width="200" height="100" />](https://adalovelacecentre.ac.uk/)
126126
[![CoSeC](https://raw.githubusercontent.com/stfc/aiida-mlip/main/docs/source/images/cosec-100.webp)](https://www.scd.stfc.ac.uk/Pages/CoSeC.aspx)
127127

128128

docs/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
intersphinx_mapping = {
5454
"python": ("https://docs.python.org/3", None),
5555
"aiida": ("https://aiida.readthedocs.io/projects/aiida-core/en/latest", None),
56-
"ase": ("https://wiki.fysik.dtu.dk/ase/", None),
56+
"ase": ("https://ase-lib.org", None),
5757
}
5858

5959
# Add any paths that contain templates here, relative to this directory.
@@ -200,6 +200,7 @@
200200
("py:class", "Logger"),
201201
("py:class", "QbFields"),
202202
("py:class", "aiida_workgraph.workgraph.WorkGraph"),
203+
("py:class", "AiidaLoggerType"),
203204
]
204205

205206

docs/source/images/alc-100.webp

-4.22 KB
Binary file not shown.

docs/source/images/alc.svg

Lines changed: 315 additions & 0 deletions
Loading

docs/source/index.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
The aiida-mlip plugin for `AiiDA`_
2-
=====================================================
2+
==================================
33

4-
``aiida-mlip`` is available at http://github.com/aiidateam/aiida-mlip
4+
``aiida-mlip`` is available at http://github.com/stfc/aiida-mlip
55

66
.. image:: images/aiida-mlip.png
77
:height: 298px
8-
:target: http://github.com/aiidateam/aiida-mlip
8+
:target: http://github.com/stfc/aiida-mlip
99

1010

1111
.. toctree::
@@ -16,10 +16,6 @@ The aiida-mlip plugin for `AiiDA`_
1616
API documentation <apidoc/aiida_mlip>
1717
AiiDA Documentation <https://aiida.readthedocs.io>
1818

19-
If you use this plugin for your research, please cite the following work:
20-
21-
.. highlights:: Author Name1, Author Name2, *Paper title*, Jornal Name XXX, YYYY (Year).
22-
2319
If you use AiiDA for your research, please cite the following work:
2420

2521
.. highlights:: Giovanni Pizzi, Andrea Cepellotti, Riccardo Sabatini, Nicola Marzari,
@@ -38,7 +34,7 @@ Contributors to ``aiida-mlip`` were supported by
3834
:height: 100px
3935
:target: https://www.psdi.ac.uk/
4036

41-
.. image:: images/alc-100.webp
37+
.. image:: images/alc.svg
4238
:height: 100px
4339
:target: https://adalovelacecentre.ac.uk/
4440

docs/source/user_guide/calculations.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
==============================
1+
============
22
Calculations
3-
==============================
3+
============
44

5-
In these examples, we will assume that the `janus-core <https://github.com/stfc/janus-core>`_ package is installed and saved in the AiiDA database as an `InstalledCode` instance named 'janus@localhost'.
5+
In these examples, we will assume that the `janus-core <https://github.com/stfc/janus-core>`_ package is installed and saved in the AiiDA database as an ``InstalledCode`` instance named 'janus@localhost'.
66

7-
The structure should be a path to a file. Here, the structure file is specified as `path/to/structure`.
7+
The structure should be a path to a file. Here, the structure file is specified as ``path/to/structure``.
88

99
.. note::
10-
Any format that `ASE <https://wiki.fysik.dtu.dk/ase/>`_ can read is a valid structure file for a calculation.
10+
Any format that `ASE <https://ase-lib.org>`_ can read is a valid structure file for a calculation.
1111

12-
The model file determines the specific MLIP to be used. It can be a local file or a URI to a file to download. In these examples, it is assumed to be a local file located at `path/to/model`.
12+
The model file determines the specific MLIP to be used. It can be a local file or a URI to a file to download. In these examples, it is assumed to be a local file located at ``path/to/model``.
1313

1414

1515
SinglePoint Calculation
1616
-----------------------
1717

18-
A `Singlepoint` Calculation represents a `Calcjob` object within the AiiDA framework.
18+
A ``Singlepoint`` Calculation represents a ``Calcjob`` object within the AiiDA framework.
1919

2020

2121
Usage
2222
^^^^^
2323

24-
This calculation can be executed using either the `run` or `submit` AiiDA commands.
24+
This calculation can be executed using either the ``run`` or ``submit`` AiiDA commands.
2525
Below is a usage example with the minimum required parameters. These parameters must be AiiDA data types.
2626

2727

@@ -86,7 +86,7 @@ And it is used as shown below. Note that some parameters, which are specific to
8686
)
8787
8888
If a parameter is defined twice, in the config file and manually, the manually defined one will overwrite the config one.
89-
If for example the same config file as before is used, but this time the parameter "struct" is added to the launch function, the code would look like this:
89+
If for example the same config file as before is used, but this time the parameter ``struct`` is added to the launch function, the code would look like this:
9090

9191
.. code-block:: python
9292
@@ -99,11 +99,11 @@ If for example the same config file as before is used, but this time the paramet
9999
config=config,
100100
)
101101
102-
In this case the structure used is going to be "path/to/structure2.xyz" rather than ""path/to/structure.cif", which was defined in the config file.
102+
In this case the structure used is going to be ``path/to/structure2.xyz`` rather than ``path/to/structure.cif``, which was defined in the config file.
103103

104104
Refer to the API documentation for additional parameters that can be passed.
105-
Some parameters are not required and don't have a default value set in aiida-mlip. In that case the default values will be the same as `janus <https://stfc.github.io/janus-core/>`_
106-
The only default parameters defined in aiida-mlip are the names of the input and output files, as they do not affect the results of the calculation itself, and are needed in AiiDA to parse the results.
105+
Some parameters are not required and don't have a default value set in ``aiida-mlip``. In that case the default values will be the same as `janus-core <https://github.com/stfc/janus-core>`_
106+
The only default parameters defined in ``aiida-mlip`` are the names of the input and output files, as they do not affect the results of the calculation itself, and are needed in AiiDA to parse the results.
107107

108108

109109
Submission
@@ -112,29 +112,29 @@ Submission
112112
To facilitate the submission process and prepare inputs as AiiDA data types, example scripts are provided.
113113
The submit_singlepoint.py script can be used as is, submitted to verdi, and the parameters passed as strings to the CLI.
114114
They will be converted to AiiDA data types by the script itself.
115-
.. note::
116115

116+
.. note::
117117

118118
The example files are set up with default values, ensuring that calculations runs even if no input is provided via the cli.
119-
However, the aiida-mlip code itself does require certain parameters, (e.g. the structure on which to perform the calculation).
119+
However, the ``aiida-mlip`` code itself does require certain parameters, (e.g. the structure on which to perform the calculation).
120120

121121

122122
.. code-block:: python
123123
124124
verdi run submit_singlepoint.py "janus@localhost" --structure "path/to/structure" --model "path/to/model" --device "cpu"
125125
126-
The submit_using_config.py script can be used to facilitate submission using a config file.
126+
The ``submit_using_config.py`` script can be used to facilitate submission using a config file.
127127

128128
Geometry Optimisation calculation
129129
---------------------------------
130130

131-
A `GeomOpt` Calculation represents a `Calcjob` object within the AiiDA framework.
131+
A ``GeomOpt`` Calculation represents a ``Calcjob`` object within the AiiDA framework.
132132

133133

134134
Usage
135135
^^^^^
136136

137-
This calculation can be executed using either the `run` or `submit` AiiDA commands.
137+
This calculation can be executed using either the ``run`` or ``submit`` AiiDA commands.
138138
Below is a usage example with some additional geometry optimisation parameters. These parameters must be AiiDA data types.
139139

140140

@@ -165,13 +165,13 @@ They will be converted to AiiDA data types by the script itself.
165165
Molecular Dynamics calculation
166166
------------------------------
167167

168-
An `MD` Calculation represents a `Calcjob` object within the AiiDA framework.
168+
An ``MD`` Calculation represents a ``Calcjob`` object within the AiiDA framework.
169169

170170

171171
Usage
172172
^^^^^
173173

174-
This calculation can be executed using either the `run` or `submit` AiiDA commands.
174+
This calculation can be executed using either the ``run`` or ``submit`` AiiDA commands.
175175
Below is a usage example with some additional geometry optimisation parameters. These parameters must be AiiDA data types.
176176

177177

docs/source/user_guide/data.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,88 +4,88 @@ Data types
44

55
ModelData
66
---------
7-
Defines a custom data type called `ModelData` in AiiDA, which is a subclass of the `SinglefileData` type. `ModelData` is used to handle model files and provides functionalities for handling local files and downloading files from URIs.
8-
Additional features compared to `SinglefileData`:
7+
Defines a custom data type called ``ModelData`` in AiiDA, which is a subclass of the ``SinglefileData`` type. ``ModelData`` is used to handle model files and provides functionalities for handling local files and downloading files from URIs.
8+
Additional features compared to ``SinglefileData``:
99

1010
- It can take a relative path as an argument
1111

12-
- It takes the argument "architecture" which is specifically related to the mlip model and it is added to the node attributes.
12+
- It takes the argument ``architecture`` which is specifically related to the MLIP model and it is added to the node attributes.
1313

1414
- Download functionality:
15-
- When provided with a URI, `ModelData` automatically downloads the file.
16-
- Saves the downloaded file in a specified folder (default: `./cache/mlips`), creating a subfolder if the architecture, and stores it as an AiiDA data type.
17-
- Handles duplicate files: if the file is downloaded twice, duplicates within the same folder are canceled, unless `force_download=True` is stated.
15+
- When provided with a URI, ``ModelData`` automatically downloads the file.
16+
- Saves the downloaded file in a specified folder (default: ``./cache/mlips``), creating a subfolder if the architecture, and stores it as an AiiDA data type.
17+
- Handles duplicate files: if the file is downloaded twice, duplicates within the same folder are canceled, unless ``force_download=True`` is stated.
1818

1919
Usage
2020
^^^^^
2121

22-
- To create a `ModelData` object from a local file:
22+
- To create a ``ModelData`` object from a local file:
2323

2424
.. code-block:: python
2525
2626
model = ModelData.from_local('/path/to/file', filename='model', architecture='mace')
2727
28-
- To download a file and save it as a `ModelData` object:
28+
- To download a file and save it as a ``ModelData`` object:
2929

3030
.. code-block:: python
3131
3232
model = ModelData.from_uri('http://yoururl.test/model', architecture='mace', filename='model', cache_dir='/home/mlip/', force_download=False)
3333
34-
- The architecture of the model file can be accessed using the `architecture` property:
34+
- The architecture of the model file can be accessed using the ``architecture`` property:
3535

3636
.. code-block:: python
3737
3838
model_arch = model.architecture
3939
40-
As for a `SinglefileData`, the content of the model file can be accessed using the function `get_content()`
40+
As for a ``SinglefileData``, the content of the model file can be accessed using the function ``get_content()``
4141

4242

4343
JanusConfigfile
4444
---------------
4545

46-
The `JanusConfigfile` class is designed to handle config files written for janus-core in YAML format within the AiiDA framework.
47-
This class inherits from `SinglefileData` in the AiiDA, and extends it to support YAML config files.
46+
The ``JanusConfigfile`` class is designed to handle config files written for ``janus-core`` in YAML format within the AiiDA framework.
47+
This class inherits from ``SinglefileData`` in the AiiDA, and extends it to support YAML config files.
4848
It provides methods for reading, storing, and accessing the content of the config file.
4949

5050
Usage
5151
^^^^^
5252

53-
- To create a `JanusConfigfile` object:
53+
- To create a ``JanusConfigfile`` object:
5454

5555
.. code-block:: python
5656
5757
config_file = JanusConfigfile('/path/to/config.yml')
5858
5959
60-
- To read the content of the config file as a dictionary, you can use the `read_yaml()` method:
60+
- To read the content of the config file as a dictionary, you can use the ``read_yaml()`` method:
6161

6262
.. code-block:: python
6363
6464
config_dict = config_file.read_yaml()
6565
6666
67-
- To store the content of the config file in the AiiDA database, you can use the `store_content()` method:
67+
- To store the content of the config file in the AiiDA database, you can use the ``store_content()`` method:
6868

6969
.. code-block:: python
7070
7171
config_file.store_content(store_all=False, skip=[])
7272
73-
The `store_content()` method accepts the following parameters:
73+
The ``store_content()`` method accepts the following parameters:
7474

75-
- `store_all` (bool):
75+
- ``store_all`` (bool):
7676
Determines whether to store all parameters or only specific ones.
77-
By default, it's set to `False`.
78-
When set to `False`, only the key parameters relevant for the provenance graph are stored: `code`, `structure`, `model`, `architecture`, `opt_cell_fully` (for GeomOpt), and `ensemble` (for MD).
77+
By default, it's set to ``False``.
78+
When set to ``False``, only the key parameters relevant for the provenance graph are stored: ``code``, ``structure``, ``model``, ``architecture``, ``opt_cell_fully`` (for GeomOpt), and ``ensemble`` (for MD).
7979
However, all inputs can be accessed in the config file at any time (just the config file will appear in the provenance graph as JanusConfigfile).
80-
If `store_all` is set to `True`, all inputs are stored, either as specific data types (e.g. the input 'struct' is recognised as a StructureData type) or as Str.
80+
If ``store_all`` is set to ``True``, all inputs are stored, either as specific data types (e.g. the input 'struct' is recognised as a StructureData type) or as Str.
8181

82-
- `skip` (list):
82+
- ``skip`` (list):
8383
Specifies a list of parameters that should not be stored.
8484
In the source code of the calcjobs, when the same parameter is provided both as an AiiDA input and within the config file, the parameter from the config file is ignored and not stored.
85-
These parameters are added to the `skip` list to ensure they are excluded from storage.
85+
These parameters are added to the ``skip`` list to ensure they are excluded from storage.
8686

8787

88-
- The filepath of the config file can be accessed using the `filepath` property:
88+
- The filepath of the config file can be accessed using the ``filepath`` property:
8989

9090
.. code-block:: python
9191
@@ -99,7 +99,7 @@ The `store_content()` method accepts the following parameters:
9999
A more robust solution to this problem is going to be implemented.
100100

101101

102-
- The content of the config file can be accessed as a dictionary using the `as_dictionary` property:
102+
- The content of the config file can be accessed as a dictionary using the ``as_dictionary`` property:
103103

104104
.. code-block:: python
105105

docs/source/user_guide/get_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Once ``aiida-mlip`` and the desired MLIP calculators are installed, run::
4141
verdi plugin list aiida.calculations # should now show your calculation plugins
4242

4343
Then, use ``verdi code setup`` with the ``janus`` input plugin
44-
to set up an AiiDA code for aiida-mlip. The `aiida docs <https://aiida.readthedocs.io/projects/aiida-core/en/stable/howto/run_codes.html#how-to-create-a-code>`_ go over how to create a code.
44+
to set up an AiiDA code for ``aiida-mlip``. The `aiida docs <https://aiida.readthedocs.io/projects/aiida-core/en/stable/howto/run_codes.html#how-to-create-a-code>`_ go over how to create a code.
4545

4646

4747

docs/source/user_guide/training.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Training machine learning models
33
================================
44

5-
The `Train` class represents a `CalcJob` object within the AiiDA framework, designed for training machine learning models.
5+
The ``Train`` class represents a ``CalcJob`` object within the AiiDA framework, designed for training machine learning models.
66

77
Usage
88
^^^^^
99

10-
This calculation can be executed using either the `run` or `submit` AiiDA commands.
10+
This calculation can be executed using either the ``run`` or ``submit`` AiiDA commands.
1111
Below is a usage example with some additional training parameters. These parameters must be AiiDA data types.
1212

1313
.. code-block:: python
@@ -76,7 +76,7 @@ while the other parameters are optional. Here is an example (can be found in the
7676
keep_isolated_atoms: True
7777
save_cpu: True
7878
79-
It is also possible to fine-tune models using the same type of `Calcjob`.
79+
It is also possible to fine-tune models using the same type of ``Calcjob``.
8080
In that case some additional parameters must be used: foundation_model and fine_tune.
8181

8282

@@ -93,8 +93,8 @@ In that case some additional parameters must be used: foundation_model and fine_
9393
TrainCalculation = CalculationFactory("mlip.train")
9494
submit(TrainCalculation,inputs)
9595
96-
A model to fine-tune has to be provided as an input, either as a `ModelData` type (in which case it has to be a model file), or in the config file at the keyword `foundation_model`.
97-
If the keyword `fine_tune` is True but no model is given either way, it will return an error.
96+
A model to fine-tune has to be provided as an input, either as a ``ModelData`` type (in which case it has to be a model file), or in the config file at the keyword ``foundation_model``.
97+
If the keyword ``fine_tune`` is True but no model is given either way, it will return an error.
9898

9999
.. note::
100100

@@ -107,7 +107,7 @@ Submission
107107
^^^^^^^^^^
108108

109109
To facilitate the submission process and prepare inputs as AiiDA data types, an example script is provided.
110-
This script can be used as is or by changing, in the file, the path to the config file, then submitted to `verdi` as shown
110+
This script can be used as is or by changing, in the file, the path to the config file, then submitted to ``verdi`` as shown
111111

112112
.. code-block:: python
113113

0 commit comments

Comments
 (0)