Skip to content

Commit

Permalink
Fix attribute error.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubelMozumder committed Jan 8, 2025
1 parent 8eabf38 commit 465770e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/pynxtools/nomad/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ 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}
existing_items = {
(task.name, task.section)
for task in act_array
if hasattr(task, "name") and hasattr(task.section, "section")
}
new_items = [
item.to_task()
for item in self.steps
Expand All @@ -165,7 +169,11 @@ 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}
existing_items = {
(link.name, link.section)
for link in act_array
if hasattr(link, "name") and hasattr(link.section, "section")
}
new_items = [
Link(name=item.name, section=item.reference)
for item in self.samples
Expand All @@ -175,7 +183,11 @@ def normalize(self, archive, logger):

# results to outputs
act_array = archive.workflow2.outputs
existing_items = {(link.name, link.section) for link in act_array}
existing_items = {
(link.name, link.section)
for link in act_array
if hasattr(link, "name") and hasattr(link.section, "section")
}
new_items = [
Link(name=item.name, section=item)
for item in self.results
Expand Down

0 comments on commit 465770e

Please sign in to comment.