def test_mgxs_library_distribcell(): model = pwr_assembly() harness = MGXSTestHarness('statepoint.10.h5', model) harness.main()
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) # Average the MGXS across distribcell subdomains avg_lib = self.mgxs_lib.get_subdomain_avg_library() # Build a string from Pandas Dataframe for each 1-group MGXS outstr = '' for domain in avg_lib.domains: for mgxs_type in avg_lib.mgxs_types: mgxs = avg_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_assembly() harness = MGXSTestHarness('statepoint.10.h5', model) harness.main()