diff --git a/src/pynxtools/nomad/schema.py b/src/pynxtools/nomad/schema.py index 07c14f4c6..dc19f8f14 100644 --- a/src/pynxtools/nomad/schema.py +++ b/src/pynxtools/nomad/schema.py @@ -156,11 +156,7 @@ def normalize(self, archive, logger): archive.workflow2 = Workflow(name=self.name) # steps to tasks act_array = archive.workflow2.tasks - existing_items = { - (task.name, task.section) - for task in act_array - if hasattr(task, "name") and hasattr(task.section, "section") - } + existing_items = {(task.name, task.section) for task in act_array} new_items = [ item.to_task() for item in self.steps @@ -169,11 +165,7 @@ def normalize(self, archive, logger): act_array.extend(new_items) # samples to inputs act_array = archive.workflow2.inputs - existing_items = { - (link.name, link.section) - for link in act_array - if hasattr(link, "name") and hasattr(link.section, "section") - } + existing_items = {(link.name, link.section) for link in act_array} new_items = [ Link(name=item.name, section=item.reference) for item in self.samples @@ -183,11 +175,7 @@ def normalize(self, archive, logger): # results to outputs act_array = archive.workflow2.outputs - existing_items = { - (link.name, link.section) - for link in act_array - if hasattr(link, "name") and hasattr(link.section, "section") - } + existing_items = {(link.name, link.section) for link in act_array} new_items = [ Link(name=item.name, section=item) for item in self.results