Skip to content

Commit a028290

Browse files
authored
📝 DOCS: Updates for compatibility with AiiDA v2.5.1 (#469)
This PR fixes some issues warnings that arose when going through the tutorials with AiiDA v2.5.1, mainly:: - Update the `verdi code setup` to `verdi code create` commands - Update the SSSP version from 1.1 to 1.3 to reflect the change of default in `aiida-pseudo` - Prepend `core` in the `DataFactory` calls where applicable, as well as `query.queryhelp` -> `query.as_dict()` in the `querying` notebook
1 parent 1f14533 commit a028290

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

docs/sections/creating_plugins/example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Interfacing with external codes - Example
44

5-
**Task:** Follow the instructions on [writing a plugin for an external code](<https://aiida.readthedocs.io/projects/aiida-core/en/v2.0.3/howto/plugin_codes.html>).
5+
**Task:** Follow the instructions on [writing a plugin for an external code](<https://aiida.readthedocs.io/projects/aiida-core/en/latest/howto/plugin_codes.html>).
66

77
**Result:** You will write a Python script with your first `CalcJob` and `Parser` plugin, telling AiiDA how to write inputs and parse outputs for a simple external executable.
88

docs/sections/getting_started/basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ For both commands, the *non-interactive* option (`-n`) is added to not prompt fo
415415
Next, let's set up the code we're going to use for the tutorial:
416416

417417
```{code-block} console
418-
$ verdi code setup -L add --on-computer --computer=localhost -P core.arithmetic.add --remote-abs-path=/bin/bash -n
418+
$ verdi code create core.code.installed -L add --computer=localhost -P core.arithmetic.add --filepath-executable=/bin/bash -n
419419
```
420420

421421
This command sets up a code with *label* `add` on the *computer* `localhost`, using the *plugin* `core.arithmetic.add`.
@@ -432,7 +432,7 @@ $ verdi code list
432432
* pk 1 - add@localhost
433433
```
434434

435-
In the output above you can see a the code `add@localhost`, with PK = 1, in the printed list.
435+
In the output above you can see the code `add@localhost`, with PK = 1, in the printed list.
436436
Again, in your output you may have other codes listed or a different PK depending on your specific setup, but you should still be able to identify the code by its label.
437437
The `add@localhost` identifier indicates that the code with label `add` is run on the computer with label `localhost`.
438438
To see more details about the computer, you can use the following `verdi` command:

docs/sections/managing_data/querying.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
"from aiida.plugins import CalculationFactory, DataFactory\n",
6262
"\n",
6363
"PwCalculation = CalculationFactory('quantumespresso.pw')\n",
64-
"StructureData = DataFactory('structure')\n",
65-
"KpointsData = DataFactory('array.kpoints')\n",
66-
"Dict = DataFactory('dict')\n",
64+
"StructureData = DataFactory('core.structure')\n",
65+
"KpointsData = DataFactory('core.array.kpoints')\n",
66+
"Dict = DataFactory('core.dict')\n",
6767
"UpfData = DataFactory('core.upf')\n",
6868
"\n",
6969
"def plot_results(query_res):\n",
@@ -1642,7 +1642,7 @@
16421642
}
16431643
],
16441644
"source": [
1645-
"generate_query_graph(query.queryhelp, 'query1.png')\n",
1645+
"generate_query_graph(query.as_dict(), 'query1.png')\n",
16461646
"Image(filename='query1.png')"
16471647
]
16481648
},
@@ -1710,7 +1710,7 @@
17101710
"source": [
17111711
"query = QueryBuilder()\n",
17121712
"# Visualize what is going on:\n",
1713-
"generate_query_graph(query.queryhelp, 'query2.png')\n",
1713+
"generate_query_graph(query.as_dict(), 'query2.png')\n",
17141714
"Image(filename='query2.png')"
17151715
]
17161716
},
@@ -2071,7 +2071,7 @@
20712071
")\n",
20722072
"# Visualize:\n",
20732073
"print(\"Groups:\", ', '.join([g for g, in query.all()]))\n",
2074-
"generate_query_graph(query.queryhelp, 'query3.png')\n",
2074+
"generate_query_graph(query.as_dict(), 'query3.png')\n",
20752075
"Image(filename='query3.png')"
20762076
]
20772077
},

docs/sections/running_processes/basics.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ You will notice that the information that goes into the `test_run.in` input file
115115
* the `UpfData` node with link label `pseudos_Si` contains the data for the *ATOMIC_SPECIES* block (including the pseudopotential file to be copied in the `pseudo_dir`).
116116
* the `Dict` node with link label `parameters` contains the rest of the data (for the *&CONTROL* and *&SYSTEM* namelists).
117117

118-
Once the inputs files are prepared from these nodes, they are copied into the computer or cluster where the calculation will run.
118+
Once the input files are prepared from these nodes, they are copied into the computer or cluster where the calculation will run.
119119
AiiDA immediately generates a `RemoteData` node as part of this submission procedure; this node can be thought as a symbolic link to the remote folder where the files are copied.
120120

121121
The other output nodes are created once the calculation has finished, after the retrieval and parsing steps.
@@ -160,7 +160,7 @@ However, you will still have to set up the code to run it with AiiDA.
160160
This can be done with:
161161

162162
```{code-block} console
163-
$ verdi code setup --label pw --computer localhost --remote-abs-path /opt/conda/bin/pw.x --input-plugin quantumespresso.pw --non-interactive
163+
$ verdi code create core.code.installed --label pw --computer localhost --filepath-executable /opt/conda/bin/pw.x --default-calc-job-plugin quantumespresso.pw --non-interactive
164164
Success: Code<2> pw@localhost created
165165
```
166166

@@ -231,10 +231,10 @@ To get a list of all available [pseudopotentials][pseudopotentials], simply run:
231231
$ aiida-pseudo list
232232
Label Type string Count
233233
----------------------------------- ------------------------- -------
234-
SSSP/1.1/PBEsol/precision pseudo.family.sssp 85
235-
SSSP/1.1/PBEsol/efficiency pseudo.family.sssp 85
236-
SSSP/1.1/PBE/precision pseudo.family.sssp 85
237-
SSSP/1.1/PBE/efficiency pseudo.family.sssp 85
234+
SSSP/1.3/PBEsol/precision pseudo.family.sssp 85
235+
SSSP/1.3/PBEsol/efficiency pseudo.family.sssp 85
236+
SSSP/1.3/PBE/precision pseudo.family.sssp 85
237+
SSSP/1.3/PBE/efficiency pseudo.family.sssp 85
238238
:::
239239

240240
The list of pseudopotential families might differ for you, depending on where you are running the tutorial.
@@ -250,7 +250,7 @@ $ aiida-pseudo install sssp
250250
Info: downloading selected pseudo potentials archive... [OK]
251251
Info: downloading selected pseudo potentials metadata... [OK]
252252
Info: unpacking archive and parsing pseudos... [OK]
253-
Success: installed `SSSP/1.1/PBE/efficiency` containing 85 pseudo potentials
253+
Success: installed `SSSP/1.3/PBE/efficiency` containing 85 pseudo potentials
254254
```
255255

256256
The output already indicates the process was successful and shows you the label for the new family group.
@@ -364,7 +364,7 @@ We will see more on how to use groups in the module on {ref}`Organising your dat
364364

365365
:::{code-block} ipython
366366

367-
In [5]: pseudo_family = load_group('SSSP/1.1/PBE/efficiency')
367+
In [5]: pseudo_family = load_group('SSSP/1.3/PBE/efficiency')
368368

369369
:::
370370

docs/sections/running_processes/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ For the `structure` you can download the following {download}`silicon crystal<in
5454
If you have already done so previously (as it is used in other tutorial sections), you may want to use that pre-existing node instead of saving a new node with repeated information.
5555
To do so you may search for its PK by running `verdi data core.structure list` and then use the function `load_node()` to retrieve it.
5656

57-
For the `pseudos` (or [pseudopotentials](https://en.wikipedia.org/wiki/Pseudopotential)), you can use the `SSSP/1.1/PBE/efficiency` family of the `aiida-pseudo` package.
57+
For the `pseudos` (or [pseudopotentials](https://en.wikipedia.org/wiki/Pseudopotential)), you can use the `SSSP/1.3/PBE/efficiency` family of the `aiida-pseudo` package.
5858
If you already have it installed, it is enough to use the `load_group()` function and then the `get_pseudos()` method of the loaded pseudo group.
5959

6060
The set of `kpoints` can be simply created by using the methods of the `KpointsData` node class to define a `2x2x2` mesh and store it in a new node.

docs/sections/running_processes/workflows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ $ aiida-pseudo list
257257
Label Type string Count
258258
----------------------------------- ------------------------- -------
259259
PseudoDojo/0.4/PBE/SR/standard/upf pseudo.family.pseudo_dojo 72
260-
SSSP/1.1/PBEsol/precision pseudo.family.sssp 85
261-
SSSP/1.1/PBEsol/efficiency pseudo.family.sssp 85
262-
SSSP/1.1/PBE/precision pseudo.family.sssp 85
263-
SSSP/1.1/PBE/efficiency pseudo.family.sssp 85
260+
SSSP/1.3/PBEsol/precision pseudo.family.sssp 85
261+
SSSP/1.3/PBEsol/efficiency pseudo.family.sssp 85
262+
SSSP/1.3/PBE/precision pseudo.family.sssp 85
263+
SSSP/1.3/PBE/efficiency pseudo.family.sssp 85
264264
265265
```
266266

docs/sections/writing_workflows/errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This exit code is used in the `validate_result` step, where the sum produced by
4040

4141
```
4242

43-
If the sum is negative, which is unacceptable in this fictitious example, the work chain return the exit code that corresponds to the label `ERROR_NEGATIVE_NUMBER`.
43+
If the sum is negative, which is unacceptable in this fictitious example, the work chain returns the exit code that corresponds to the label `ERROR_NEGATIVE_NUMBER`.
4444
Note that you can use the `self.exit_codes` property of the `WorkChain` to quickly retrieve the exit code using the corresponding label.
4545
Returning an exit code instructs the engine to abort the work chain, and set the corresponding exit status and message on the node in the provenance graph.
4646

docs/sections/writing_workflows/realworld.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ $ verdi code list
3232
* pk 74 - pw@localhost # <- this is the relevant code
3333
```
3434

35-
If you don't have the PW code available, you can set it up by running the following command (you may need to adapt the `--remote-abs-path` or even the `--computer` if you are running in a custom environment):
35+
If you don't have the PW code available, you can set it up by running the following command (you may need to adapt the `--filepath-executable` or even the `--computer` if you are running in a custom environment):
3636

3737
```{code-block} console
38-
$ verdi code setup --label pw --computer localhost --remote-abs-path /opt/conda/bin/pw.x --input-plugin quantumespresso.pw --non-interactive
38+
$ verdi code create core.code.installed --label pw --computer localhost --filepath-executable /opt/conda/bin/pw.x --default-calc-job-plugin quantumespresso.pw --non-interactive
3939
Success: Code<2> pw@localhost created
4040
```
4141

@@ -45,7 +45,7 @@ On the other hand, you can check the pseudopotentials by running:
4545
aiida-pseudo list
4646
Label Type string Count
4747
----------------------- ------------------ -------
48-
SSSP/1.1/PBE/efficiency pseudo.family.sssp 85
48+
SSSP/1.3/PBE/efficiency pseudo.family.sssp 85
4949
```
5050

5151
And install them with:
@@ -219,7 +219,7 @@ To run the workflow, we also have to specify the label of the family of pseudopo
219219

220220
```{code-block} ipython
221221
222-
In [3]: pseudo_family_label = Str('SSSP/1.1/PBE/efficiency')
222+
In [3]: pseudo_family_label = Str('SSSP/1.3/PBE/efficiency')
223223
224224
```
225225

@@ -477,7 +477,7 @@ Once the daemon has been restarted, it is time to *submit* the `EquationOfState`
477477
478478
In [1]: from eos_workchain import EquationOfState
479479
...: from aiida.engine import submit
480-
...: submit(EquationOfState, code=load_code('pw@localhost'), pseudo_family_label=Str('SSSP/1.1/PBE/efficiency'), structure=load_node(pk=<PK>))
480+
...: submit(EquationOfState, code=load_code('pw@localhost'), pseudo_family_label=Str('SSSP/1.3/PBE/efficiency'), structure=load_node(pk=<PK>))
481481
Out[1]: <WorkChainNode: uuid: 9e5c7c48-a47c-49fc-a8ab-fff081f250ee (pk: 665) (eos.workchain.EquationOfState)>
482482
483483
```

docs/sections/writing_workflows/workchain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ If not, you can set it up with the instructions in the dropdown below.
736736
Setting up the `add` code on the `localhost` computer can be done with the following command:
737737

738738
```{code-block} console
739-
$ verdi code setup -L add --on-computer --computer=localhost -P core.arithmetic.add --remote-abs-path=/bin/bash -n
739+
$ verdi code create core.code.installed -L add --computer=localhost -P core.arithmetic.add --filepath-executable=/bin/bash -n
740740
```
741741

742742
See the {ref}`calculation jobs section <started-basics-calcjobs>` in the AiiDA basics module for more details.

0 commit comments

Comments
 (0)