diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..4f8931c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +docs/build diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d0c3cbf1 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..747ffb7b --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..4cb3d6ba --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +pydata-sphinx-theme +sphinx +sphinx-design +sphinx-tabs \ No newline at end of file diff --git a/docs/source/aerosol_phases/index.rst b/docs/source/aerosol_phases/index.rst new file mode 100644 index 00000000..6bc3dded --- /dev/null +++ b/docs/source/aerosol_phases/index.rst @@ -0,0 +1,7 @@ +############## +Aerosol Phases +############## + +.. toctree:: + :maxdepth: 2 + :caption: Contents: diff --git a/docs/source/aerosol_representations/index.rst b/docs/source/aerosol_representations/index.rst new file mode 100644 index 00000000..eb8f3858 --- /dev/null +++ b/docs/source/aerosol_representations/index.rst @@ -0,0 +1,7 @@ +###################### +Aerosol Representation +###################### + +.. toctree:: + :maxdepth: 2 + :caption: Contents: diff --git a/docs/source/chemical_species/index.rst b/docs/source/chemical_species/index.rst new file mode 100644 index 00000000..4c9ba52a --- /dev/null +++ b/docs/source/chemical_species/index.rst @@ -0,0 +1,7 @@ +################ +Chemical Species +################ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..c911b7de --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,30 @@ +# 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' +author = 'OpenAtmos' +release = '0.0.0' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinx_design', + 'sphinx_tabs.tabs', +] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- 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'] \ No newline at end of file diff --git a/docs/source/examples/index.rst b/docs/source/examples/index.rst new file mode 100644 index 00000000..b2c1c00d --- /dev/null +++ b/docs/source/examples/index.rst @@ -0,0 +1,57 @@ +########## +Examples +########## + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + +Chapman +======= + +Top Level Config +---------------- + +.. tabs:: + + .. tab:: YAML + + .. literalinclude:: ../../../examples/yaml/chapman/config.yaml + :language: yaml + + .. tab:: JSON + + .. literalinclude:: ../../../examples/json/chapman/config.json + :language: json + + +Reactions +--------- + +.. tabs:: + + .. tab:: YAML + + .. literalinclude:: ../../../examples/yaml/chapman/reactions.yaml + :language: yaml + + .. tab:: JSON + + .. literalinclude:: ../../../examples/json/chapman/reactions.json + :language: json + +Species +--------- + +.. tabs:: + + .. tab:: YAML + + .. literalinclude:: ../../../examples/yaml/chapman/species.yaml + :language: yaml + + .. tab:: JSON + + .. literalinclude:: ../../../examples/json/chapman/species.json + :language: json \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..14ad159d --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,37 @@ +.. CAMP 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 +.. +.. # (over and under) for module headings +.. = for sections +.. - for subsections +.. ^ for subsubsections +.. ~ for subsubsubsections +.. " for paragraphs + +############################################## +Welcome to CAMP Configuration's documentation! +############################################## + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + aerosol_phases/index + aerosol_representations/index + chemical_species/index + examples/index + mechanisms/index + reactions/index + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/mechanisms/index.rst b/docs/source/mechanisms/index.rst new file mode 100644 index 00000000..49fbd0d6 --- /dev/null +++ b/docs/source/mechanisms/index.rst @@ -0,0 +1,7 @@ +########## +Mechanisms +########## + +.. toctree:: + :maxdepth: 2 + :caption: Contents: diff --git a/docs/source/reactions/arrhenius.rst b/docs/source/reactions/arrhenius.rst new file mode 100644 index 00000000..353a2faf --- /dev/null +++ b/docs/source/reactions/arrhenius.rst @@ -0,0 +1,25 @@ +========= +Arrhenius +========= + +.. tabs:: + + .. tab:: YAML + + .. code-block:: yaml + + # Your YAML example here + key: value + array: + - item1 + - item2 + + .. tab:: JSON + + .. code-block:: json + + // Your JSON example here + { + "key": "value", + "array": ["item1", "item2"] + } \ No newline at end of file diff --git a/docs/source/reactions/index.rst b/docs/source/reactions/index.rst new file mode 100644 index 00000000..091f38ce --- /dev/null +++ b/docs/source/reactions/index.rst @@ -0,0 +1,9 @@ +######### +Reactions +######### + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + arrhenius diff --git a/examples/.DS_Store b/examples/.DS_Store new file mode 100644 index 00000000..408532ee Binary files /dev/null and b/examples/.DS_Store differ diff --git a/examples/json/chapman/chapman.zip b/examples/json/chapman/chapman.zip new file mode 100644 index 00000000..3566f3e3 Binary files /dev/null and b/examples/json/chapman/chapman.zip differ diff --git a/examples/json/chapman/config.json b/examples/json/chapman/config.json new file mode 100644 index 00000000..2b5917a0 --- /dev/null +++ b/examples/json/chapman/config.json @@ -0,0 +1,6 @@ +{ + "camp-files": [ + "species.json", + "reactions.json" + ] +} \ No newline at end of file diff --git a/examples/json/chapman/reactions.json b/examples/json/chapman/reactions.json new file mode 100644 index 00000000..05836a73 --- /dev/null +++ b/examples/json/chapman/reactions.json @@ -0,0 +1,148 @@ +{ + "camp-data": [ + { + "type": "MECHANISM", + "name": "Chapman", + "reactions": [ + { + "type": "PHOTOLYSIS", + "scaling_factor": 1, + "reactants": { + "O2": {} + }, + "products": { + "O": { + "yield": 2 + } + } + }, + { + "type": "PHOTOLYSIS", + "scaling_factor": 1, + "reactants": { + "O3": {} + }, + "products": { + "O1D": { + "yield": 1 + }, + "O2": { + "yield": 1 + } + } + }, + { + "type": "PHOTOLYSIS", + "scaling_factor": 1, + "reactants": { + "O3": {} + }, + "products": { + "O": { + "yield": 1 + }, + "O2": { + "yield": 1 + } + } + }, + { + "type": "ARRHENIUS", + "A": 2.15e-11, + "Ea": -1.518e-21, + "B": 0, + "D": 300, + "E": 0, + "reactants": { + "O1D": { + "qty": 1 + }, + "N2": { + "qty": 1 + } + }, + "products": { + "O": { + "yield": 1 + }, + "N2": { + "yield": 1 + } + } + }, + { + "type": "ARRHENIUS", + "A": 3.3e-11, + "Ea": -7.59e-22, + "B": 0, + "D": 300, + "E": 0, + "reactants": { + "O1D": { + "qty": 1 + }, + "O2": { + "qty": 1 + } + }, + "products": { + "O": { + "yield": 1 + }, + "O2": { + "yield": 1 + } + } + }, + { + "type": "ARRHENIUS", + "A": 8e-12, + "Ea": 2.8428e-20, + "B": 0, + "D": 300, + "E": 0, + "reactants": { + "O": { + "qty": 1 + }, + "O3": { + "qty": 1 + } + }, + "products": { + "O2": { + "yield": 2 + } + } + }, + { + "type": "ARRHENIUS", + "A": 6e-34, + "Ea": 0, + "B": -2.4, + "D": 300, + "E": 0, + "reactants": { + "O": { + "qty": 1 + }, + "O2": { + "qty": 1 + }, + "M": { + "qty": 1 + } + }, + "products": { + "O3": { + "yield": 1 + }, + "M": { + "yield": 1 + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/json/chapman/species.json b/examples/json/chapman/species.json new file mode 100644 index 00000000..3a60f8a9 --- /dev/null +++ b/examples/json/chapman/species.json @@ -0,0 +1,49 @@ +{ + "camp-data": [ + { + "name": "M", + "type": "CHEM_SPEC", + "tracer type": "CONSTANT" + }, + { + "name": "Ar", + "type": "CHEM_SPEC", + "absolute tolerance": 1e-12 + }, + { + "name": "CO2", + "type": "CHEM_SPEC", + "absolute tolerance": 1e-12 + }, + { + "name": "H2O", + "type": "CHEM_SPEC", + "absolute tolerance": 1e-12 + }, + { + "name": "O1D", + "type": "CHEM_SPEC", + "absolute tolerance": 1e-12 + }, + { + "name": "O", + "type": "CHEM_SPEC", + "absolute tolerance": 1e-12 + }, + { + "name": "O2", + "type": "CHEM_SPEC", + "absolute tolerance": 1e-12 + }, + { + "name": "O3", + "type": "CHEM_SPEC", + "absolute tolerance": 1e-12 + }, + { + "name": "N2", + "type": "CHEM_SPEC", + "absolute tolerance": 1e-12 + } + ] +} \ No newline at end of file diff --git a/examples/yaml/.DS_Store b/examples/yaml/.DS_Store new file mode 100644 index 00000000..af3a70dd Binary files /dev/null and b/examples/yaml/.DS_Store differ diff --git a/examples/yaml/chapman/chapman.zip b/examples/yaml/chapman/chapman.zip new file mode 100644 index 00000000..f51c63fa Binary files /dev/null and b/examples/yaml/chapman/chapman.zip differ diff --git a/examples/yaml/chapman/config.yaml b/examples/yaml/chapman/config.yaml new file mode 100644 index 00000000..bf986345 --- /dev/null +++ b/examples/yaml/chapman/config.yaml @@ -0,0 +1,3 @@ +camp-files: + - "species.yaml" + - "reactions.yaml" diff --git a/examples/yaml/chapman/reactions.yaml b/examples/yaml/chapman/reactions.yaml new file mode 100644 index 00000000..7d62fba2 --- /dev/null +++ b/examples/yaml/chapman/reactions.yaml @@ -0,0 +1,93 @@ +camp-data: + - type: MECHANISM + name: Chapman + reactions: + - type: PHOTOLYSIS + scaling_factor: 1 + reactants: + O2: {} + products: + O: + yield: 2 + - type: PHOTOLYSIS + scaling_factor: 1 + reactants: + O3: {} + products: + O1D: + yield: 1 + O2: + yield: 1 + - type: PHOTOLYSIS + scaling_factor: 1 + reactants: + O3: {} + products: + O: + yield: 1 + O2: + yield: 1 + - type: ARRHENIUS + A: 2.15e-11 + Ea: -1.518e-21 + B: 0 + D: 300 + E: 0 + reactants: + O1D: + qty: 1 + N2: + qty: 1 + products: + O: + yield: 1 + N2: + yield: 1 + - type: ARRHENIUS + A: 3.3e-11 + Ea: -7.59e-22 + B: 0 + D: 300 + E: 0 + reactants: + O1D: + qty: 1 + O2: + qty: 1 + products: + O: + yield: 1 + O2: + yield: 1 + - type: ARRHENIUS + A: 8e-12 + Ea: 2.8428e-20 + B: 0 + D: 300 + E: 0 + reactants: + O: + qty: 1 + O3: + qty: 1 + products: + O2: + yield: 2 + - type: ARRHENIUS + A: 6e-34 + Ea: 0 + B: -2.4 + D: 300 + E: 0 + reactants: + O: + qty: 1 + O2: + qty: 1 + M: + qty: 1 + products: + O3: + yield: 1 + M: + yield: 1 diff --git a/examples/yaml/chapman/species.yaml b/examples/yaml/chapman/species.yaml new file mode 100644 index 00000000..6b51400a --- /dev/null +++ b/examples/yaml/chapman/species.yaml @@ -0,0 +1,28 @@ +camp-data: + - name: M + type: CHEM_SPEC + tracer type: CONSTANT + - name: Ar + type: CHEM_SPEC + absolute tolerance: 1e-12 + - name: CO2 + type: CHEM_SPEC + absolute tolerance: 1e-12 + - name: H2O + type: CHEM_SPEC + absolute tolerance: 1e-12 + - name: O1D + type: CHEM_SPEC + absolute tolerance: 1e-12 + - name: O + type: CHEM_SPEC + absolute tolerance: 1e-12 + - name: O2 + type: CHEM_SPEC + absolute tolerance: 1e-12 + - name: O3 + type: CHEM_SPEC + absolute tolerance: 1e-12 + - name: N2 + type: CHEM_SPEC + absolute tolerance: 1e-12 \ No newline at end of file