mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Make StatePoint a context manager
This commit is contained in:
parent
fc0c907030
commit
f4d3ee7de5
1 changed files with 6 additions and 0 deletions
|
|
@ -138,6 +138,12 @@ class StatePoint(object):
|
|||
vol = openmc.VolumeCalculation.from_hdf5(path_i)
|
||||
self.add_volume_information(vol)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc):
|
||||
self._f.close()
|
||||
|
||||
@property
|
||||
def cmfd_on(self):
|
||||
return self._f.attrs['cmfd_on'] > 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue