From cab1353165898298461d9845c7f336a59ccb3f00 Mon Sep 17 00:00:00 2001 From: ndaelman-hu <107392603+ndaelman-hu@users.noreply.github.com> Date: Fri, 13 Sep 2024 20:34:19 +0200 Subject: [PATCH] Add protection to `model_system` normalization in case the list is empty (#118) Add protection to `model_system` normalization in case the list is empty --------- Co-authored-by: ndaelman --- src/nomad_simulations/schema_packages/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nomad_simulations/schema_packages/general.py b/src/nomad_simulations/schema_packages/general.py index 8fa5d75e..d38de349 100644 --- a/src/nomad_simulations/schema_packages/general.py +++ b/src/nomad_simulations/schema_packages/general.py @@ -309,7 +309,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: # Finding which is the representative system of a calculation: typically, we will # define it as the last system reported (TODO CHECK THIS!). # TODO extend adding the proper representative system extraction using `normalizer.py` - if self.model_system is None: + if not self.model_system: logger.error('No system information reported.') return system_ref = self.model_system[-1]