當前位置: 首頁>>代碼示例>>Python>>正文


Python BriPy類代碼示例

本文整理匯總了Python中BriPy的典型用法代碼示例。如果您正苦於以下問題:Python BriPy類的具體用法?Python BriPy怎麽用?Python BriPy使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BriPy類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_writeText

 def test_writeText(self):
     BriPy.isos2track([922350])
     fcc = FCComp(["Mass"])
     fcc.IsosIn  = MassStream({922350: 1.0})
     fcc.IsosOut = MassStream({922350: 0.5})
     fcc.setParams()
     fcc.writeText()
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_FCComp.py

示例2: test_doCalc_3

 def test_doCalc_3(self):
     BriPy.isos2track([922350, 922380, 942390])
     s = Storage()
     s.IsosIn = MassStream({942390: 1.0})
     s.doCalc(24110*365.25*24*3600)
     assert(s.IsosOut.mass < 1.0)
     assert_almost_equal(s.IsosOut.comp[942390], 0.5, 3) 
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_Storage.py

示例3: test_doCalc_1

 def test_doCalc_1(self):
     BriPy.isos2track([922350, 922380, 942390])
     r = Reprocess({"U235": 0.9, "922380": 0.999, "94239": 0.99})
     r.IsosIn = MassStream({942390: 1.0})
     r.doCalc()
     assert_equal(r.IsosOut.mass, 0.99)
     assert_equal(r.IsosOut.comp[942390], 1.0)  # Recall ms.comp is normalized
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_Reprocess.py

示例4: test_setParams

 def test_setParams(self):
     BriPy.isos2track([922350, 922380, 942390])
     s = Storage()
     s.doCalc(MassStream({942390: 1.0}), 24110*365.25*24*3600)
     s.setParams()
     assert_equal(s.ParamsIn["Mass"],  1.00)
     assert(0.5 < s.ParamsOut["Mass"] < 1.0)
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_Storage.py

示例5: test_writeout_1

 def test_writeout_1(self):
     """Text only."""
     BriPy.isos2track([922350])
     fcc = FCComp(["Mass"])
     fcc.IsosIn  = MassStream({922350: 1.0})
     fcc.IsosOut = MassStream({922350: 0.5})
     fcc.writeout()
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_FCComp.py

示例6: test_doCalc_2

 def test_doCalc_2(self):
     BriPy.isos2track([922350, 922380, 942390])
     s = Storage()
     s.decay_time = 0.0
     s.doCalc(MassStream({942390: 1.0}))
     assert_equal(s.IsosOut.mass, 1.0)
     assert_equal(s.IsosOut.comp[942390], 1.0) 
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_Storage.py

示例7: test_setParams

 def test_setParams(self):
     BriPy.isos2track([922350, 922380, 942390])
     r = Reprocess({"U235": 0.9, "922380": 0.999, "94239": 0.99})
     r.doCalc(MassStream({942390: 1.0}))
     r.setParams()
     assert_equal(r.ParamsIn["Mass"], 1.00)
     assert_equal(r.ParamsOut["Mass"], 0.99)
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_Reprocess.py

示例8: setup_class

 def setup_class(cls):
     libfile = os.getenv("BRIGHT_DATA") + '/LWR.h5'
     BriPy.load_isos2track_hdf5(libfile)
     cls.r1g = Reactor1G(default_rp, 'r1g')
     cls.r1g.loadLib(libfile)
     cls.r1g.IsosIn = MassStream({922350: 0.5, 922380: 0.5})
     cls.r1g.doCalc()
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_Reactor1G.py

示例9: test_initialize_3

 def test_initialize_3(self):
     BriPy.isos2track([922350, 922380, 942390])
     r = Reprocess({"U235": 0.9, "922380": 0.999, "PU2390": 0.99})
     r.initialize({92: 0.99})
     assert_almost_equal(r.sepeff[922350], 0.99)
     assert_almost_equal(r.sepeff[922380], 0.99)
     assert_almost_equal(r.sepeff[942390], 1.0)
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_Reprocess.py

示例10: test_initialize_1

 def test_initialize_1(self):
     BriPy.isos2track([922350, 922380, 942390])
     r = Reprocess()
     assert_equal(r.sepeff, {})
     r.initialize({92: 0.99, 942390: 0.9})
     assert_almost_equal(r.sepeff[922350], 0.99)
     assert_almost_equal(r.sepeff[922380], 0.99)
     assert_almost_equal(r.sepeff[942390], 0.9)
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:8,代碼來源:test_Reprocess.py

示例11: test_Reprocess_2

 def test_Reprocess_2(self):
     BriPy.isos2track([922350, 922380, 942390])
     r = Reprocess({"U235": 0.9, "922380": 0.999, "94239": 0.99})
     assert_equal(r.name, "")
     assert_almost_equal(r.sepeff[922350], 0.9)
     assert_almost_equal(r.sepeff[922380], 0.999)
     assert_almost_equal(r.sepeff[942390], 0.99)
     assert_equal(r.params2track, ["Mass"])
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:8,代碼來源:test_Reprocess.py

示例12: test_writeHDF5_1

 def test_writeHDF5_1(self):
     BriPy.isos2track([922350])
     BriPy.write_hdf5(True)
     fcc = FCComp([], 'fcc')
     fcc.IsosIn  = MassStream({922350: 1.0})
     fcc.IsosOut = MassStream({922350: 0.5})
     fcc.PassNum = 1
     fcc.writeHDF5()
     os.remove('fcc.h5')
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:9,代碼來源:test_FCComp.py

示例13: test_write_hdf5

 def test_write_hdf5(self):
     old_write = BriPy.write_hdf5()
     BriPy.write_hdf5(False)
     assert_false(BriPy.write_hdf5())
     BriPy.write_hdf5(1)
     assert_true(BriPy.write_hdf5())
     BriPy.write_hdf5(old_write)
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_bright.py

示例14: test_write_text

 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)
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:7,代碼來源:test_bright.py

示例15: test_setParams

 def test_setParams(self):
     lf = os.getenv("BRIGHT_DATA") + "/LWR.h5"
     BriPy.load_isos2track_hdf5(lf)
     rp = BriPy.LWRDefaults()
     rp.BUt = 50.0
     lwr = LightWaterReactor1G(lf, rp, 'lwr')
     lwr.doCalc(MassStream({922350: 0.05, 922380:0.95}))
     lwr.setParams()
     assert_equal(lwr.ParamsIn["BUd"],  0.0)
     assert_equal(lwr.ParamsOut["BUd"], lwr.BUd)
     assert_equal(lwr.ParamsIn["U"],  lwr.InU.mass)
     assert_equal(lwr.ParamsOut["U"], lwr.OutU.mass)
     assert_equal(lwr.ParamsIn["TRU"],  lwr.InTRU.mass)
     assert_equal(lwr.ParamsOut["TRU"], lwr.OutTRU.mass)
     assert_equal(lwr.ParamsIn["ACT"],  lwr.InACT.mass)
     assert_equal(lwr.ParamsOut["ACT"], lwr.OutACT.mass)
     assert_equal(lwr.ParamsIn["LAN"],  lwr.InLAN.mass)
     assert_equal(lwr.ParamsOut["LAN"], lwr.OutLAN.mass)
     assert_equal(lwr.ParamsIn["FP"],  1.0 - lwr.InACT.mass - lwr.InLAN.mass)
     assert_equal(lwr.ParamsOut["FP"], 1.0 - lwr.OutACT.mass - lwr.OutLAN.mass)
開發者ID:sylvainvayre,項目名稱:bright,代碼行數:20,代碼來源:test_LightWaterReactor1G.py


注:本文中的BriPy類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。