-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HubbardStructureData
: Add validation on site indices
The `append_hubbard_parameter()` method of the `HubbardStructureData` class currently does not verify that the `atom_index` and `neighbour_index` values correspond to valid site indices in the structure. This means that the method will: - fail in case `translation` is set to `None` (as it attempts to access these site indices to obtain the distance and image of the nearest neighbour using periodic boundary conditions) - succeed in case the translation is specified, but fail once the code tries to write Hubbard card during the `prepare_for_submission` method of the `PwCalculation`. To have more consistent behaviour and avoid exceptions during the `upload` step of the submission process, we check here that the `atom_index` and `neighbour_index` are valid and raise a `ValueError` if they are not.
- Loading branch information
Showing
7 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
tests/data/test_hubbard_structure/test_append_hubbard_parameters_parameters0_silicon_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- - 0 | ||
- 1s | ||
- 0 | ||
- 1s | ||
- 5.0 | ||
- - 0 | ||
- 0 | ||
- 0 | ||
- Ueff |
9 changes: 9 additions & 0 deletions
9
tests/data/test_hubbard_structure/test_append_hubbard_parameters_parameters1_silicon_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- - 0 | ||
- 1s | ||
- 1 | ||
- 1s | ||
- 5.0 | ||
- - -1 | ||
- 0 | ||
- 0 | ||
- V |
9 changes: 9 additions & 0 deletions
9
tests/data/test_hubbard_structure/test_append_hubbard_parameters_parameters2_silicon_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- - 0 | ||
- 1s | ||
- 0 | ||
- 1s | ||
- 5.0 | ||
- - 0 | ||
- 0 | ||
- 0 | ||
- Ueff |
18 changes: 18 additions & 0 deletions
18
tests/data/test_hubbard_structure/test_append_hubbard_parameters_parameters3_silicon_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
- - 0 | ||
- 1s | ||
- 0 | ||
- 1s | ||
- 5.0 | ||
- - 0 | ||
- 0 | ||
- 0 | ||
- Ueff | ||
- - 0 | ||
- 1s | ||
- 1 | ||
- 1s | ||
- 5.0 | ||
- - 0 | ||
- 1 | ||
- 0 | ||
- V |