Esempio n. 1
0
    def invoke(self):
        from armi import cases

        if not os.path.exists(self.args.reference):
            runLog.error(
                "Could not find reference directory {}".format(self.args.reference)
            )
            sys.exit(1)

        if not os.path.exists(self.args.comparison):
            runLog.error(
                "Could not find comparison directory {}".format(self.args.comparison)
            )
            sys.exit(1)

        refSuite = cases.CaseSuite(self.cs)

        # contains all tests that user had access to
        allTests = []
        for pat in self.args.patterns + self.args.additional_comparisons:
            name, ext = os.path.splitext(pat)
            allTests.append(pat)
            if ext == ".yaml":
                # auto-add XML variants of yaml settings
                # to accommodate comparisons against xml suites (e.g. testing)
                xmlName = name + ".xml"
                runLog.extra("Including {} in reference patterns.".format(xmlName))
                allTests.append(xmlName)
        refSuite.discover(
            rootDir=self.args.reference,
            patterns=allTests,
            ignorePatterns=self.args.ignore,
        )

        cmpSuite = cases.CaseSuite(self.cs)
        cmpSuite.discover(
            rootDir=self.args.comparison,
            patterns=self.args.patterns,
            ignorePatterns=self.args.ignore,
        )

        nIssues = refSuite.compare(
            cmpSuite,
            weights=self.args.weights,
            tolerance=self.args.tolerance,
            exclusion=self.args.exclude,
            timestepMatchup=self.args.timestepMatchup,
        )

        if nIssues > 0:
            sys.exit(nIssues)
Esempio n. 2
0
    def invoke(self):
        from armi import cases

        suite = cases.CaseSuite(self.cs)
        suite.discover(
            patterns=self.args.patterns,
            rootDir=self.args.directory,
            ignorePatterns=self.args.ignore,
        )
        suite.clone(oldRoot=self.args.directory)
Esempio n. 3
0
 def invoke(self):
     with directoryChangers.DirectoryChanger(
         self.args.suiteDir, dumpOnException=False
     ):
         suite = cases.CaseSuite(self.cs)
         suite.discover(patterns=self.args.patterns, ignorePatterns=self.args.ignore)
         if self.args.list:
             suite.echoConfiguration()
         else:
             suite.run()
Esempio n. 4
0
    def invoke(self):
        from armi import cases

        if not os.path.exists(self.args.reference):
            runLog.error("Could not find reference directory {}".format(
                self.args.reference))
            sys.exit(1)

        if not os.path.exists(self.args.comparison):
            runLog.error("Could not find comparison directory {}".format(
                self.args.comparison))
            sys.exit(1)

        refSuite = cases.CaseSuite(self.cs)

        # contains all tests that user had access to
        allTests = []
        for pat in self.args.patterns + self.args.additional_comparisons:
            allTests.append(pat)
        refSuite.discover(
            rootDir=self.args.reference,
            patterns=allTests,
            ignorePatterns=self.args.ignore,
        )

        cmpSuite = cases.CaseSuite(self.cs)
        cmpSuite.discover(
            rootDir=self.args.comparison,
            patterns=self.args.patterns,
            ignorePatterns=self.args.ignore,
        )

        nIssues = refSuite.compare(
            cmpSuite,
            weights=self.args.weights,
            tolerance=self.args.tolerance,
            exclusion=self.args.exclude,
            timestepMatchup=self.args.timestepMatchup,
        )

        if nIssues > 0:
            sys.exit(nIssues)
Esempio n. 5
0
    def setUp(self):
        self.suite = cases.CaseSuite(settings.Settings())

        geom = systemLayoutInput.SystemLayoutInput()
        geom.readGeomFromStream(io.StringIO(GEOM_INPUT))
        bp = blueprints.Blueprints.load(BLUEPRINT_INPUT)

        self.c1 = cases.Case(cs=settings.Settings(), geom=geom, bp=bp)
        self.c1.cs.path = "c1.yaml"
        self.suite.add(self.c1)

        self.c2 = cases.Case(cs=settings.Settings(), geom=geom, bp=bp)
        self.c2.cs.path = "c2.yaml"
        self.suite.add(self.c2)
Esempio n. 6
0
 def invoke(self):
     with directoryChangers.DirectoryChanger(self.args.suiteDir,
                                             dumpOnException=False):
         suite = cases.CaseSuite(self.cs)
         suite.discover(patterns=self.args.patterns,
                        ignorePatterns=self.args.ignore)
         if self.args.list:
             suite.echoConfiguration()
         else:
             for ci, case in enumerate(suite):
                 runLog.important(
                     f"Running case {ci+1}/{len(suite)}: {case}")
                 with directoryChangers.DirectoryChanger(case.directory):
                     settings.setMasterCs(case.cs)
                     case.run()
Esempio n. 7
0
    def invoke(self):
        import tabulate
        from armi import cases

        suite = cases.CaseSuite(self.cs)
        suite.discover(patterns=self.args.patterns, recursive=self.args.recursive)

        table = []  # tuples (case, hasIssues, hasErrors)
        for case in suite:
            hasIssues = "UNKNOWN"
            if not self.args.skip_checks:
                hasIssues = "PASSED" if case.checkInputs() else "HAS ISSUES"
            try:
                if self.args.generate_design_summary:
                    case.summarizeDesign(
                        self.args.full_core_map, not self.args.disable_block_axial_mesh
                    )
                    canStart = "PASSED"
                else:
    def _postProcess(self, suite=None):
        from armi import cases
        from armi.bookkeeping.db import databaseFactory

        if suite is None:
            cs = self._initSettings()
            suite = cases.CaseSuite(cs)
            suite.discover(rootDir="case-suite", patterns=["armiRun-????.yaml"])
        keffs = {}
        for case in suite:
            sym = f'-{case.bp.gridDesigns["core"].symmetry}'
            kern = case.cs[CONF_NEUTRONICS_KERNEL]
            order = case.cs[CONF_VARIANT_TRANSPORT_AND_SCATTER_ORDER]
            ntype = case.cs[CONF_NEUTRONICS_TYPE]
            with directoryChangers.DirectoryChanger(case.directory):
                db = databaseFactory(case.cs.caseTitle + ".h5", "r")
                with db:
                    r = db.load(0, 0)
                    keffs[kern + order + sym, ntype] = r.core.p.keff