Skip to content

Commit

Permalink
remove attribute checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubelMozumder committed Jan 8, 2025
1 parent 465770e commit cae1a27
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/pynxtools/nomad/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit cae1a27

Please sign in to comment.