Skip to content

Commit

Permalink
Update jij tests + small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippRue committed Nov 25, 2024
1 parent d90ac3e commit 9f37e40
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions aiida_kkr/calculations/kkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'IAS-1/PGI-1, Germany. All rights reserved.')
__license__ = 'MIT license, see LICENSE.txt file'

__version__ = '0.13.1'
__version__ = '0.13.2'

__contributors__ = ('Jens Bröder', 'Philipp Rüßmann')

Expand Down Expand Up @@ -1063,8 +1063,8 @@ def _use_initial_noco_angles(self, parameters, structure, tempfolder):
f'Error: theta value out of range (0..180): iatom={iatom}, theta={theta}'
)
# convert fix_dir to boolean if given as integer
if not isinstance(fix_dir, bool):
fix_dir = (fix_dir == 1)
if not isinstance(fix_dir[iatom], bool):
fix_dir[iatom] = (fix_dir[iatom] == 1)

Check warning on line 1067 in aiida_kkr/calculations/kkr.py

View check run for this annotation

Codecov / codecov/patch

aiida_kkr/calculations/kkr.py#L1066-L1067

Added lines #L1066 - L1067 were not covered by tests
# write line
noco_angle_file.write(f' {theta} {phi} {fix_dir[iatom]}\n')

Expand Down
Binary file not shown.
Binary file added tests/data_dir/jij_soc.aiida
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions tests/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ elif [[ ! -z "$GITHUB_SUITE" ]]; then
./workflows/test_dos_wc.py \
./workflows/test_bs_wc.py \
./workflows/test_gf_writeout_wc.py \
./workflows/test_jij_wc.py \
./workflows/test_eos.py \
./workflows/test_decimate.py \
./workflows/test_kkrimp_dos_wc.py \
Expand Down
16 changes: 7 additions & 9 deletions tests/workflows/test_jij_wc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
"""

import pytest
from aiida.engine import run_get_node
from ..dbsetup import *
from aiida_testing.export_cache._fixtures import run_with_cache, export_cache, load_cache, hash_code_by_entrypoint
from aiida.manage.tests.pytest_fixtures import (
aiida_local_code_factory, aiida_localhost, temp_dir, aiida_profile, clear_database, clear_database_after_test,
clear_database_before_test
)
from ..conftest import kkrhost_local_code, data_dir, import_with_migration


@pytest.mark.timeout(240, method='thread')
def test_jij(clear_database_before_test, kkrhost_local_code, run_with_cache, ndarrays_regression):
def test_jij(clear_database_before_test, kkrhost_local_code, enable_archive_cache, ndarrays_regression):
"""
Jij test with SOC
"""
Expand Down Expand Up @@ -57,7 +53,8 @@ def test_jij(clear_database_before_test, kkrhost_local_code, run_with_cache, nda
})

# run the calculation using cached data is available
out, _ = run_with_cache(builder, data_dir=data_dir)
with enable_archive_cache(data_dir / 'jij.aiida'):
out, node = run_get_node(builder)

# check results
print('check results', out)
Expand All @@ -73,7 +70,7 @@ def test_jij(clear_database_before_test, kkrhost_local_code, run_with_cache, nda


@pytest.mark.timeout(240, method='thread')
def test_jij_soc(clear_database_before_test, kkrhost_local_code, run_with_cache, ndarrays_regression):
def test_jij_soc(clear_database_before_test, kkrhost_local_code, enable_archive_cache, ndarrays_regression):
"""
Jij test with SOC
"""
Expand Down Expand Up @@ -122,7 +119,8 @@ def test_jij_soc(clear_database_before_test, kkrhost_local_code, run_with_cache,
})

# run the calculation using cached data is available
out, _ = run_with_cache(builder, data_dir=data_dir)
with enable_archive_cache(data_dir / 'jij_soc.aiida'):
out, node = run_get_node(builder)

# check results
print('check results', out)
Expand Down

0 comments on commit 9f37e40

Please sign in to comment.