Skip to content

Commit

Permalink
m_copy the relevant sections to steps and results instead of using py…
Browse files Browse the repository at this point in the history
…thon reference
  • Loading branch information
sanbrock committed Jan 7, 2025
1 parent 3b2e990 commit 8eabf38
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pynxtools/nomad/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,14 @@ def normalize(self, archive, logger):
app_entry = getattr(self, "ENTRY")
if len(app_entry) < 1:
raise AttributeError()
self.steps = app_entry
self.steps = []
for entry in app_entry:
sec_c = entry.m_copy()
self.steps.append(sec_c)
for sec in entry.m_all_contents():
if isinstance(sec, ActivityStep):
self.steps.append(sec)
sec_c = sec.m_copy()
self.steps.append(sec_c)
elif isinstance(sec, basesections.Instrument):
ref = InstrumentReference(name=sec.name)
ref.reference = sec
Expand All @@ -133,7 +136,8 @@ def normalize(self, archive, logger):
ref.reference = sec
self.samples.append(ref)
elif isinstance(sec, ActivityResult):
self.results.append(sec)
sec_c = sec.m_copy()
self.results.append(sec_c)
if self.m_def.name == "Root":
self.method = "Generic Experiment"
else:
Expand Down

0 comments on commit 8eabf38

Please sign in to comment.