Skip to content

Commit

Permalink
Apply review
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed Jun 10, 2023
1 parent f38792f commit 159d67c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/source/howto/calculations/pw.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ When a {{ PwCalculation }} is completed, there are quite a few possible analyses

During the self-consistent field cycle, the difference in energy of the newly computed charge density and the starting one is computed and stored.
It can easily be retrieved through the {meth}`~aiida_quantumespresso.tools.calculations.pw.PwCalculationTools.get_scf_accuracy` method.
This method can be accessed directly through the ``tools`` of a completed `{{ PwCalculation }}` node:
This method can be accessed directly through the `tools` of a completed {{ PwCalculation }} node:

```python
In [1]: node = load_node(IDENTIFIER)
Expand Down
8 changes: 2 additions & 6 deletions docs/source/tutorials/first_pw.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@

(tutorials-first-pw)=
(tutorials-running-pw)=

# Your first `pw.x` calculation
# Running a `pw.x` calculation

(tutorials-pw-through-cli)=

## Running a `pw.x` calculation through the CLI

The simplest way to run a first `pw.x` calculation with `aiida-quantumespresso` is through the [command line interface (CLI)](#reference-cli) that ships with the package.

:::{margin} ❗️Important
This is a margin note.
:::

```console
aiida-quantumespresso calculation launch pw -X pw@locahost -F SSSP/1.1/PBE/efficiency
```
Expand Down
9 changes: 3 additions & 6 deletions src/aiida_quantumespresso/tools/calculations/pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,10 @@ def get_scf_accuracy(self, index=0):

def get_magnetic_configuration(self, atol: float = 0.5, ztol: float = 0.05) -> AttributeDict:
"""Get the final magnetic configuration of a ``pw.x`` calculation."""

calculation = self._node.inputs.parameters.get_dict()['CONTROL'].get('calculation', 'scf')

if calculation in ['scf', 'nscf', 'bands']:
structure = self._node.inputs.structure
else:
try:
structure = self._node.outputs.output_structure
except AttributeError:
structure = self._node.inputs.structure

try:
magnetic_moments = self._node.outputs.output_trajectory.get_array('atomic_magnetic_moments')[-1].tolist()
Expand Down

0 comments on commit 159d67c

Please sign in to comment.