From cae1a276b13ca8f7f3a8534781267df7efd72e6a Mon Sep 17 00:00:00 2001 From: Rubel Date: Wed, 8 Jan 2025 17:46:49 +0100 Subject: [PATCH] remove attribute checks. --- src/pynxtools/nomad/schema.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) 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