Skip to content

Commit

Permalink
đź‘ŚIMPROVE: data manage sections after Azure testing (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Sep 27, 2022
1 parent be2ca1f commit 9ac67b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
9 changes: 5 additions & 4 deletions docs/sections/managing_data/groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ $ verdi group relabel a_group my_group
Success: Label changed to my_group
```

Add one or more nodes to your new group using node PKs from the `tutorial_pbesol` group we inspected earlier:
Add one or more nodes to your new group using node PKs from the `tutorial_pbesol` group we inspected earlier (the PK might be different for your database):

```{code-block} console
$ verdi group add-nodes -G my_group 380 1273
$ verdi group add-nodes -G my_group <PK> <PK>
Do you really want to add 2 nodes to Group<my_group>? [y/N]: y
```

Expand All @@ -132,8 +132,8 @@ Group description <no description>
# Nodes:
PK Type Created
---- ----------- -----------------
74 CalcJobNode 2078D:17h:51m ago
76 CalcJobNode 2078D:17h:57m ago
380 CalcJobNode 2078D:17h:46m ago
1273 CalcJobNode 2078D:18h:03m ago
...
```

Expand All @@ -157,6 +157,7 @@ Success: Group<my_group> deleted.
Any deletion operation related to groups will not affect the nodes themselves.
For example if you delete a group, the nodes that belonged to the group will remain in the database.
The same happens if you remove nodes from the group -- they will remain in the database but won't belong to the group any more.
You can delete all nodes in the group along with the group itself by adding option `--delete-nodes` to the `verdi group delete` command.

:::

Expand Down
24 changes: 8 additions & 16 deletions docs/sections/managing_data/querying.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@
" from aiida.orm import QueryBuilder\n",
" query = QueryBuilder()\n",
" query.append(StructureData, filters={'extras':{'!has_key':'formula'}})\n",
" for structure, in query.iterall():\n",
" structure.set_extra('formula', structure.get_formula(mode='count'))\n",
" for structure, in query.all():\n",
" structure.base.extras.set('formula', structure.get_formula(mode='count'))\n",
"\n",
"store_formula_in_extra()"
]
Expand Down Expand Up @@ -1774,8 +1774,8 @@
"It will return a dictionary with all the attributes the node has.\n",
"\n",
"Note that a node also has a number of additional methods and attributes.\n",
"For instance, you can do `node.attributes_keys()` to get only the attribute keys or `node.get_attribute('wfc_cutoff')` to get the value of a single attribute (these two variants are more efficient if the node has a lot of attributes and you don't need all data).\n",
"Similarly, for `extras`, you have `node.extras`, `node.extras_keys()`, and `node.get_attribute('SOME_EXTRA_KEY')`."
"For instance, you can do `node.base.attributes.keys()` to get only the attribute keys or `node.base.attributes.get('wfc_cutoff')` to get the value of a single attribute (these two variants are more efficient if the node has a lot of attributes and you don't need all data).\n",
"Similarly, for `extras`, you have `node.base.extras.all`, `node.base.extras.keys()`, and `node.base.attributes.get('<SOME_EXTRA_KEY>')`."
]
},
{
Expand All @@ -1802,8 +1802,8 @@
"query = QueryBuilder()\n",
"query.append(PwCalculation)\n",
"node, = query.first()\n",
"print('Attributes dictionary:', node.attributes, '\\n')\n",
"print('Extras dictionary:', node.extras)"
"print('Attributes dictionary:', node.base.attributes.all, '\\n')\n",
"print('Extras dictionary:', node.base.extras.all)"
]
},
{
Expand Down Expand Up @@ -1949,7 +1949,7 @@
"\n",
"Alternatively, the dataset is included in the virtual machine image of the AiiDA tutorial from [aiida-tutorials.readthedocs.io](https://aiida-tutorials.readthedocs.io) (choose the correct version of the tutorial, depending on which version of AiiDA you want to try).\n",
"\n",
"If the data is not available yet, you can use the following command to import the required calculations:\n",
"If the data is not available yet, you can use the following command to import the required calculations (if you are in a notebook you can execute the command in a cell by adding an exclamation mark `!` in front)::\n",
"\n",
"```{code-block} console\n",
"verdi archive import https://object.cscs.ch/v1/AUTH_b1d80408b3d340db9f03d373bbde5c1e/marvel-vms/tutorials/aiida_tutorial_2022_10_perovskites_main_0001.aiida\n",
Expand All @@ -1969,7 +1969,7 @@
"These calculations are spin-polarized (without spin-orbit coupling), use a Gaussian smearing and perform a variable-cell relaxation of the full unit cell.\n",
"The goal of this part of the tutorial is to have you utilize what you have learnt in the previous sections and “screen” for magnetic and metallic perovskites in a “high-throughput” way.\n",
"As you learned previously in the tutorial, AiiDA allows to organize calculations into groups.\n",
"Once more check the list of groups in your database by typing:"
"Once more check the list of groups in your database by typing (From jupyter notebook or `IPython`):"
]
},
{
Expand Down Expand Up @@ -2282,14 +2282,6 @@
"source": [
"plot_results(results)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "461a8d21",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 9ac67b9

Please sign in to comment.