Adding StatePoint.close(). Updating some examples.

This commit is contained in:
Patrick Shriwise 2021-04-19 09:34:17 -05:00
parent b62708f911
commit 983470ed4e
4 changed files with 175 additions and 142 deletions

View file

@ -1 +0,0 @@
../../tests/chain_simple.xml

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -153,9 +153,7 @@ class StatePoint:
return self
def __exit__(self, *exc):
self._f.close()
if self._summary is not None:
self._summary._f.close()
self.close()
@property
def cmfd_on(self):
@ -490,6 +488,14 @@ class StatePoint:
for tally_id in self.tallies:
self.tallies[tally_id].sparse = self.sparse
def close(self):
"""Close the statepoint HDF5 file and the corresponding
summary HDF5 file if present.
"""
self._f.close()
if self._summary is not None:
self._summary._f.close()
def add_volume_information(self, volume_calc):
"""Add volume information to the geometry within the file