njoy / ENDFtk

Toolkit for reading and interacting with ENDF-6 formatted files
Other
33 stars 5 forks source link

Fix/temp objects #179

Closed whaeck closed 10 months ago

whaeck commented 1 year ago

Fixing an issue with temporary objects coming out of parsed MF objects.

The following code in Python did not work:

tape = ENDFtk.tree.Tape.from_file(...)
mf3 = tape.materials.front().file(3).parse()

mf3.section(102).cross_sections[0]

The object returned by mf3.section(102) got garbage collected it seems.

whaeck commented 10 months ago

5 months waiting for a review. I'm admin merging this to get it over with.