Skip to content

Commit bc660de

Browse files
committed
fix xc partner issue
1 parent 4255198 commit bc660de

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/nomad_simulations/schema_packages/model_method.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ class EmpiricalDispersionModel(BaseModelMethod):
269269
)
270270

271271
# TODO later: link to XCComponent(s)
272-
xc_partner = Quantity(
273-
type=str,
272+
xc_partner_ref = Quantity(
273+
type=Reference(SectionProxy('XCFunctional')),
274274
description="Base XC functional used/tuned for (e.g. 'PBE', 'SCAN', 'B3LYP').",
275275
)
276276

@@ -655,7 +655,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
655655

656656
for contribution in self.contributions or []:
657657
if (
658-
isinstance(contribution, ExplicitDispersionModel)
658+
isinstance(contribution, EmpiricalDispersionModel)
659659
and contribution.xc_partner_ref is None
660660
):
661661
contribution.xc_partner_ref = self.xc

tests/test_model_method.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,10 @@ def test_solvation_derives_optical_eps_if_only_n_given():
684684
assert pytest.approx(ism.dielectric_constant_optical, rel=1e-12) == 1.50**2
685685

686686

687-
def test_dft_sets_explicit_dispersion_xc_partner_ref():
687+
def test_dft_sets_empirical_dispersion_xc_partner_ref():
688688
dft = DFT()
689689
dft.xc = XCFunctional(functional_key='PBE')
690-
edm = ExplicitDispersionModel(model='D3BJ', damping_function='BJ')
690+
edm = EmpiricalDispersionModel(model='D3BJ', damping_function='BJ')
691691
dft.m_add_sub_section(type(dft).contributions, edm)
692692

693693
dft.normalize(EntryArchive(), logger=logger)
@@ -762,6 +762,8 @@ def test_dft_nonlocal_addon_creates_new_nonlocal_for_mismatched_existing_type():
762762
assert len(new_terms) == 1
763763
assert new_terms[0].type == 'rVV10'
764764
assert new_terms[0].xc_partner_ref is dft.xc
765+
766+
765767
_COMMON_XC_CASES = [
766768
# ---------------- LDA ----------------
767769
('LDA', 'LDA'),

0 commit comments

Comments
 (0)