示例#1
0
    def summarizeDesign(self,
                        generateFullCoreMap=True,
                        showBlockAxialMesh=True):
        """Uses the ReportInterface to create a fancy HTML page describing the design inputs."""
        settings.setMasterCs(self.cs)
        o = self.initializeOperator()
        with DirectoryChanger(self.cs.inputDirectory, dumpOnException=False):
            # There are global variables that are modified when a report is
            # generated, so reset it all
            six.moves.reload_module(report)  # pylint: disable=too-many-function-args
            self.cs.setSettingsReport()
            rpi = o.getInterface("report")

            if rpi is None:
                rpi = reportInterface.ReportInterface(o.r, o.cs)

            rpi.generateDesignReport(generateFullCoreMap, showBlockAxialMesh)
            report.DESIGN.writeHTML()
            runLog.important(
                "Design report summary was successfully generated")
示例#2
0
文件: case.py 项目: ntouran/armi
    def checkInputs(self):
        """
        Checks ARMI inputs for consistency.

        Returns
        -------
        bool
            True if the inputs are all good, False otherwise
        """
        with DirectoryChanger(self.cs.inputDirectory, dumpOnException=False):
            operatorClass = operators.getOperatorClassFromSettings(self.cs)
            inspector = operatorClass.inspector(self.cs)
            inspectorIssues = [query for query in inspector.queries if query]
            if context.CURRENT_MODE == context.Mode.INTERACTIVE:
                # if interactive, ask user to deal with settings issues
                inspector.run()
            else:
                # when not interactive, just print out the info in the stdout
                queryData = []
                for i, query in enumerate(inspectorIssues, start=1):
                    queryData.append((
                        i,
                        textwrap.fill(query.statement,
                                      width=50,
                                      break_long_words=False),
                        textwrap.fill(query.question,
                                      width=50,
                                      break_long_words=False),
                    ))

                if queryData and context.MPI_RANK == 0:
                    runLog.header(
                        "=========== Settings Input Queries ===========")
                    runLog.info(
                        tabulate.tabulate(
                            queryData,
                            headers=["Number", "Statement", "Question"],
                            tablefmt="armi",
                        ))

            return not any(inspectorIssues)