def test_mgxs_library_hdf5(): try: np.set_printoptions(formatter={'float_kind': '{:.8e}'.format}) model = pwr_pin_cell() harness = MGXSTestHarness('statepoint.10.h5', model) harness.main() finally: np.set_printoptions(formatter=None)
"""Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0] sp = openmc.StatePoint(statepoint) # Load the MGXS library from the statepoint self.mgxs_lib.load_from_statepoint(sp) # Build a string from Pandas Dataframe for each MGXS outstr = '' for domain in self.mgxs_lib.domains: for mgxs_type in self.mgxs_lib.mgxs_types: mgxs = self.mgxs_lib.get_mgxs(domain, mgxs_type) df = mgxs.get_pandas_dataframe() outstr += df.to_string() + '\n' # Hash the results if necessary if hash_output: sha512 = hashlib.sha512() sha512.update(outstr.encode('utf-8')) outstr = sha512.hexdigest() return outstr if __name__ == '__main__': model = pwr_pin_cell() harness = MGXSTestHarness('statepoint.10.h5', model) harness.main()
def test_mgxs_library_condense(): # Use the pincell model model = pwr_pin_cell() harness = MGXSTestHarness('statepoint.10.h5', model) harness.main()
def test_mgxs_library_ce_to_mg(): # Set the input set to use the pincell model model = pwr_pin_cell() harness = MGXSTestHarness('statepoint.10.h5', model) harness.main()
def test_mgxs_library_correction(): model = pwr_pin_cell() harness = MGXSTestHarness('statepoint.10.h5', model) harness.main()
def test_mgxs_library_no_nuclides(): model = pwr_pin_cell() harness = MGXSTestHarness('statepoint.10.h5', model) harness.main()