From 657fbae9b0ec45f9fbddaae0444c16096758b5d9 Mon Sep 17 00:00:00 2001 From: sanbrock Date: Fri, 13 Dec 2024 22:12:08 +0100 Subject: [PATCH] fix basesection name normalisation which caused missing entries from the workflow graph --- src/pynxtools/nomad/schema.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/pynxtools/nomad/schema.py b/src/pynxtools/nomad/schema.py index 7dee89243..61174f38d 100644 --- a/src/pynxtools/nomad/schema.py +++ b/src/pynxtools/nomad/schema.py @@ -951,10 +951,9 @@ def normalize_sample_component(self, archive, logger): def normalize_sample(self, archive, logger): """Normalizer for sample section.""" current_cls = __section_definitions[__rename_nx_for_nomad("NXsample")].section_cls - if self.name__field: - self.name = self.name__field - else: - self.name = self.__dict__["nx_name"] + self.name = self.__dict__["nx_name"] + ( + "(" + self.name__field + ")" if self.name__field else "" + ) # one could also copy local ids to identifier for search purposes super(current_cls, self).normalize(archive, logger) @@ -964,10 +963,9 @@ def normalize_entry(self, archive, logger): current_cls = __section_definitions[__rename_nx_for_nomad("NXentry")].section_cls if self.start_time__field: self.start_time = self.start_time__field - if self.title__field is not None: - self.name = self.title__field - else: - self.name = self.__dict__["nx_name"] + self.name = self.__dict__["nx_name"] + ( + "(" + self.title__field + ")" if self.title__field is not None else "" + ) # one could also copy local ids to identifier for search purposes super(current_cls, self).normalize(archive, logger)