Skip to content

Commit

Permalink
- Rewrite ocean test to target parameter coverage by name
Browse files Browse the repository at this point in the history
- TODO: convert to NOMAD API
  • Loading branch information
[email protected] committed Oct 29, 2024
1 parent 12082c8 commit 30ec66d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_oceanparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@

import pytest
import numpy as np
import re

from nomad.datamodel import EntryArchive
from electronicparsers.ocean import OceanParser
from electronicparsers.ocean.metainfo.ocean import x_ocean_screen_parameters


def approx(value, abs=0, rel=1e-6):
Expand Down Expand Up @@ -61,8 +63,11 @@ def test_tio2(parser):
assert sec_bse.core_hole.solver == 'Lanczos-Haydock'
assert sec_bse.core_hole.mode == 'absorption'
assert sec_bse.core_hole.broadening.to('eV').magnitude == approx(0.89)

sec_ocean_screen = sec_method[-1].x_ocean_screen
assert sec_ocean_screen.m_mod_count == 22
for screen_param in vars(x_ocean_screen_parameters).keys():
if re.match('x_ocean_', screen_param):
assert getattr(sec_ocean_screen, screen_param) is not None
assert sec_ocean_screen.x_ocean_dft_energy_range == approx(150.0)

# Calculation
Expand Down

0 comments on commit 30ec66d

Please sign in to comment.