Skip to content

Commit

Permalink
Merge pull request #46 from albgar/ErrorHandlingDev
Browse files Browse the repository at this point in the history
Merge ErrorHandlingDev
  • Loading branch information
bosonie authored May 22, 2020
2 parents 5ace44c + 0c935a1 commit 15431de
Show file tree
Hide file tree
Showing 33 changed files with 5,822 additions and 799 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ on: [push, pull_request]

jobs:

pre-commit:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/setup.json') }}
restore-keys:
pip-pre-commit-

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install python dependencies
run:
pip install -e .[dev]

- name: Run pre-commit
run:
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

tests:

runs-on: ubuntu-latest
Expand Down
169 changes: 64 additions & 105 deletions aiida_siesta/calculations/siesta.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aiida_siesta/calculations/stm.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def define(cls, spec):
spec.input(
'spin_option',
valid_type=orm.Str,
default=orm.Str("q"),
default=lambda: orm.Str("q"),
help='Spin option, follows plstm sintax: '
'"q" no spin, "s" total spin, "x","y","z" the three '
'spin components (only available in non-collinear case)'
Expand Down
22 changes: 21 additions & 1 deletion aiida_siesta/docs/plugins/siesta.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,27 @@ aiida_siesta/examples/plugins/siesta.
inserted in the database, so it should not be used in the input script
(or removed before assigning the dictionary to the Dict
instance). For legibility, a single dash ('-') is suggested, as in the
examples above.
examples above. Moreover, because the parameters are passed through a python
dictionary, if, by mistake, the user passes the same keyword two (or more)
times, only the last specification will be considered. For instance::

parameters = Dict(dict={
"mesh-cutoff": "200 Ry",
"mesh-cutoff": "300 Ry",
})

will set a `mesh-cutoff` of `300 Ry`. This is the opposite respect to what is done
in the Siesta code, where the first assignment is the selected one. Please note that
this applies also to keywords that correspond to the same fdf variable. For instance::

parameters = Dict(dict={
"mesh-cutoff": "200 Ry",
"Mesh-Cut-off": "300 Ry",
})

will run a calculation with `mesh-cutoff` equal to `300 Ry`, whithout raising any
error.


.. |br| raw:: html

Expand Down
Loading

0 comments on commit 15431de

Please sign in to comment.