Skip to content

Commit

Permalink
Minor fixes (#114)
Browse files Browse the repository at this point in the history
* make use of identifier more clear

fix #100

* clarify meaning of YOUR_DICT in 3.2.3

fix #104
  • Loading branch information
ltalirz committed Jun 1, 2019
1 parent d4b01bd commit cf78eb9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
8 changes: 5 additions & 3 deletions docs/pages/2019_MARVEL_Psik_MaX/sections/verdi_cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Have a look to the figure and its caption before moving on.
The node with linkname 'retrieved' contains the raw output files stored in the AiiDA repository; all other nodes are added by the parser.
Additional nodes (symbolized in gray) can be added by the parser (e.g. an output ``StructureData`` if you performed a relaxation calculation, a ``TrajectoryData`` for molecular dynamics etc.).

:numref:`fig_graph_input_only` was drawn by hand but you can generate a similar graph automatically by passing the *identifier* of a calculation node to ``verdi graph generate <IDENTIFIER>``.
:numref:`fig_graph_input_only` was drawn by hand but you can generate a similar graph automatically by passing the **identifier** of a calculation node to ``verdi graph generate <IDENTIFIER>``.
Identifiers in AiiDA come in three forms:

* "Primary Key" (PK): An integer, e.g. ``723``, that identifies your entity within your database (automatically assigned)
Expand Down Expand Up @@ -347,12 +347,14 @@ Dict and CalcJobNode
~~~~~~~~~~~~~~~~~~~~

Let's investigate some of the nodes appearing in the graph.
Choose the node of the type ``Dict`` with input link name ``parameters`` and type in the terminal:
From the inputs of the process, let's choose the node of type ``Dict`` with input link name ``parameters`` and type in the terminal:

.. code:: bash
verdi data dict show <IDENTIFIER>
where ``<IDENTIFIER>`` is the PK of the node.

A ``Dict`` contains a dictionary (i.e. key–value pairs), stored in the database in a format ready to be queried.
We will learn how to run queries later on in this tutorial.
The command above will print the content dictionary, containing the parameters used to define the input file for the calculation.
Expand All @@ -362,7 +364,7 @@ You can compare the dictionary with the content of the raw input file to Quantum
verdi calcjob inputcat <IDENTIFIER>
where you substitute the identifier of the calculation node.
where you provide the identifier of the calculation node.
Check the consistency of the parameters written in the input file and those stored in the ``Dict`` node.
Even if you don't know the meaning of the input flags of a Quantum ESPRESSO calculation, you should be able to see how the input dictionary has been converted to Fortran namelists.

Expand Down
31 changes: 12 additions & 19 deletions docs/pages/2019_MARVEL_Psik_MaX/sections/verdi_shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ You can also type
and then press ``TAB`` to see all the available output results of the
calculation.

Loading different kinds of nodes
--------------------------------
Loading specific kinds of nodes
-------------------------------

Pseudopotentials
~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -173,30 +173,23 @@ Then display its content by typing

.. code:: python
params.get_dict()
params = load_node('<IDENTIFIER>')
YOUR_DICT = params.get_dict()
YOUR_DICT
where ``params`` is the ``Dict`` node you loaded. Modify the dictionary
content so that the wave-function cutoff is now set to 20 Ry. Note that you
cannot modify an object already stored in the database. To save the
modification, you must create a new ``Dict`` object. Similarly to what
discussed before, first load the ``Dict`` class by typing
Modify the python dictionary ``YOUR_DICT`` so that the wave-function cutoff is now set to 20
Ry. Note that you cannot modify an object already stored in the database. To
write the modified dictionary to the database, create a new object of class ``Dict``:

.. code:: python
Dict = DataFactory('dict')
Then an instance of the class (i.e. the dict object that we want to create) is
created and initialized by the command

.. code:: python
new_params = Dict(dict=YOUR_DICT)
where ``YOUR_DICT`` is the modified python dictionary. Note that the dict object is
not yet stored in the database. In fact, if you simply type ``new_params`` in
the verdi shell, you will be prompted with a string notifying you of its
'unstored' status. To record in the database an entry corresponding to the
``new_params`` object, you need to type one last command in the verdi shell:
where ``YOUR_DICT`` is the modified python dictionary.
Note that ``new_params`` is not yet stored in the database.
In fact, typing ``new_params`` in the verdi shell will print a string notifying you of its 'unstored' status.
Let's finish by storing the ``new_params`` dictionary node in the datbase:

.. code:: python
Expand Down

0 comments on commit cf78eb9

Please sign in to comment.