From 76477215ae6a9169646654a35890aca6c2176ede Mon Sep 17 00:00:00 2001 From: jrudz Date: Tue, 24 Sep 2024 10:30:29 +0200 Subject: [PATCH] save a few changes --- src/nomad_simulations/schema_packages/force_field.py | 9 +++++---- tests/test_force_field.py | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/nomad_simulations/schema_packages/force_field.py b/src/nomad_simulations/schema_packages/force_field.py index 45c2e038..4fa7960a 100644 --- a/src/nomad_simulations/schema_packages/force_field.py +++ b/src/nomad_simulations/schema_packages/force_field.py @@ -252,10 +252,10 @@ def normalize(self, archive, logger) -> None: ) if np.all([x < tol for x in energies_diff]): print('consistent energies') - # logger.warning( - # f'Forces were generated from energies in {self.name},' - # f' but appear to be roughly consistent, with rtol={tol}. ' - # ) + logger.warning( + f'Forces were generated from energies in {self.name},' + f' but appear to be roughly consistent, with rtol={tol}. ' + ) else: # logger.warning('inconsistent energies') print('inconsistent energies') @@ -670,3 +670,4 @@ def normalize(self, archive, logger) -> None: super().normalize(archive, logger) self.name = 'ForceField' + logger.warning('in force field') diff --git a/tests/test_force_field.py b/tests/test_force_field.py index d561153b..5516ea40 100644 --- a/tests/test_force_field.py +++ b/tests/test_force_field.py @@ -24,7 +24,9 @@ from nomad_simulations.schema_packages.numerical_settings import ForceCalculations from nomad.datamodel import EntryArchive -from structlog.stdlib import BoundLogger + +# from structlog.stdlib import BoundLogger +from . import logger from nomad.units import ureg @@ -621,7 +623,7 @@ def test_potentials( populate_parameters(sec_potential, parameters) sec_FF.contributions.append(sec_potential) - sec_FF.contributions[-1].normalize(EntryArchive, BoundLogger) + sec_FF.contributions[-1].normalize(EntryArchive, logger) # BoundLogger) potential_dict = sec_FF.contributions[-1].m_to_dict() potential_dict = {