diff --git a/.gitignore b/.gitignore index e64adfe9f..b301d4cda 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ coverage_results.* dist-*/ dist/ doc/_build +doc/anl-afci-177 doc/gallery doc/gallery-src/framework/*.yaml doc/tutorials/anl-afci-177* diff --git a/armi/bookkeeping/db/tests/test_database3.py b/armi/bookkeeping/db/tests/test_database3.py index 9a413da52..4e5c83816 100644 --- a/armi/bookkeeping/db/tests/test_database3.py +++ b/armi/bookkeeping/db/tests/test_database3.py @@ -535,7 +535,7 @@ def test_open(self): def test_loadCS(self): cs = self.db.loadCS() - self.assertEqual(cs["numProcessors"], 1) + self.assertEqual(cs["nTasks"], 1) self.assertEqual(cs["nCycles"], 2) def test_loadBlueprints(self): diff --git a/armi/bookkeeping/report/newReportUtils.py b/armi/bookkeeping/report/newReportUtils.py index a4fd7f68b..98c14bf92 100644 --- a/armi/bookkeeping/report/newReportUtils.py +++ b/armi/bookkeeping/report/newReportUtils.py @@ -426,7 +426,7 @@ def insertSettingsData(cs, report): "burnSteps", "skipCycles", "cycleLength", - "numProcessors", + "nTasks", ]: report[COMPREHENSIVE_REPORT][CASE_PARAMETERS].addRow([key, cs[key]]) diff --git a/armi/bookkeeping/tests/_constants.py b/armi/bookkeeping/tests/_constants.py index 9e743495a..8002d27ec 100644 --- a/armi/bookkeeping/tests/_constants.py +++ b/armi/bookkeeping/tests/_constants.py @@ -18,13 +18,17 @@ also re-exported by `__init__.py`, so that other things (like the documentation system) can use it without having to import the rest of ARMI. """ +import os + +from armi.tests import TEST_ROOT + # These files are needed to run the data_model ipython notebook, which is done in # test_historyTracker, and when building the docs. TUTORIAL_FILES = [ - "anl-afci-177-blueprints.yaml", - "anl-afci-177-coreMap.yaml", - "anl-afci-177-fuelManagement.py", - "anl-afci-177.yaml", - "data_model.ipynb", + os.path.join(TEST_ROOT, "anl-afci-177", "anl-afci-177-blueprints.yaml"), + os.path.join(TEST_ROOT, "anl-afci-177", "anl-afci-177-coreMap.yaml"), + os.path.join(TEST_ROOT, "anl-afci-177", "anl-afci-177-fuelManagement.py"), + os.path.join(TEST_ROOT, "anl-afci-177", "anl-afci-177.yaml"), + os.path.join(TEST_ROOT, "tutorials", "data_model.ipynb"), ] diff --git a/armi/bookkeeping/tests/test_historyTracker.py b/armi/bookkeeping/tests/test_historyTracker.py index 7195aea15..3a18f7ac3 100644 --- a/armi/bookkeeping/tests/test_historyTracker.py +++ b/armi/bookkeeping/tests/test_historyTracker.py @@ -56,12 +56,21 @@ class TestHistoryTracker(ArmiTestHelper): @classmethod def setUpClass(cls): - # We need to be in the TUTORIAL_DIR so that for `filesToMove` to work right. - os.chdir(TUTORIAL_DIR) - # Do this work in a temp dir, to avoid race conditions. - cls.dirChanger = TemporaryDirectoryChanger(filesToMove=TUTORIAL_FILES) + cls.dirChanger = TemporaryDirectoryChanger() cls.dirChanger.__enter__() + + os.mkdir("tutorials") + os.mkdir(CASE_TITLE) + + for filePath in TUTORIAL_FILES: + dirName = CASE_TITLE if CASE_TITLE in filePath else "tutorials" + outFile = os.path.join( + cls.dirChanger.destination, dirName, os.path.basename(filePath) + ) + shutil.copyfile(filePath, outFile) + + os.chdir(os.path.join(cls.dirChanger.destination, "tutorials")) runTutorialNotebook() @classmethod @@ -69,7 +78,7 @@ def tearDownClass(cls): cls.dirChanger.__exit__(None, None, None) def setUp(self): - cs = settings.Settings(f"{CASE_TITLE}.yaml") + cs = settings.Settings(f"../{CASE_TITLE}/{CASE_TITLE}.yaml") newSettings = {} newSettings["db"] = True newSettings["nCycles"] = 2 diff --git a/armi/cases/tests/test_suiteBuilder.py b/armi/cases/tests/test_suiteBuilder.py index 4f1c5780e..81c94c639 100644 --- a/armi/cases/tests/test_suiteBuilder.py +++ b/armi/cases/tests/test_suiteBuilder.py @@ -33,7 +33,7 @@ "..", "..", "tests", - "tutorials", + "anl-afci-177", "anl-afci-177.yaml", ) ) diff --git a/armi/cli/modify.py b/armi/cli/modify.py index 75c557a58..197f9f8bf 100644 --- a/armi/cli/modify.py +++ b/armi/cli/modify.py @@ -30,7 +30,7 @@ class ModifyCaseSettingsCommand(EntryPoint): Run the entry point like this:: - $ python -m armi modify --numProcessors=3 *.yaml + $ python -m armi modify --nTasks=3 *.yaml """ diff --git a/armi/cli/tests/test_runEntryPoint.py b/armi/cli/tests/test_runEntryPoint.py index b0e541d65..9ba20f072 100644 --- a/armi/cli/tests/test_runEntryPoint.py +++ b/armi/cli/tests/test_runEntryPoint.py @@ -369,15 +369,15 @@ def test_modifyCaseSettingsCommandInvoke(self): for fileName in ["armiRun.yaml", "refSmallReactor.yaml"]: copyfile(os.path.join(TEST_ROOT, fileName), fileName) - # pass in --numProcessors=333 - mcs.parse_args(["--numProcessors=333", "--rootDir", ".", "armiRun.yaml"]) + # pass in --nTasks=333 + mcs.parse_args(["--nTasks=333", "--rootDir", ".", "armiRun.yaml"]) # invoke the CLI mcs.invoke() - # validate the change to numProcessors was made + # validate the change to nTasks was made txt = open("armiRun.yaml", "r").read() - self.assertIn("numProcessors: 333", txt) + self.assertIn("nTasks: 333", txt) class TestReportsEntryPoint(unittest.TestCase): diff --git a/armi/settings/fwSettings/globalSettings.py b/armi/settings/fwSettings/globalSettings.py index 3b1143880..43eb9209f 100644 --- a/armi/settings/fwSettings/globalSettings.py +++ b/armi/settings/fwSettings/globalSettings.py @@ -80,10 +80,9 @@ CONF_MATERIAL_NAMESPACE_ORDER = "materialNamespaceOrder" CONF_MIN_MESH_SIZE_RATIO = "minMeshSizeRatio" CONF_MODULE_VERBOSITY = "moduleVerbosity" -CONF_MPI_TASKS_PER_NODE = "mpiTasksPerNode" CONF_N_CYCLES = "nCycles" CONF_NON_UNIFORM_ASSEM_FLAGS = "nonUniformAssemFlags" -CONF_NUM_PROCESSORS = "numProcessors" +CONF_N_TASKS = "nTasks" CONF_OPERATOR_LOCATION = "operatorLocation" CONF_OUTPUT_CACHE_LOCATION = "outputCacheLocation" CONF_OUTPUT_FILE_EXTENSION = "outputFileExtension" @@ -154,11 +153,12 @@ def defineSettings() -> List[setting.Setting]: """ settings = [ setting.Setting( - CONF_NUM_PROCESSORS, + CONF_N_TASKS, default=1, - label="CPUs", - description="Number of CPUs to request on the cluster", + label="parallel tasks", + description="Number of parallel tasks to request on the cluster", schema=vol.All(vol.Coerce(int), vol.Range(min=1)), + oldNames=[("numProcessors", None)], ), setting.Setting( CONF_INITIALIZE_BURN_CHAIN, @@ -587,14 +587,6 @@ def defineSettings() -> List[setting.Setting]: description="Description needed", schema=vol.All(vol.Coerce(float), vol.Range(min=0, max=1)), ), - setting.Setting( - CONF_MPI_TASKS_PER_NODE, - default=0, - label="MPI Tasks per Node", - description="Number of independent processes that are allocated to each " - "cluster node. 0 means 1 process per CPU.", - schema=vol.All(vol.Coerce(int), vol.Range(min=0)), - ), setting.Setting( CONF_N_CYCLES, default=1, diff --git a/armi/settings/fwSettings/tests/test_fwSettings.py b/armi/settings/fwSettings/tests/test_fwSettings.py index 724a6f4db..065372686 100644 --- a/armi/settings/fwSettings/tests/test_fwSettings.py +++ b/armi/settings/fwSettings/tests/test_fwSettings.py @@ -26,7 +26,7 @@ class TestSchema(unittest.TestCase): def setUp(self): self.cs = caseSettings.Settings() self.settings = { - "numProcessors": { + "nTasks": { "valid": 1, "invalid": -1, "error": vol.error.MultipleInvalid, @@ -91,11 +91,6 @@ def setUp(self): "invalid": 2, "error": vol.error.MultipleInvalid, }, - "mpiTasksPerNode": { - "valid": 0, - "invalid": -1, - "error": vol.error.MultipleInvalid, - }, "nCycles": {"valid": 1, "invalid": -1, "error": vol.error.MultipleInvalid}, "power": {"valid": 0, "invalid": -1, "error": vol.error.MultipleInvalid}, "skipCycles": { diff --git a/armi/settings/tests/test_inspectors.py b/armi/settings/tests/test_inspectors.py index fe6361759..cb27b3e96 100644 --- a/armi/settings/tests/test_inspectors.py +++ b/armi/settings/tests/test_inspectors.py @@ -152,10 +152,10 @@ def test_assignCS(self): self.assertIn("nCycles", keys) def test_createQueryRevertBadPathToDefault(self): - query = createQueryRevertBadPathToDefault(self.inspector, "numProcessors") + query = createQueryRevertBadPathToDefault(self.inspector, "nTasks") self.assertEqual( str(query), - "", + "", ) def test_correctCyclesToZeroBurnup(self): diff --git a/armi/settings/tests/test_settings.py b/armi/settings/tests/test_settings.py index 4deeb9d87..3cfae7386 100644 --- a/armi/settings/tests/test_settings.py +++ b/armi/settings/tests/test_settings.py @@ -324,7 +324,7 @@ def test_getSettingsSetByUser(self): # some default settings values for sett in ["availabilityFactor", "db"]: self.assertIn(sett, settingsList) - self.assertNotIn("numProcessors", settingsList) + self.assertNotIn("nTasks", settingsList) def test_setModuleVerbosities(self): # init settings and use them to set module-level logging levels diff --git a/armi/settings/tests/test_settingsIO.py b/armi/settings/tests/test_settingsIO.py index 36dd72371..9b99f1b3c 100644 --- a/armi/settings/tests/test_settingsIO.py +++ b/armi/settings/tests/test_settingsIO.py @@ -63,7 +63,7 @@ def setUp(self): def test_basicSettingsReader(self): reader = settingsIO.SettingsReader(self.cs) - self.assertEqual(reader["numProcessors"], 1) + self.assertEqual(reader["nTasks"], 1) self.assertEqual(reader["nCycles"], 1) self.assertFalse(getattr(reader, "filelessBP")) @@ -165,7 +165,7 @@ def test_writeShort(self): self.cs.loadFromInputFile(self.filepathYaml) txt = open(self.filepathYaml, "r").read() self.assertIn("nCycles: 55", txt) - self.assertNotIn("numProcessors", txt) + self.assertNotIn("nTasks", txt) def test_writeMedium(self): """Setting output as a sparse file that only includes defaults if they are @@ -173,10 +173,10 @@ def test_writeMedium(self): """ with open(self.filepathYaml, "w") as stream: # Specify a setting that is also a default - self.cs.writeToYamlStream(stream, "medium", ["numProcessors"]) + self.cs.writeToYamlStream(stream, "medium", ["nTasks"]) txt = open(self.filepathYaml, "r").read() self.assertIn("nCycles: 55", txt) - self.assertIn("numProcessors: 1", txt) + self.assertIn("nTasks: 1", txt) def test_writeFull(self): """Setting output as a full, all defaults included file. @@ -189,7 +189,7 @@ def test_writeFull(self): txt = open(self.filepathYaml, "r").read() self.assertIn("nCycles: 55", txt) # check a default setting - self.assertIn("numProcessors: 1", txt) + self.assertIn("nTasks: 1", txt) def test_writeYaml(self): self.cs.writeToYamlFile(self.filepathYaml) diff --git a/armi/tests/tutorials/anl-afci-177-blueprints.yaml b/armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml similarity index 100% rename from armi/tests/tutorials/anl-afci-177-blueprints.yaml rename to armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml diff --git a/armi/tests/tutorials/anl-afci-177-coreMap.yaml b/armi/tests/anl-afci-177/anl-afci-177-coreMap.yaml similarity index 100% rename from armi/tests/tutorials/anl-afci-177-coreMap.yaml rename to armi/tests/anl-afci-177/anl-afci-177-coreMap.yaml diff --git a/armi/tests/tutorials/anl-afci-177-fuelManagement.py b/armi/tests/anl-afci-177/anl-afci-177-fuelManagement.py similarity index 100% rename from armi/tests/tutorials/anl-afci-177-fuelManagement.py rename to armi/tests/anl-afci-177/anl-afci-177-fuelManagement.py diff --git a/armi/tests/tutorials/anl-afci-177.yaml b/armi/tests/anl-afci-177/anl-afci-177.yaml similarity index 100% rename from armi/tests/tutorials/anl-afci-177.yaml rename to armi/tests/anl-afci-177/anl-afci-177.yaml diff --git a/armi/tests/test_apps.py b/armi/tests/test_apps.py index a6b6ea7ee..c14ffe5a6 100644 --- a/armi/tests/test_apps.py +++ b/armi/tests/test_apps.py @@ -165,7 +165,7 @@ def test_getSettings(self): settings = app.getSettings() self.assertGreater(len(settings), 100) - self.assertEqual(settings["numProcessors"].value, 1) + self.assertEqual(settings["nTasks"].value, 1) self.assertEqual(settings["nCycles"].value, 1) def test_splashText(self): diff --git a/armi/tests/test_notebooks.py b/armi/tests/test_notebooks.py index e1ce2848a..6b21bacfc 100644 --- a/armi/tests/test_notebooks.py +++ b/armi/tests/test_notebooks.py @@ -28,6 +28,7 @@ from armi.tests import TEST_ROOT TUTORIALS = os.path.join(TEST_ROOT, "tutorials") +ANL_ACFI_177 = os.path.join(TEST_ROOT, "anl-afci-177") class NotebookTests(unittest.TestCase): diff --git a/armi/tests/tutorials/data_model.ipynb b/armi/tests/tutorials/data_model.ipynb index b71c61cc9..5d9d1e86b 100644 --- a/armi/tests/tutorials/data_model.ipynb +++ b/armi/tests/tutorials/data_model.ipynb @@ -53,7 +53,7 @@ "metadata": {}, "outputs": [], "source": [ - "o=armi.init(fName=\"anl-afci-177.yaml\");\n", + "o=armi.init(fName=\"../anl-afci-177/anl-afci-177.yaml\");\n", "o.r.core.sortAssemsByRing() # makes innermost assemblies appear first" ] }, @@ -468,7 +468,7 @@ "outputs": [], "source": [ "from armi.bookkeeping import db\n", - "databaseLocation = \"anl-afci-177.h5\"\n", + "databaseLocation = \"../tutorials/anl-afci-177.h5\"\n", "cycle, timeNode = 0, 1\n", "dbo = db.databaseFactory(databaseLocation, \"r\")\n", "with dbo:\n", diff --git a/armi/tests/tutorials/param_sweep.ipynb b/armi/tests/tutorials/param_sweep.ipynb index 5d5a4b74e..1108fe574 100644 --- a/armi/tests/tutorials/param_sweep.ipynb +++ b/armi/tests/tutorials/param_sweep.ipynb @@ -52,7 +52,7 @@ "from armi.cases import suiteBuilder\n", "from armi.cases.inputModifiers import inputModifiers\n", "\n", - "cs = settings.Settings('anl-afci-177.yaml')\n", + "cs = settings.Settings('../anl-afci-177/anl-afci-177.yaml')\n", "case = cases.Case(cs)" ] }, @@ -268,7 +268,7 @@ "source": [ "def loadSuite():\n", " print('Loading suite results...')\n", - " cs = settings.Settings('anl-afci-177.yaml')\n", + " cs = settings.Settings('../anl-afci-177/anl-afci-177.yaml')\n", " suite = cases.CaseSuite(cs)\n", " suite.discover(patterns=[\"anl-afci-177-????.yaml\"])\n", " suite = sorted(suite, key=lambda c: c.cs.inputDirectory)\n", diff --git a/armi/utils/directoryChangers.py b/armi/utils/directoryChangers.py index aeb6b46de..4f705943b 100644 --- a/armi/utils/directoryChangers.py +++ b/armi/utils/directoryChangers.py @@ -53,11 +53,11 @@ class DirectoryChanger: Filenames to bring back from the destination to the cwd. Note that if any of these files do not exist then the file will be skipped and a warning will be provided. dumpOnException : bool, optional - Flag to tell system to retrieve the entire directory if an exception - is raised within a the context manager. + Flag to tell system to retrieve the entire directory if an exception is raised within a the + context manager. outputPath : str, optional - Output path for filesToRetrieve. If None, default is the initial working directory - from which the DirectoryChanger is called. + Output path for filesToRetrieve. If None, default is the initial working directory from + which the DirectoryChanger is called. """ def __init__( @@ -177,10 +177,9 @@ def _transferFiles(initialPath, destinationPath, fileList): """ Transfer files into or out of the directory. - This is used in ``moveFiles`` and ``retrieveFiles`` to shuffle files about when - creating a target directory or when coming back, respectively. Beware that this - uses ``shutil.copy()`` under the hood, which doesn't play nicely with - directories. Future revisions should improve this. + This is used in ``moveFiles`` and ``retrieveFiles`` to shuffle files about when creating a + target directory or when coming back, respectively. Beware that this uses ``shutil.copy()`` + under the hood, which doesn't play nicely with directories. Parameters ---------- @@ -189,20 +188,22 @@ def _transferFiles(initialPath, destinationPath, fileList): destinationPath: str Path to the folder to move file to. fileList : list of str or list of tuple - File names to move from initial to destination. If this is a - simple list of strings, the files will be transferred. Alternatively - tuples of (initialName, finalName) are allowed if you want the file - renamed during transit. In the non-tuple option, globs/wildcards + File names to move from initial to destination. If this is a simple list of strings, the + files will be transferred. Alternatively tuples of (initialName, finalName) are allowed + if you want the file renamed during transit. In the non-tuple option, globs/wildcards are allowed. - .. warning:: On Windows the max number of characters in a path is 260. - If you exceed this you will see FileNotFound errors here. - + Warning + ------- + On Windows the max number of characters in a path is 260. + If you exceed this you will see FileNotFound errors here. """ if not fileList: return + if not os.path.exists(destinationPath): os.makedirs(destinationPath) + for pattern in fileList: if isinstance(pattern, tuple): # allow renames in transit diff --git a/doc/conf.py b/doc/conf.py index 2275edc1a..d21b56a81 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -64,9 +64,7 @@ APIDOC_REL = ".apidocs" SOURCE_DIR = os.path.join("..", "armi") _TUTORIAL_FILES = [ - pathlib.Path(SOURCE_DIR) / "tests" / "tutorials" / fName - for fName in bookkeepingTests.TUTORIAL_FILES - if "ipynb" not in fName + fName for fName in bookkeepingTests.TUTORIAL_FILES if "ipynb" not in fName ] @@ -233,17 +231,22 @@ def autodoc_skip_member_handler(app, what, name, obj, skip, options): def setup(app): """Method to make `make html` generate api documentation.""" app.connect("autodoc-skip-member", autodoc_skip_member_handler) - app.add_domain(PatchedPythonDomain, override=True) - app.add_directive("exec", ExecDirective) app.add_directive("pyreverse", PyReverse) + app.add_directive("impl", directives.admonitions.Note) + app.add_directive("test", directives.admonitions.Note) - # copy resources needed to build the tutorial notebooks. nbsphinx_link is slick, but - # the working directory for running the notebooks is the directory of the link - # itself, so relative paths don't work. + # making tutorial data dir + dataDir = pathlib.Path("user") / ".." / "anl-afci-177" + if not os.path.exists(dataDir): + os.mkdir(dataDir) + + # copy resources needed to build the tutorial notebooks. nbsphinx_link is slick, but the working + # directory for running the notebooks is the directory of the link itself, so relative paths + # don't work. for path in _TUTORIAL_FILES: - shutil.copy(path, pathlib.Path("user") / "tutorials") + shutil.copy(path, dataDir) # If extensions (or modules to document with autodoc) are in another directory, @@ -253,36 +256,36 @@ def setup(app): # -- General configuration ----------------------------------------------------- -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +# Add any Sphinx extension module names here, as strings. They can be extensions coming with Sphinx +# (named 'sphinx.ext.*') or your custom ones. extensions = [ + "nbsphinx", + "nbsphinx_link", "sphinx.ext.autodoc", - "sphinx.ext.napoleon", "sphinx.ext.autosummary", "sphinx.ext.doctest", - "sphinx.ext.todo", - "sphinx.ext.mathjax", + "sphinx.ext.extlinks", "sphinx.ext.ifconfig", + "sphinx.ext.imgconverter", # to convert GH Actions badge SVGs to PNG for LaTeX "sphinx.ext.inheritance_diagram", - "sphinx.ext.extlinks", - "sphinx.ext.viewcode", "sphinx.ext.intersphinx", - "sphinxcontrib.apidoc", - "nbsphinx", - "nbsphinx_link", - "sphinxext.opengraph", + "sphinx.ext.mathjax", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", "sphinx_gallery.gen_gallery", - "sphinx.ext.imgconverter", # to convert GH Actions badge SVGs to PNG for LaTeX - "sphinxcontrib.plantuml", "sphinx_rtd_theme", # needed here for loading jquery in sphinx 6 + "sphinxcontrib.apidoc", "sphinxcontrib.jquery", # see https://github.com/readthedocs/sphinx_rtd_theme/issues/1452 + "sphinxcontrib.plantuml", + "sphinxext.opengraph", ] # Our API should make sense without documenting private/special members. autodoc_default_options = { "members": True, - "undoc-members": True, "private-members": False, + "undoc-members": True, } autodoc_member_order = "bysource" # this line removes huge numbers of false and misleading, inherited docstrings diff --git a/doc/release/0.4.rst b/doc/release/0.4.rst index 71cede66d..fa6185061 100644 --- a/doc/release/0.4.rst +++ b/doc/release/0.4.rst @@ -46,6 +46,7 @@ API Changes #. Transposing ``pinMgFluxes`` parameters so that leading dimension is pin index (`PR#1937 `) >>>>>>> origin/main #. Removing ``globalFluxInterface.DoseResultsMapper`` class (`PR#1952 `) +#. Removing setting ``mpiTasksPerNode`` and renaming ``numProcessors`` to ``nTasks``. (`PR#1958 `_) #. TBD Bug Fixes diff --git a/doc/tutorials/data_model.nblink b/doc/tutorials/data_model.nblink index 40740d5e4..5a140a037 100644 --- a/doc/tutorials/data_model.nblink +++ b/doc/tutorials/data_model.nblink @@ -1,9 +1,9 @@ { "path": "../../armi/tests/tutorials/data_model.ipynb", "extra-media": [ - "../../armi/tests/tutorials/anl-afci-177-blueprints.yaml", - "../../armi/tests/tutorials/anl-afci-177.yaml", - "../../armi/tests/tutorials/anl-afci-177-coreMap.yaml", - "../../armi/tests/tutorials/anl-afci-177-fuelManagement.py" + "../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml", + "../../armi/tests/anl-afci-177/anl-afci-177.yaml", + "../../armi/tests/anl-afci-177/anl-afci-177-coreMap.yaml", + "../../armi/tests/anl-afci-177/anl-afci-177-fuelManagement.py" ] } \ No newline at end of file diff --git a/doc/tutorials/making_your_first_app.rst b/doc/tutorials/making_your_first_app.rst index 4509bd97c..2dab2526e 100644 --- a/doc/tutorials/making_your_first_app.rst +++ b/doc/tutorials/making_your_first_app.rst @@ -291,10 +291,10 @@ for your own interests!). Here are the files you can download into the run directory. -* :download:`Blueprints <../../armi/tests/tutorials/anl-afci-177-blueprints.yaml>` -* :download:`Settings <../../armi/tests/tutorials/anl-afci-177.yaml>` -* :download:`Core map <../../armi/tests/tutorials/anl-afci-177-coreMap.yaml>` -* :download:`Fuel management <../../armi/tests/tutorials/anl-afci-177-fuelManagement.py>` +* :download:`Blueprints <../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml>` +* :download:`Settings <../../armi/tests/anl-afci-177/anl-afci-177.yaml>` +* :download:`Core map <../../armi/tests/anl-afci-177/anl-afci-177-coreMap.yaml>` +* :download:`Fuel management <../../armi/tests/anl-afci-177/anl-afci-177-fuelManagement.py>` Then, run your app!:: diff --git a/doc/tutorials/param_sweep.nblink b/doc/tutorials/param_sweep.nblink index 5bcc59112..5fedd280a 100644 --- a/doc/tutorials/param_sweep.nblink +++ b/doc/tutorials/param_sweep.nblink @@ -1,9 +1,9 @@ { "path": "../../armi/tests/tutorials/param_sweep.ipynb", "extra-media": [ - "../../armi/tests/tutorials/anl-afci-177-blueprints.yaml", - "../../armi/tests/tutorials/anl-afci-177.yaml", - "../../armi/tests/tutorials/anl-afci-177-coreMap.yaml", - "../../armi/tests/tutorials/anl-afci-177-fuelManagement.py" + "../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml", + "../../armi/tests/anl-afci-177/anl-afci-177.yaml", + "../../armi/tests/anl-afci-177/anl-afci-177-coreMap.yaml", + "../../armi/tests/anl-afci-177/anl-afci-177-fuelManagement.py" ] } diff --git a/doc/tutorials/walkthrough_inputs.rst b/doc/tutorials/walkthrough_inputs.rst index f2e7ffa87..071789f2a 100644 --- a/doc/tutorials/walkthrough_inputs.rst +++ b/doc/tutorials/walkthrough_inputs.rst @@ -30,7 +30,7 @@ operating temperature of 450 °C. Lastly, since there are 271 pins in the assembly, we'll set the ``mult`` (short for *multiplicity*) to 271: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: start-block-clad :end-before: end-block-clad @@ -54,7 +54,7 @@ follows. .. note:: The wire axial pitch isn't specified in the table so we just use a typical value of 30 cm. -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-clad :end-before: end-block-wire @@ -80,7 +80,7 @@ fuel. Thus, the fuel outer diameter is given by solving: which gives :math:`d = 0.6029`, our fuel outer diameter. Now we can enter our fuel slug component into blueprints: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-wire :end-before: end-block-fuel @@ -95,7 +95,7 @@ set, we will use **linked dimensions**. Thus, no numbers (beyond temperatures) are needed! -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-fuel :end-before: end-block-bond @@ -108,7 +108,7 @@ diameters. The outer pitch is given as ``15.710``, and we can calculate the inner pitch from that and the duct thickness. It ends up looking like this: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-bond :end-before: end-block-duct @@ -119,7 +119,7 @@ pitch, also defined in Table 4.3), and we define this by defining a special ``Hexagon`` full of interstitial coolant outside the duct: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-duct :end-before: end-block-intercoolant @@ -134,7 +134,7 @@ conditions (e.g. when the rest of the assembly is filled and only one shape automatically. And that's just what we'll do with the coolant: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-intercoolant :end-before: end-block-coolant @@ -159,7 +159,7 @@ Radial Shields Here is a very simplified radial shield: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-coolant :end-before: end-block-radialshield @@ -171,7 +171,7 @@ Here is a reflector block definition. We can use this for radial reflectors and axial reflectors. We include wire wrap so the axial reflector will work with our basic thermal hydraulic solver: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-radialshield :end-before: end-block-reflector @@ -182,7 +182,7 @@ Control Here is a big empty sodium duct (what you'd find below a control absorber bundle): -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-reflector :end-before: end-block-control @@ -194,7 +194,7 @@ We also need to define empty cladding tubes above the fuel for the fission gasses to accumulate in. This just has a ``gap`` component made of the ``Void`` material, which is just empty space: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-control :end-before: end-block-plenum @@ -221,7 +221,7 @@ specify a roughly even neutronic/transport mesh, with slightly larger neutronic mesh points in the very tall single-block plenum: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-block-plenum :end-before: end-assemblies-common @@ -238,7 +238,7 @@ from the paper. Specifying more details is possible via the **custom isotopics** input fields.: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-assemblies-common :end-before: end-assemblies-ic @@ -263,7 +263,7 @@ is a trade-off, since more cross section types means more lattice physics calculations, which can require either more time or more processors: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-assemblies-ic :end-before: end-assemblies-mc @@ -275,7 +275,7 @@ Same deal for the outer core. is highly recommended to make sure you know how to column edit. -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-assemblies-mc :end-before: end-assemblies-oc @@ -289,7 +289,7 @@ some requirements of axial mesh boundaries at least lining up between assemblies, but there are some ARMI features that can automatically adjust the mesh if you have very complicated assemblies: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-assemblies-oc :end-before: end-assemblies-rr @@ -300,7 +300,7 @@ mesh if you have very complicated assemblies: Here is the radial shield: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-assemblies-rr :end-before: end-assemblies-sh @@ -308,7 +308,7 @@ Here is the radial shield: Here are the control blocks: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-assemblies-sh :end-before: end-assemblies-section @@ -331,7 +331,7 @@ can be input as follows (see Figure 4.3 in the reference). First, we refer to a geometry file from the ``systems`` section of the ``blueprints`` file: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-blueprints.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml :language: yaml :start-after: end-assemblies-section :end-before: end-systems-section @@ -339,7 +339,7 @@ geometry file from the ``systems`` section of the ``blueprints`` file: And then, in the core map file (``anl-afci-177-coreMap.yaml``): -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-coreMap.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-coreMap.yaml :language: yaml @@ -360,7 +360,7 @@ specified, so let's assume 0.38. From Table 4.8, the cycle length is 370 EFPD. Let's also assume a 0.90 capacity factor which will gives full cycles of 411.1 days. -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177.yaml :language: yaml :start-after: begin-settings :end-before: end-section-1 @@ -369,21 +369,21 @@ We need to tell the system which other input files to load by bringing in the blueprints and geometry (the shuffling and fuel handler info will be described momentarily): -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177.yaml :language: yaml :start-after: end-section-1 :end-before: end-section-2 In terms of our simulation parameters, let's run it for 10 cycles, with 2 depletion time steps per cycle: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177.yaml :language: yaml :start-after: end-section-2 :end-before: end-section-3 Set some physics kernel and environment options: -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177.yaml +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177.yaml :language: yaml :start-after: end-section-3 @@ -410,7 +410,7 @@ stated fluence limit will be violated in the next cycle. If it will be, the fuel assembly will be replaced with a fresh one of the same kind. -.. literalinclude:: ../../armi/tests/tutorials/anl-afci-177-fuelManagement.py +.. literalinclude:: ../../armi/tests/anl-afci-177/anl-afci-177-fuelManagement.py :language: python @@ -424,9 +424,9 @@ errors to help identify common mistakes. Here are the full files used in this example: -* :download:`Blueprints <../../armi/tests/tutorials/anl-afci-177-blueprints.yaml>` -* :download:`Settings <../../armi/tests/tutorials/anl-afci-177.yaml>` -* :download:`Core map <../../armi/tests/tutorials/anl-afci-177-coreMap.yaml>` -* :download:`Fuel management <../../armi/tests/tutorials/anl-afci-177-fuelManagement.py>` +* :download:`Blueprints <../../armi/tests/anl-afci-177/anl-afci-177-blueprints.yaml>` +* :download:`Settings <../../armi/tests/anl-afci-177/anl-afci-177.yaml>` +* :download:`Core map <../../armi/tests/anl-afci-177/anl-afci-177-coreMap.yaml>` +* :download:`Fuel management <../../armi/tests/anl-afci-177/anl-afci-177-fuelManagement.py>` The next tutorial will guide you through inputs for a classic LWR benchmark problem (C5G7). diff --git a/pyproject.toml b/pyproject.toml index 1037e6e30..fb5d848c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -311,6 +311,10 @@ armi = [ "physics/neutronics/tests/rzmflxYA", "resources/*", "tests/1DslabXSByCompTest.yaml", + "tests/anl-afci-177/anl-afci-177-blueprints.yaml", + "tests/anl-afci-177/anl-afci-177-coreMap.yaml", + "tests/anl-afci-177/anl-afci-177-fuelManagement.py", + "tests/anl-afci-177/anl-afci-177.yaml", "tests/armiRun-SHUFFLES.txt", "tests/armiRun.yaml", "tests/c5g7", @@ -338,10 +342,6 @@ armi = [ "tests/ThRZSettings.yaml", "tests/trz_geom.xml", "tests/tutorials", - "tests/tutorials/anl-afci-177-blueprints.yaml", - "tests/tutorials/anl-afci-177-coreMap.yaml", - "tests/tutorials/anl-afci-177-fuelManagement.py", - "tests/tutorials/anl-afci-177.yaml", "tests/tutorials/data_model.ipynb", "tests/zpprTest.yaml", "tests/zpprTestGeom.xml",