Skip to content

Commit

Permalink
Apply reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed Feb 19, 2024
1 parent d8a9367 commit 9b15578
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ def seekpath_structure_analysis(structure, **kwargs):

def update_structure_with_hubbard(structure, orig_structure):
"""Update the structure based on Hubbard parameters if the input structure is a HubbardStructureData."""
from aiida_quantumespresso.utils.hubbard import is_intersite_hubbard

hubbard_structure = HubbardStructureData.from_structure(structure)

if any(parameter.hubbard_type == 'V' for parameter in orig_structure.hubbard.parameters):
if is_intersite_hubbard(orig_structure.hubbard):
raise NotImplementedError('Intersite Hubbard parameters are not yet supported.')

Check failure on line 49 in src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py

View workflow job for this annotation

GitHub Actions / tests (3.8)

Intersite Hubbard parameters are not yet supported.

Check failure on line 49 in src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py

View workflow job for this annotation

GitHub Actions / tests (3.9)

Intersite Hubbard parameters are not yet supported.

Check failure on line 49 in src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py

View workflow job for this annotation

GitHub Actions / tests (3.10)

Intersite Hubbard parameters are not yet supported.

Check failure on line 49 in src/aiida_quantumespresso/calculations/functions/seekpath_structure_analysis.py

View workflow job for this annotation

GitHub Actions / tests (3.11)

Intersite Hubbard parameters are not yet supported.

for parameter in orig_structure.hubbard.parameters:
Expand Down
11 changes: 11 additions & 0 deletions tests/calculations/functions/test_seekpath_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,14 @@ def test_seekpath_analysis(data_regression):
'hubbard': conv_structure.hubbard.to_list(),
}
})


# pylint: disable=W0621
@pytest.mark.usefixtures('aiida_profile')
def test_seekpath_analysis_intersite(generate_structure):
"""Test that the `seekpath_structure_analysis` with intersite hubbard corrections fails."""
orig_structure = HubbardStructureData.from_structure(generate_structure('silicon-kinds'))
orig_structure.initialize_intersites_hubbard('Si0', '2p', 'Si1', '2p', 4.0, 'V', True)

with pytest.raises(NotImplementedError, match='Intersite Hubbard parameters are not yet supported.'):
seekpath_structure_analysis(orig_structure)

0 comments on commit 9b15578

Please sign in to comment.