Skip to content

Commit

Permalink
Switcher again (#291)
Browse files Browse the repository at this point in the history
* copying switcher even for branch builds

* trying to correct versions

* trying to fix switcher

* trying to fix the switcher

* switching tab system

* putting back branch build
  • Loading branch information
K20shores committed Oct 5, 2023
1 parent d3a494e commit d1f27f3
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 46 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
set -x
mkdir -p _build/html/versions
# create two copies of the documentaiton
# create two copies of the documentation
# 1. the frozen version, represented as vX.X in the version switcher
docker build -t micm -f docker/Dockerfile.docs .
id=$(docker create micm)
Expand All @@ -73,7 +73,9 @@ jobs:
# _gh-pages itself.
find _gh-pages/ -mindepth 1 ! -path '_gh-pages/branch*' ! -path '_gh-pages/versions*' -delete
rsync -a _build/html/versions/stable/* _gh-pages/
mv docs/switcher.json _gh-pages
mkdir -p _gh-pages/versions
rsync -a _build/html/versions/* _gh-pages/versions
# mv docs/switcher.json _gh-pages
# If a push and not on default branch, then copy the build to
# _gh-pages/branch/$brname (transforming '/' into '--')
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ sphinx
sphinx-book-theme
sphinx-copybutton
sphinx-design
sphinx-tabs
sphinxcontrib-bibtex
17 changes: 17 additions & 0 deletions docs/source/_static/switcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"name": "v3.2.0 (stable)",
"version": "v3.2.0 (stable)",
"url": "https://ncar.github.io/micm"
},
{
"name": "v3.2.0",
"version": "3.2.0",
"url": "https://ncar.github.io/micm/versions/3.2.0"
},
{
"name": "dev",
"version": "dev",
"url": "https://ncar.github.io/micm/branch/main/"
}
]
9 changes: 4 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
copyright = f'2022-{datetime.datetime.now().year}, NCAR/UCAR'
author = 'NCAR/UCAR'

# The full version, including alpha/beta/rc tags
release = '3.2.0'

suffix = os.getenv("SWITCHER_SUFFIX", "")
# the suffix is required. This is controlled by the dockerfile that builds the docs
release = f'v3.2.0{suffix}'

# -- General configuration ---------------------------------------------------

Expand All @@ -34,7 +34,6 @@
'breathe',
'sphinx_copybutton',
'sphinx_design',
'sphinx_tabs.tabs',
'sphinxcontrib.bibtex',
]

Expand Down Expand Up @@ -64,7 +63,7 @@
"github_url": "https://github.com/NCAR/micm",
"navbar_end": ["version-switcher", "navbar-icon-links"],
"switcher": {
"json_url": "https://ncar.github.io/micm/switcher.json",
"json_url": "https://ncar.github.io/micm/_static/switcher.json",
"version_match": release,
},
}
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user_guide/but_how_fast_is_it.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ the solver.
If you're looking for a copy and paste, choose
the appropriate tab below and be on your way! Otherwise, stick around for a line by line explanation.

.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

.. literalinclude:: ../../../test/tutorial/test_but_how_fast_is_it.cpp
:language: cpp
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user_guide/multiple_grid_cells.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ The third grid cell will have concentrations half as large as the first grid cel
If you're looking for a copy and paste, choose
the appropriate tab below and be on your way! Otherwise, stick around for a line by line explanation.

.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

.. literalinclude:: ../../../test/tutorial/test_multiple_grid_cells.cpp
:language: cpp
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user_guide/openmp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ We will use a simple 3-reaction 3-species mechanism. The setup here is the same
If you're looking for a copy and paste, copy below and be on your way! Otherwise, stick around for a line by line explanation.

.. tabs::
.. tab-set::

.. tab:: OpenAtmos Configuration reading
.. tab-item:: OpenAtmos Configuration reading

.. raw:: html

Expand Down
18 changes: 9 additions & 9 deletions docs/source/user_guide/rate_constant_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ If you're looking for a copy and paste, choose
the appropriate tab below and be on your way! Otherwise, stick around for a line by line explanation.


.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

.. literalinclude:: ../../../test/tutorial/test_rate_constants_no_user_defined_by_hand.cpp
:language: cpp

.. tab:: OpenAtmos Configuration reading
.. tab-item:: OpenAtmos Configuration reading

.. raw:: html

Expand Down Expand Up @@ -81,9 +81,9 @@ rosenbrock solver.
To create a :cpp:class:`micm::RosenbrockSolver`, we have to define a chemical system (:cpp:class:`micm::System`)
and our reactions, which will be a vector of :cpp:class:`micm::Process` We will use the species to define these.

.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

To do this by hand, we have to define all of the chemical species in the system. This allows us to set
any properties of the species that may be necessary for rate constanta calculations, like molecular weights
Expand All @@ -108,7 +108,7 @@ and our reactions, which will be a vector of :cpp:class:`micm::Process` We will
:language: cpp
:lines: 135-136

.. tab:: OpenAtmos Configuration reading
.. tab-item:: OpenAtmos Configuration reading

After defining a valid OpenAtmos configuration with reactions that ``micm`` supports, configuring the chemical
system and the processes is as simple as using the :cpp:class:`micm::SolverConfig` class
Expand All @@ -133,15 +133,15 @@ custom rate parameters, and temperature and pressure
Initializing the state
^^^^^^^^^^^^^^^^^^^^^^

.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

.. literalinclude:: ../../../test/tutorial/test_rate_constants_no_user_defined_by_hand.cpp
:language: cpp
:lines: 141-155

.. tab:: OpenAtmos Configuration reading
.. tab-item:: OpenAtmos Configuration reading

.. literalinclude:: ../../../test/tutorial/test_rate_constants_no_user_defined_with_config.cpp
:language: cpp
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user_guide/solver_configurations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ We will use a simple 3-reaction 3-species mechanism. The setup here is the same
If you're looking for a copy and paste, choose
the appropriate tab below and be on your way! Otherwise, stick around for a line by line explanation.

.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

.. literalinclude:: ../../../test/tutorial/test_solver_configuration.cpp
:language: cpp
Expand Down
18 changes: 9 additions & 9 deletions docs/source/user_guide/user_defined_rate_constant_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ To show how this works, we'll add one photolysis reaction, one first-order loss
If you're looking for a copy and paste, choose
the appropriate tab below and be on your way! Otherwise, stick around for a line by line explanation.

.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

.. literalinclude:: ../../../test/tutorial/test_rate_constants_user_defined_by_hand.cpp
:language: cpp

.. tab:: OpenAtmos Configuration reading
.. tab-item:: OpenAtmos Configuration reading

.. raw:: html

Expand Down Expand Up @@ -70,9 +70,9 @@ Then setup the reaction which will use this rate constant:



.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

.. code-block:: diff
Expand Down Expand Up @@ -104,7 +104,7 @@ Then setup the reaction which will use this rate constant:
.. tab:: OpenAtmos Configuration reading
.. tab-item:: OpenAtmos Configuration reading

In this case, you only need to add the configuration to the reactions.json file in the configuration directory.

Expand Down Expand Up @@ -137,9 +137,9 @@ Finally, set and upate the rate constants as needed:



.. tabs::
.. tab-set::

.. tab:: Build the Mechanism with the API
.. tab-item:: Build the Mechanism with the API

.. code-block:: diff
Expand Down Expand Up @@ -171,7 +171,7 @@ Finally, set and upate the rate constants as needed:
+ photo_rate *= 1.5;
}
.. tab:: OpenAtmos Configuration reading
.. tab-item:: OpenAtmos Configuration reading

In this case, you only need to add the configuration to the reactions.json file in the configuration directory.
When reading in from a configuration file, the loss, emissions, and photolysis rates are prefixed with
Expand Down
12 changes: 0 additions & 12 deletions docs/switcher.json

This file was deleted.

0 comments on commit d1f27f3

Please sign in to comment.