Skip to content

Commit

Permalink
Fix utils import and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Apr 11, 2024
1 parent a8a5160 commit 2b14d53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/nomad_simulations/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from structlog.stdlib import BoundLogger

from nomad.datamodel.data import ArchiveSection
from nomad.datamodel import EntryArchive


def get_sibling_section(
Expand Down
13 changes: 8 additions & 5 deletions tests/test_atoms_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,11 @@ def test_u_interactions(
assert np.isclose(u_interorbital_interaction.to('eV').magnitude, results[1])
assert np.isclose(j_hunds_coupling.to('eV').magnitude, results[2])
else:
assert np.isclose(u_interaction, results[0])
assert np.isclose(u_interorbital_interaction, results[1])
assert np.isclose(j_hunds_coupling, results[2])
assert (
u_interaction,
u_interorbital_interaction,
j_hunds_coupling,
) == results

@pytest.mark.parametrize(
'u_interaction, j_local_exchange_interaction, u_effective',
Expand Down Expand Up @@ -318,8 +320,9 @@ def test_u_effective(
# Resolving Ueff from class method
resolved_u_effective = hubbard_interactions.resolve_u_effective(logger)
if resolved_u_effective is not None:
resolved_u_effective = resolved_u_effective.to('eV').magnitude
assert np.isclose(resolved_u_effective, u_effective)
assert np.isclose(resolved_u_effective.to('eV').magnitude, u_effective)
else:
assert resolved_u_effective == u_effective

def test_normalize(self):
"""
Expand Down

0 comments on commit 2b14d53

Please sign in to comment.