From 31494e365b5b8a0bd4dc325249aadc76f5a6efde Mon Sep 17 00:00:00 2001 From: John Stilley Date: Tue, 31 Aug 2021 11:37:28 -0700 Subject: [PATCH] Coordinating docs with new logging --- doc/conf.py | 4 ++++ .../analysis/run_hexBlockToRZConversion.py | 12 ++++++++++-- setup.py | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index f9bfc37cc..17a83e539 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -26,6 +26,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. +import logging import pathlib import re import warnings @@ -173,6 +174,9 @@ def setup(app): # The full version, including alpha/beta/rc tags. release = armi.__version__ +# from here on out, we use the std library default logging +logging.setLoggerClass(logging.Logger) + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None diff --git a/doc/gallery-src/analysis/run_hexBlockToRZConversion.py b/doc/gallery-src/analysis/run_hexBlockToRZConversion.py index 9e1947218..1b325a6ec 100644 --- a/doc/gallery-src/analysis/run_hexBlockToRZConversion.py +++ b/doc/gallery-src/analysis/run_hexBlockToRZConversion.py @@ -21,19 +21,24 @@ the design in real geometry while still performing appropriate approximations for efficient analysis. -.. warning:: +.. warning:: This uses :py:mod:`armi.reactor.converters.blockConverters`, which currently only works 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 from armi.reactor.tests import test_reactors from armi.reactor.flags import Flags from armi.reactor.converters import blockConverters -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() @@ -45,3 +50,6 @@ ) converter.convert() converter.plotConvertedBlock() + +# revert back to std library logging +logging.setLoggerClass(logging.Logger) diff --git a/setup.py b/setup.py index f983d14a0..1c4ecdffe 100644 --- a/setup.py +++ b/setup.py @@ -83,7 +83,7 @@ def collectExtraFiles(): "pytest-html", "pylint", "docutils", - "sphinx>=2.2", + "sphinx==2.2", "sphinx-rtd-theme", "black", # for running jupyter dynamically in docs