Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 add rate constant descriptions and configuration formats #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3136a1d
added arrhenius reaction configuration
K20shores Aug 25, 2023
f0553eb
aqueous equilibrium
K20shores Aug 25, 2023
837fa98
cmaq_h2o2
K20shores Aug 25, 2023
1618261
cmaq_OH_HNO3
K20shores Aug 25, 2023
4ef8c47
condensed phase arrhenius
K20shores Aug 25, 2023
5f7146e
condensed phase photolysis
K20shores Aug 25, 2023
11d26f2
emission
K20shores Aug 25, 2023
eacabd4
first order loss
K20shores Aug 25, 2023
71e3579
hl phase transfer
K20shores Aug 25, 2023
2628352
photolysis
K20shores Aug 25, 2023
cb2e41e
simpol phase transfer
K20shores Aug 25, 2023
1664300
surface
K20shores Aug 25, 2023
9ba2ef2
ternary chemical activation
K20shores Aug 25, 2023
db90ac8
added bibliography
K20shores Aug 25, 2023
00daddf
branched
K20shores Aug 25, 2023
35e7212
tunneling
K20shores Aug 25, 2023
90ee2e5
wet deposition
K20shores Aug 25, 2023
8b1830b
adding table
K20shores Aug 25, 2023
9551b89
adding download example button
K20shores Aug 25, 2023
b5eabfc
formatting
K20shores Aug 25, 2023
1dbab34
trying to deploy to github pages
K20shores Aug 25, 2023
de4c5df
maybe now it builds
K20shores Aug 25, 2023
a5ccd36
and trying to publish
K20shores Aug 25, 2023
ac5dc24
name
K20shores Aug 25, 2023
17f5d6d
maybe now
K20shores Aug 25, 2023
2738235
debugging
K20shores Aug 25, 2023
46ac100
path
K20shores Aug 25, 2023
2174b82
debug again
K20shores Aug 25, 2023
c54dd28
trying to copy
K20shores Aug 25, 2023
527eb07
one more time
K20shores Aug 25, 2023
3ce235f
one last time
K20shores Aug 25, 2023
39e974b
again
K20shores Aug 25, 2023
0b8049b
now making it only run on main
K20shores Aug 25, 2023
2a2cdd2
making actions succeed even without deploying
K20shores Aug 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Docs
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
branches:
- main

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Debugging information
run: |
echo "github.ref:" ${{github.ref}}
echo "github.event_name:" ${{github.event_name}}
echo "github.head_ref:" ${{github.head_ref}}
echo "github.base_ref:" ${{github.base_ref}}
set -x
git rev-parse --abbrev-ref HEAD
git branch
git branch -a
git remote -v
python -V
pip list --not-required
pip list

- name: Setup gh-pages folder
run: |
set -x
git fetch
( git branch gh-pages remotes/origin/gh-pages && git clone . --branch=gh-pages _gh-pages/ ) || mkdir _gh-pages
rm -rf _gh-pages/.git/

- name: Install dependencies
run: |
pip install -r docs/requirements.txt

- name: Build documentation
run: |
cd docs
make html
ls -l
ls -l build/html
cp -r build/html/* ../_gh-pages/

# Add the .nojekyll file
- name: nojekyll
if: ${{ github.event_name == 'push' }}
run: |
touch _gh-pages/.nojekyll

- name: Debugging information
run: |
ls -la _gh-pages/

# Deploy
# https://github.com/peaceiris/actions-gh-pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _gh-pages/
force_orphan: true
4 changes: 3 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pydata-sphinx-theme
sphinx
sphinx-design
sphinx-tabs
sphinx-tabs
sphinxcontrib-bibtex
sphinxemoji
Empty file added docs/source/_static/.gitkeep
Empty file.
24 changes: 24 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.download-div {
display: flex;
flex-direction: row;
justify-content: space-around;
margin-bottom: 1rem;
}

.download-button {
display: inline-block;
padding: 10px 20px;
background-color: #3498db;
color: white;
border: none;
border-radius: 5px;
text-align: center;
text-decoration: none;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s;
}

.download-button:hover {
background-color: #2980b9;
}
6 changes: 6 additions & 0 deletions docs/source/bibliography.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
############
Bibliography
############

.. bibliography::
:all:
24 changes: 17 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
import datetime

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'CAMP Configuration'
copyright = '2023, OpenAtmos'
project = 'Mechanism Configuration'
current_year = datetime.datetime.now().year
copyright = f"2022-{current_year}, OpenAtmos"
author = 'OpenAtmos'
release = '0.0.0'
version = '1.0.0'
release = version

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx_design',
'sphinx_tabs.tabs',
'sphinx_design',
'sphinx_tabs.tabs',
'sphinxcontrib.bibtex',
'sphinxemoji.sphinxemoji',
]

templates_path = ['_templates']
exclude_patterns = []


bibtex_bibfiles = ['references.bib']
suppress_warnings = ["bibtex.missing_field"]

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
html_static_path = ['_static']
html_static_path = ['_static']
html_css_files = [
'css/custom.css',
]
26 changes: 19 additions & 7 deletions docs/source/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,30 @@ Chapman
Top Level Config
----------------

.. raw:: html

<div class="download-div">
<a href="../_static/examples/yaml/chapman/chapman.zip" download>
<button class="download-button">Download yaml ZIP</button>
</a>
<a href="../_static/examples/json/chapman/chapman.zip" download>
<button class="download-button">Download json ZIP</button>
</a>
</div>


.. tabs::

.. tab:: YAML

.. literalinclude:: ../../../examples/yaml/chapman/config.yaml
.. literalinclude:: ../_static/examples/yaml/chapman/config.yaml
:language: yaml

.. tab:: JSON

.. literalinclude:: ../../../examples/json/chapman/config.json
.. literalinclude:: ../_static/examples/json/chapman/config.json
:language: json


Reactions
---------
Expand All @@ -33,12 +45,12 @@ Reactions

.. tab:: YAML

.. literalinclude:: ../../../examples/yaml/chapman/reactions.yaml
.. literalinclude:: ../_static/examples/yaml/chapman/reactions.yaml
:language: yaml

.. tab:: JSON

.. literalinclude:: ../../../examples/json/chapman/reactions.json
.. literalinclude:: ../_static/examples/json/chapman/reactions.json
:language: json

Species
Expand All @@ -48,10 +60,10 @@ Species

.. tab:: YAML

.. literalinclude:: ../../../examples/yaml/chapman/species.yaml
.. literalinclude:: ../_static/examples/yaml/chapman/species.yaml
:language: yaml

.. tab:: JSON

.. literalinclude:: ../../../examples/json/chapman/species.json
.. literalinclude:: ../_static/examples/json/chapman/species.json
:language: json
13 changes: 8 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. CAMP Configuration documentation master file, created by
.. OpenAtmos Mechanism Configuration documentation master file, created by
sphinx-quickstart on Fri Jul 21 21:05:33 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

.. camp configuration documentation HTML titles
.. open atmos mechanism configuration documentation HTML titles
..
.. # (over and under) for module headings
.. = for sections
Expand All @@ -12,16 +12,19 @@
.. ~ for subsubsubsections
.. " for paragraphs

##############################################
Welcome to CAMP Configuration's documentation!
##############################################
.. |project_version| replace:: 1.0.0

###############################################################
Welcome to the OpenAtmos Mechanism Configuration documentation!
###############################################################

.. toctree::
:maxdepth: 2
:caption: Contents:

aerosol_phases/index
aerosol_representations/index
bibliography
chemical_species/index
examples/index
mechanisms/index
Expand Down
76 changes: 76 additions & 0 deletions docs/source/reactions/aqueous_equilibrium.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Aqueous-Phase Equilibrium
=========================

Aqueous equilibrium reactions are calculated as forward and reverse reactions.
The reverse rate constant must be provided as part of the input data, and the forward rate constant is calculated using the provided
reverse rate constant and an equilibrium constant of the following format:

.. math::

A e^{C \left(\frac{1}{T} - \frac{1}{298}\right)}

where:

- :math:`A` is the pre-exponential factor (:math:`\mathrm{s}^{-1}`),
- :math:`C` is a constant,
- :math:`T` is the temperature :math:`(\mathrm{K})`.

Input data for aqueous equilibrium equations should take the form:

.. tabs::

.. tab:: YAML

.. code-block:: yaml

type: AQUEOUS_EQUILIBRIUM
A: 123.45
C: 123.45
k_reverse: 123.45
phase: "my aqueous phase"
time unit: MIN
aqueous-phase water: "H2O_aq"
ion pair: "spec3-spec4"
reactants:
spec1: {}
spec2:
qty: 2
# ... (other reactants)
products:
spec3: {}
spec4:
qty: 0.65
# ... (other products)

.. tab:: JSON

.. code-block:: json

{
"type" : "AQUEOUS_EQUILIBRIUM",
"A" : 123.45,
"C" : 123.45,
"k_reverse" : 123.45,
"phase" : "my aqueous phase",
"time unit" : "MIN",
"aqueous-phase water" : "H2O_aq",
"ion pair" : "spec3-spec4",
"reactants" : {
"spec1" : {},
"spec2" : { "qty" : 2 },
},
"products" : {
"spec3" : {},
"spec4" : { "qty" : 0.65 },
}
}

The key-value pairs ``reactants`` and ``products`` are required. Reactants and products without a ``qty`` value are assumed to appear once
in the reaction equation. Reactant and product species must be present in the specified phase and include a ``molecular weight [kg mol-1]``
parameter in :math:`\mathrm{kg}\ \mathrm{mole}^{-1}`. The parameter ``aqueous-phase water`` is required and must be the name of the aerosol-phase species that is used for water.
The parameter ``ion pair`` is optional. When it is included, its value must be the name of an ion pair that is present in the specified aerosol phase.
Its mean binary activity coefficient will be applied to the reverse reaction.

When ``A`` is not included, it is assumed to be 1.0; when ``C`` is not included, it is assumed to be 0.0. The reverse reaction rate constant ``k_reverse`` is required.

The unit for time is assumed to be s, but inclusion of the optional key-value pair ``time unit = MIN`` can be used to indicate a rate with minutes as the time unit.
Loading