def test_runC5G7(self): """ Run C5G7 in basic no-op app and load from the result. """ o = armi.init(fName=TEST_INPUT_TITLE + ".yaml") o.operate() o2 = db.loadOperator(TEST_INPUT_TITLE + ".h5", 0, 0)
def invoke(self): srcDB = db.databaseFactory(dbName=self.args.srcDB, permission=db.Permissions.READ_ONLY_FME) tarDB = db.databaseFactory(dbName=self.args.tarDB, permission=db.Permissions.CREATE_FILE_TIE) cs = settings.Settings(fName=self.args.csPath) with directoryChangers.DirectoryChanger(cs.inputDirectory): o = armi.init(cs=cs) db.copyDatabase(o.r, srcDB, tarDB)
def test_loadC5G7(self): """ Load the C5G7 case and check basic counts. """ o = armi.init(fName="c5g7-settings.yaml") b = o.r.core.getFirstBlock(Flags.MOX) # there are 100 of each high, medium, and low MOX pins fuelPinsHigh = b.getComponent(Flags.HIGH | Flags.MOX) self.assertEqual(fuelPinsHigh.getDimension("mult"), 100) gt = b.getComponent(Flags.GUIDE_TUBE) self.assertEqual(gt.getDimension("mult"), 24)
def setUpClass(cls): runTutorialNotebook() with directoryChangers.DirectoryChanger(TUTORIAL_DIR): reloadCs = settings.Settings(f"{CASE_TITLE}.yaml") reloadCs.caseTitle = "armiRun" reloadCs["db"] = True reloadCs["reloadDBName"] = f"{CASE_TITLE}.h5" reloadCs["runType"] = "Snapshots" reloadCs["loadStyle"] = "fromDB" reloadCs["detailAssemLocationsBOL"] = ["A1001"] o = armi.init(cs=reloadCs) cls.o = o
def test_runAndLoadC5G7(self): """ Run C5G7 in basic no-op app and load from the result from DB. This ensures that these kinds of cases can be read from DB. """ def _loadLocs(o, locs): for b in o.r.core.getBlocks(): indices = b.spatialLocator.getCompleteIndices() locs[indices] = b.spatialLocator.getGlobalCoordinates() o = armi.init(fName=TEST_INPUT_TITLE + ".yaml") locsInput, locsDB = {}, {} _loadLocs(o, locsInput) o.operate() o2 = db.loadOperator(TEST_INPUT_TITLE + ".h5", 0, 0) _loadLocs(o2, locsDB) for indices, coordsInput in sorted(locsInput.items()): coordsDB = locsDB[indices] self.assertTrue(numpy.allclose(coordsInput, coordsDB))
def setUpClass(cls): # Not using a directory changer since it isn't important that we go back in the # first place, and we don't want to get tangled with the directory change below. # We need to be in the TUTORIAL_DIR in the first place so that for `filesToMove` # to work right. os.chdir(TUTORIAL_DIR) # Make sure to do this work in a temporary directory to avoid race conditions # when running tests in parallel with xdist. cls.dirChanger = directoryChangers.TemporaryDirectoryChanger( filesToMove=TUTORIAL_FILES) cls.dirChanger.__enter__() runTutorialNotebook() reloadCs = settings.Settings(f"{CASE_TITLE}.yaml") reloadCs.caseTitle = "armiRun" reloadCs["db"] = True reloadCs["reloadDBName"] = pathlib.Path(f"{CASE_TITLE}.h5").absolute() reloadCs["runType"] = "Snapshots" reloadCs["loadStyle"] = "fromDB" reloadCs["detailAssemLocationsBOL"] = ["001-001"] o = armi.init(cs=reloadCs) cls.o = o