Skip to content

Commit

Permalink
Fixing the documentation before release. Addresses aiidaplugins#77
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Chico committed Nov 24, 2023
1 parent fc2b9f8 commit c44a673
Show file tree
Hide file tree
Showing 17 changed files with 292 additions and 67 deletions.
4 changes: 2 additions & 2 deletions aiida_lammps/data/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Base class for the LAMMPS potentials.
This class allows the storage/recovering of LAMMPS potentials, it allows
one to store any LAMMPS potential as a ``SinglefileData`` object, which can
one to store any LAMMPS potential as a :py:class:`~aiida.orm.nodes.data.singlefile.SinglefileData` object, which can
then be either written to the LAMMPS input script and/or to a file, where
it can be easily read by LAMMPS. This distinction depends on the assigned
``pair_style`` which require different ``pair_coeff`` entries in the input
Expand Down Expand Up @@ -140,7 +140,7 @@ class LammpsPotentialData(orm.SinglefileData):
Base class for the LAMMPS potentials.
This class allows the storage/recovering of LAMMPS potentials, it allows
one to store any LAMMPS potential as a ``SinglefileData`` object, which can
one to store any LAMMPS potential as a :py:class:`~aiida.orm.nodes.data.singlefile.SinglefileData` object, which can
then be either written to the LAMMPS input script and/or to a file, where
it can be easily read by LAMMPS. This distinction depends on the assigned
``pair_style`` which require different ``pair_coeff`` entries in the input
Expand Down
4 changes: 2 additions & 2 deletions aiida_lammps/workflows/relax.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Workflow for the relaxation of a structure using the minimization proceedure in LAMMPS."""
"""Workflow for the relaxation of a structure using the minimization procedure in LAMMPS."""
from itertools import groupby
import os
from typing import Union
Expand Down Expand Up @@ -36,7 +36,7 @@ def define(cls, spec):
default=lambda: orm.Str("cg"),
validator=cls._validate_relaxation_algorithms,
help="""
The algorithm to be used suring relaxation.
The algorithm to be used during relaxation.
""",
)
spec.input(
Expand Down
5 changes: 2 additions & 3 deletions docs/source/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
myst:
substitutions:
README.md of the repository: '`README.md` of the repository'
aiida-core documentation: '`aiida-core` documentation'
aiida_lammps: '`aiida-lammps`'
LAMMPS: '[LAMMPS](https://lammps.org)'
AiiDA: '[AiiDA](https://www.aiida.net/)'
---

```{toctree}
Expand Down Expand Up @@ -38,7 +37,7 @@ reference/api/index

# AiiDA LAMMPS Plugin

{{ aiida_lammps }} is a Python package that allows the workflow management and data provenance tracking framework [AiiDA](http://aiida-core.readthedocs.io/) to run {{ LAMMPS }} calculations.
{{ aiida_lammps }} is a Python package that allows the workflow management and data provenance tracking framework {{ AiiDA }} to run {{ LAMMPS }} calculations.

{{ LAMMPS }} is a classical molecular dynamics (MD) code with a focus on materials modeling, it is used broadly inside the MD community due to its flexibility, and in-built capability to generate complex workflows in its input script.

Expand Down
41 changes: 24 additions & 17 deletions docs/source/topics/calculations/base.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
# `LammpsBaseCalculation`
# ``LammpsBaseCalculation``

The `LammpsBaseCalculation` performs a single stage LAMMPS calculation, the input is generated by a set of parameters passed as a dictionary. The inputs accepted are the following:
The {class}`~aiida_lammps.calculations.base.LammpsBaseCalculation` performs a single stage LAMMPS calculation, the input is generated by a set of parameters passed as a dictionary. The inputs accepted are the following:

## Inputs:

- **structure**, (`StructureData`) - Structure used in the ``LAMMPS`` calculation.
- **potential**, (`LammpsPotentialData`) - Potential used in the ``LAMMPS`` calculation.
- **parameters**, (`Dict`) - Parameters that control the input script generated for the ``LAMMPS`` calculation.
- **settings**, (`Dict`), *optional* - Additional settings that control the ``LAMMPS`` calculation.
- **input_restartfile** (`SinglefileData`), *optional* - Input restartfile to continue from a previous ``LAMMPS`` calculation.
- **parent_folder**, (`RemoteData`), *optional* - An optional working directory of a previously completed calculation to restart from.
- **structure**, ({class}`~aiida.orm.nodes.data.structure.StructureData`) - Structure used in the ``LAMMPS`` calculation.
- **potential**, ({class}`~aiida_lammps.data.potential.LammpsPotentialData`) - Potential used in the ``LAMMPS`` calculation. See [](#topics-data-potential).
- **parameters**, ({class}`~aiida.orm.nodes.data.dict.Dict`) - Parameters that control the input script generated for the ``LAMMPS`` calculation. See [](#topics-data-parameters).
- **settings**, ({class}`~aiida.orm.nodes.data.dict.Dict`), *optional* - Additional settings that control the ``LAMMPS`` calculation.
- **input_restartfile** ({class}`~aiida.orm.nodes.data.singlefile.SinglefileData`), *optional* - Input restart file to continue from a previous ``LAMMPS`` calculation.
- **parent_folder**, ({class}`~aiida.orm.nodes.data.remote.base.RemoteData`), *optional* - An optional working directory of a previously completed calculation to restart from.
- **metadata.options.input_filename**, (`str`), *optional* - Name of the input file for the calculation. Defaults to `input.in`.
- **metadata.options.structure_filename**, (`str`), *optional* - Name of the file where the structure is stored. Defaults to `structure.dat`
- **metadata.options.output_filename**, (`str`). *optional* - Name of the main output file for LAMMPS. Defaults to `lammps.out`.
- **metadata.options.variables_filename**, (`str`), *optional* - Name of the file where the final values of the thermodynamic variables are stored. Defaults to `aiida_lammps.yaml`.
- **metadata.options.trajectory_filename**, (`str`), *optional* - Name of the file where the trajectories are stored. Defaults to `aiida_lammps.trajectory.dump`.
- **metadata.options.restart_filename**, (`str`), *optional* - Name of the restartfile to be written. Defaults to `lammps.restart`.
- **metadata.options.restart_filename**, (`str`), *optional* - Name of the restart file to be written. Defaults to `lammps.restart`.
- **metadata.options.parser_name**, (`str`), *optional* - Name of the parser to be used for this calculation. Defaults to `lammps.base`.

:::{note}
LAMMPS can produce binary restart files which contain all the atomic positions, forces and other computed variables until when the are asked to be printed. One can control this by passing a dictionary called `restart` to the `settings` input. The available options for the `restart` are:
- `print_final`, (`bool`) - whether to print a restart file at the end of the calculation. Defaults to `False`. See [`write_restart`](https://docs.lammps.org/write_restart.html).
- `print intermediate`, (`bool`) - whether to print restart files periodically throughout the calculation. Defaults to `False`. See [`restart`](https://docs.lammps.org/restart.html).
- `num_steps`, (`int`) - how often is the intermediate restart file printed. Defaults to 10% of the total number of steps.
:::

## Outputs:

- **results**, (`Dict`) - The parsed data extracted from the lammps output file.
- **trajectories** (`LammpsTrajectory`) - The data extracted from the lammps trajectory file, includes the atomic trajectories and the site and time dependent calculation parameters.
- **time_dependent_computes**, (`ArrayData`) - The data with the time dependent computes parsed from the lammps.out.
- **restartfile**, (`SinglefileData`), *optional* - The restartfile of a ``LAMMPS`` calculation.
- **structure**, (`StructureData`), *optional* - The output structure of the calculation.
- **remote_folder**, (`RemoteData`) - Folder in the remote machine where the calculation was performed.
- **remote_stash**, (`RemoteStashData`), *optional* – Contents of the stash.source_list option are stored in this remote folder after job completion.
- **retrieved**, (`FolderData`) - Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added, but one can add more by specifying them in `CalcInfo.retrieve_list`.
- **results**, ({class}`~aiida.orm.nodes.data.dict.Dict`) - The parsed data extracted from the lammps output file.
- **trajectories** ({class}`~aiida_lammps.data.trajectory.LammpsTrajectory`) - The data extracted from the lammps trajectory file, includes the atomic trajectories and the site and time dependent calculation parameters.
- **time_dependent_computes**, ({class}`~aiida.orm.nodes.data.array.array.ArrayData`) - The data with the time dependent computes parsed from the lammps.out.
- **restartfile**, ({class}`~aiida.orm.nodes.data.singlefile.SinglefileData`), *optional* - The restart file of a ``LAMMPS`` calculation.
- **structure**, ({class}`~aiida.orm.nodes.data.structure.StructureData`), *optional* - The output structure of the calculation.
- **remote_folder**, ({class}`~aiida.orm.nodes.data.remote.base.RemoteData`) - Folder in the remote machine where the calculation was performed.
- **remote_stash**, ({class}`~aiida.orm.nodes.data.remote.stash.base.RemoteStashData`), *optional* – Contents of the stash.source_list option are stored in this remote folder after job completion.
- **retrieved**, ({class}`~aiida.orm.nodes.data.folder.FolderData`) - Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added, but one can add more by specifying them in `CalcInfo.retrieve_list`.
13 changes: 13 additions & 0 deletions docs/source/topics/calculations/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
---
myst:
substitutions:
aiida_lammps: '`aiida-lammps`'
LAMMPS: '[LAMMPS](https://lammps.org)'
AiiDA: '[AiiDA](https://www.aiida.net/)'
LammpsBaseCalculation: '{class}`~aiida_lammps.calculations.base.LammpsBaseCalculation`'
LammpsRawCalculation: '{class}`~aiida_lammps.calculations.raw.LammpsRawCalculation`'
---


(topics-calculations)=

# Calculations
Expand All @@ -9,3 +20,5 @@ base
raw
```

{{ aiida_lammps }} has two different types of calculations {{ LammpsBaseCalculation }} and {{ LammpsRawCalculation }}. The {{ LammpsBaseCalculation }} generates a {{ LAMMPS }} input script for a single stage calculation from a set of parameters passed as as dictionary to the calculation. However, to give more flexibility for cases not being tractable with a single stage calculation, or that require options not covered by the {{ LammpsBaseCalculation }} the {{ LammpsRawCalculation }} is designed to be able to accept any {{ LAMMPS }} script as an input.
18 changes: 9 additions & 9 deletions docs/source/topics/calculations/raw.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# `LammpsRawCalculation`
# ``LammpsRawCalculation``

The `LammpsRawCalculation` performs a LAMMPS calculation from a given LAMMPS input script and a set of files.
The {class}`~aiida_lammps.calculations.raw.LammpsRawCalculation` performs a LAMMPS calculation from a given LAMMPS input script and a set of files.

## Inputs:

- **script**, (`SinglefileData`) - Complete input script to use. If specified, `structure`, `potential` and `parameters` are ignored.
- **files**, (Namespace of `SinglefileData`), *optional* - Optional files that should be written to the working directory. This is an
- **filenames**, (`Dict`), *optional* - Optional namespace to specify with which filenames the files of ``files`` input should be written.
- **script**, ({class}`~aiida.orm.nodes.data.singlefile.SinglefileData`) - Complete input script to use. If specified, `structure`, `potential` and `parameters` are ignored.
- **files**, (Namespace of {class}`~aiida.orm.nodes.data.singlefile.SinglefileData`), *optional* - Optional files that should be written to the working directory. This is an
- **filenames**, ({class}`~aiida.orm.nodes.data.dict.Dict`), *optional* - Optional namespace to specify with which filenames the files of ``files`` input should be written.
- **metadata.options.input_filename**, (`str`), *optional* - Name of the input file for the calculation. Defaults to `input.in`.
- **metadata.options.output_filename**, (`str`). *optional* - Name of the main output file for LAMMPS. Defaults to `lammps.out`.
- **metadata.options.parser_name**, (`str`), *optional* - Name of the parser to be used for this calculation. Defaults to `lammps.raw`.

## Outputs:

- **results**, (`Dict`) - The parsed data extracted from the lammps output file.
- **remote_folder**, (`RemoteData`) - Folder in the remote machine where the calculation was performed.
- **remote_stash**, (`RemoteStashData`), *optional* – Contents of the stash.source_list option are stored in this remote folder after job completion.
- **retrieved**, (`FolderData`) - Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added, but one can add more by specifying them in `CalcInfo.retrieve_list`.
- **results**, ({class}`~aiida.orm.nodes.data.dict.Dict`) - The parsed data extracted from the lammps output file.
- **remote_folder**, ({class}`~aiida.orm.nodes.data.remote.base.RemoteData`) - Folder in the remote machine where the calculation was performed.
- **remote_stash**, ({class}`~aiida.orm.nodes.data.remote.stash.base.RemoteStashData`), *optional* – Contents of the stash.source_list option are stored in this remote folder after job completion.
- **retrieved**, ({class}`~aiida.orm.nodes.data.folder.FolderData`) - Files that are retrieved by the daemon will be stored in this node. By default the stdout and stderr of the scheduler will be added, but one can add more by specifying them in `CalcInfo.retrieve_list`.
Loading

0 comments on commit c44a673

Please sign in to comment.