Skip to content

Commit fc67519

Browse files
committed
Add docs, examples and refactor scripts examples
1 parent 87bb686 commit fc67519

File tree

14 files changed

+147
-5
lines changed

14 files changed

+147
-5
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ or when installing from source:
2424
git clone https://github.com/bastonero/aiida-vibrosopy
2525
pip install .
2626

27+
## Command line interface tool
28+
The plugin comes with a builtin CLI tool: `aiida-vibroscopy`.
29+
For example, the following command should print:
30+
31+
```console
32+
> aiida-vibroscopy launch --help
33+
Usage: aiida-vibroscopy launch [OPTIONS] COMMAND [ARGS]...
34+
35+
Launch workflows.
36+
37+
Options:
38+
-v, --verbosity [notset|debug|info|report|warning|error|critical]
39+
Set the verbosity of the output.
40+
-h, --help Show this message and exit.
41+
42+
Commands:
43+
dielectric Run an `DielectricWorkChain`.
44+
harmonic Run a `HarmonicWorkChain`.
45+
iraman-spectra Run an `IRamanSpectraWorkChain`.
46+
phonon Run an `PhononWorkChain`.
47+
```
48+
2749
## How to cite
2850

2951
If you use this plugin for your research, please cite the following works:

docs/source/commands.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(commands)=
2+
3+
# Commands (CLI)
4+
5+
```{eval-rst}
6+
.. click:: aiida_vibroscopy.cli:cmd_root
7+
:prog: aiida-vibroscopy
8+
:show-nested:
9+
```

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
'sphinx.ext.intersphinx',
5050
'sphinx.ext.viewcode',
5151
'sphinx_copybutton',
52+
'sphinx_click.ext',
5253
'sphinx_togglebutton',
5354
'sphinx_design',
5455
'aiida.sphinxext',

docs/source/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ myst:
1414
1515
installation/index
1616
tutorials/index
17+
commands
1718
```
1819

1920
```{toctree}
@@ -38,7 +39,7 @@ topics/conventions
3839
:hidden: true
3940
:caption: Reference
4041
41-
reference/index
42+
reference/api/index
4243
```
4344

4445
# AiiDA Vibroscopy
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(reference)=
1+
(reference-api)=
22

33
# Python API
44

@@ -7,5 +7,5 @@ If you only want to get to know the input nested structure of the workflows, ple
77
```{toctree}
88
:maxdepth: 4
99
10-
api/aiida_vibroscopy/index
10+
aiida_vibroscopy/index
1111
```
File renamed without changes.

examples/commands/README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# General information
2+
3+
You need to install first a pseudpotential library via `aiida-pseudo` (see examples/README.md).
4+
5+
You can run workflows using the command `aiida-vibroscopy launch WORKFLOW_NAME`.
6+
7+
To know the available implemented workflows that can be used via CLI:
8+
9+
```console
10+
> aiida-vibroscopy launch --help
11+
Usage: aiida-vibroscopy launch [OPTIONS] COMMAND [ARGS]...
12+
13+
Launch workflows.
14+
15+
Options:
16+
-v, --verbosity [notset|debug|info|report|warning|error|critical]
17+
Set the verbosity of the output.
18+
-h, --help Show this message and exit.
19+
20+
Commands:
21+
dielectric Run an `DielectricWorkChain`.
22+
harmonic Run a `HarmonicWorkChain`.
23+
iraman-spectra Run an `IRamanSpectraWorkChain`.
24+
phonon Run an `PhononWorkChain`.
25+
```
26+
27+
For furhter information, for instance:
28+
29+
```console
30+
> aiida-vibroscopy launch dielectric --help
31+
Usage: aiida-vibroscopy launch dielectric [OPTIONS]
32+
33+
Run an `DielectricWorkChain`.
34+
35+
It computes dielectric, Born charges, Raman and non-linear optical
36+
susceptibility tensors for a given structure.
37+
38+
Options:
39+
--pw CODE The code to use for the pw.x executable.
40+
[required]
41+
-S, --structure DATA A StructureData node identified by its ID or
42+
UUID.
43+
-p, --protocol [fast|moderate|precise]
44+
Select the protocol that defines the
45+
accuracy of the calculation. [default:
46+
moderate]
47+
-F, --pseudo-family GROUP Select a pseudopotential family, identified
48+
by its label.
49+
-k, --kpoints-mesh <INTEGER INTEGER INTEGER FLOAT FLOAT FLOAT>...
50+
The number of points in the kpoint mesh
51+
along each basis vector and the offset.
52+
Example: `-k 2 2 2 0 0 0`. Specify `0.5 0.5
53+
0.5` for the offset if you want to result in
54+
the equivalent Quantum ESPRESSO pw.x `1 1 1`
55+
shift.
56+
-o, --overrides FILENAME The filename or filepath containing the
57+
overrides, in YAML format.
58+
-D, --daemon Submit the process to the daemon instead of
59+
running it and waiting for it to finish.
60+
[default: True]
61+
-v, --verbosity [notset|debug|info|report|warning|error|critical]
62+
Set the verbosity of the output.
63+
-h, --help Show this message and exit.
64+
```
65+
66+
## Example
67+
68+
```console
69+
> aiida-vibroscopy launch dielectric \
70+
--pw pw@localhost \ # change here with your installed code
71+
-S 12345 \ # replace with you StructureData
72+
--protocol moderate \ # (optional) choose between fast, moderate, precise
73+
--pseudo-family SSSP/1.3/PBEsol/efficiency \ # (optional) change with your favorite
74+
--kpoints-mesh 4 4 4 \ # (optional) it overrides the overrides, in particular removes kpoints_distance and kpoints_parallel_distance
75+
--overrides overrides.yaml \ # (optional) filepath to overrides
76+
--deamon True # (optional) submit to deamon
77+
```

examples/commands/overrides.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
clean_workdir: false
2+
kpoints_parallel_distance: 0.2 # kpoints distance in Angstrom^-1 to sample the BZ parallel to the electric field. If used, it should help in converging faster the final results
3+
property: raman
4+
# central_difference: # if you know what you are doing, custom numerical derivatives with respect to electric field
5+
# accuracy: 2
6+
# electric_field_step: 0.0005
7+
scf:
8+
kpoints_distance: 0.4 # kpoints distance in Angstrom^-1 to sample the BZ
9+
kpoints_force_parity: false
10+
max_iterations: 5
11+
pw:
12+
settings:
13+
cmdline: ['-nd','1']
14+
metadata:
15+
options:
16+
max_wallclock_seconds: 43200
17+
resources:
18+
num_machines: 1
19+
num_mpiprocs_per_machine: 1
20+
# queue_name: partition_name # for SLURM
21+
# account: account_name # for SLURM, also for project etc
22+
withmpi: true
23+
parameters:
24+
ELECTRONS:
25+
conv_thr: 2.0e-12
26+
electron_maxstep: 80
27+
mixing_beta: 0.4
28+
SYSTEM:
29+
ecutrho: 240.0
30+
ecutwfc: 30.0
31+
settings:
32+
sleep_submission_time: 1.0
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)