def test_writeout_3(self): """HDF5 & Text output.""" BriPy.isos2track([922350]) BriPy.write_hdf5(True) BriPy.write_text(True) fcc = FCComp(["Mass"], 'fcc') fcc.IsosIn = MassStream({922350: 1.0}) fcc.IsosOut = MassStream({922350: 0.5}) fcc.writeout() os.remove('fcc.h5')
def test_write_text(self): old_write = BriPy.write_text() BriPy.write_text(False) assert_false(BriPy.write_text()) BriPy.write_text(1) assert_true(BriPy.write_text()) BriPy.write_text(old_write)
import os import sys import time import tables as tb import BriPy as bp from facility_info import get_reactor_id_map # Load isos2track data_dir = os.getenv("BRIGHT_DATA") lwr_data = data_dir + "/LWR.h5" bp.load_isos2track_hdf5(lwr_data) # We are going to capture the output, so don't write it out automatically. bp.write_text(False) bp.write_hdf5(False) # Generate a used fuel table description UsedFuel = { 'assembly_id': tb.StringCol(itemsize=15, pos=0), 'discharge_k': tb.Float64Col(pos=1), 'mass': tb.Float64Col(pos=2), } nbuf = len(UsedFuel) i2t = bp.isos2track() for i in xrange(len(i2t)): UsedFuel[bp.isoname.zzaaam_2_LLAAAM(i2t[i])] = tb.Float64Col(pos=nbuf + i)