Skip to content

Commit

Permalink
Fixing the example gallery in our docs. (#418)
Browse files Browse the repository at this point in the history
* #417 fixed 5 of the 6 gallery images

* Fail the build if you break the docs

* Inserting a default thumbnail for the MCNP example

* We have unit tests for import resolution issues
  • Loading branch information
john-science authored Sep 24, 2021
1 parent 5d21060 commit fcb7843
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
run: pip install tox
- name: Make HTML Docs
run: tox -e doc
continue-on-error: true
- name: deploy
uses: JamesIves/[email protected]
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ doc/tutorials/case-suite
armi/tests/tutorials/case-suite
.apidocs/
doc/gallery
doc/gallery-src/framework/*.yaml
htmlcov/

# No workspace crumbs.
Expand Down
2 changes: 2 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ def setup(app):
"default_thumb_file": os.path.join(RES, "images", "TerraPowerLogo.png"),
}

suppress_warnings: ["autoapi.python_import_resolution"]

# filter out this warning which shows up in sphinx-gallery builds.
# this is suggested in the sphinx-gallery example but doesn't actually work?
warnings.filterwarnings(
Expand Down
8 changes: 7 additions & 1 deletion doc/gallery-src/analysis/run_blockMcnpMaterialCard.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@
plugin. But in this case, the need for MCNP materials cards is so pervasive
that it made it into the framework.
"""
# sphinx_gallery_thumbnail_path = '.static/armi-logo.png'
import logging

from armi.reactor.tests import test_reactors
from armi.reactor.flags import Flags
from armi.utils.densityTools import formatMaterialCard
from armi.nucDirectory import nuclideBases as nb
from armi import configure
from armi import configure, runLog

# init ARMI logging tools
logging.setLoggerClass(runLog.RunLogger)

# configure ARMI
configure(permissive=True)

_o, r = test_reactors.loadTestReactor()
Expand Down
12 changes: 8 additions & 4 deletions doc/gallery-src/analysis/run_hexReactorToRZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
This shows how an entire reactor specified in full hex detail can be
automatically converted to a 2-D or 3-D RZ case with conserved mass.
.. warning::
.. warning::
This uses :py:mod:`armi.reactor.converters.geometryConverters`, which
will only work on a constrained set of hex-based geometries. For your systems,
consider these an example and starting point and build your own converters as
appropriate.
"""
import logging

# sphinx_gallery_thumbnail_number=2
import math

Expand All @@ -21,8 +21,12 @@
from armi.reactor.flags import Flags
from armi.reactor.converters import geometryConverters
from armi.utils import plotting
from armi import configure
from armi import configure, runLog

# init ARMI logging tools
logging.setLoggerClass(runLog.RunLogger)

# configure ARMI
configure(permissive=True)

o, r = test_reactors.loadTestReactor()
Expand Down
8 changes: 7 additions & 1 deletion doc/gallery-src/framework/run_fuelManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
demonstration purposes.
"""
import logging

# Tell the gallery to feature the 2nd image
# sphinx_gallery_thumbnail_number = 2
import math
Expand All @@ -24,8 +26,12 @@
from armi.physics.fuelCycle import fuelHandlers
from armi.utils import plotting

from armi import configure
from armi import configure, runLog

# init ARMI logging tools
logging.setLoggerClass(runLog.RunLogger)

# configure ARMI
configure(permissive=True)

o, reactor = test_reactors.loadTestReactor(inputFileName="refTestCartesian.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@
from scratch.
"""
import logging

import matplotlib.pyplot as plt
from armi import configure
from armi import configure, runLog

# init ARMI logging tools
logging.setLoggerClass(runLog.RunLogger)

# configure ARMI
configure(permissive=True)

# pylint: disable=wrong-import-position
from armi.reactor import blueprints
from armi import settings
Expand Down
8 changes: 7 additions & 1 deletion doc/gallery-src/framework/run_reactorFacemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
Load a test reactor from the test suite and plot a dummy
power distribution from it. You can plot any block parameter.
"""
import logging

from armi.reactor.tests import test_reactors
from armi.utils import plotting
from armi import configure
from armi import configure, runLog

# init ARMI logging tools
logging.setLoggerClass(runLog.RunLogger)

# configure ARMI
configure(permissive=True)

operator, reactor = test_reactors.loadTestReactor()
Expand Down

0 comments on commit fcb7843

Please sign in to comment.