snf-simulations 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. snf_simulations-1.0.2/.git-blame-ignore-revs +3 -0
  2. snf_simulations-1.0.2/.github/workflows/documentation.yml +35 -0
  3. snf_simulations-1.0.2/.github/workflows/publish.yml +29 -0
  4. snf_simulations-1.0.2/.github/workflows/pytest.yml +19 -0
  5. snf_simulations-1.0.2/.github/workflows/ruff.yml +8 -0
  6. snf_simulations-1.0.2/.gitignore +224 -0
  7. snf_simulations-1.0.2/LICENSE.txt +11 -0
  8. snf_simulations-1.0.2/PKG-INFO +37 -0
  9. snf_simulations-1.0.2/README.md +11 -0
  10. snf_simulations-1.0.2/docs/Makefile +20 -0
  11. snf_simulations-1.0.2/docs/autodoc2_docstrings_parser.py +22 -0
  12. snf_simulations-1.0.2/docs/conf.py +69 -0
  13. snf_simulations-1.0.2/docs/examples.ipynb +633 -0
  14. snf_simulations-1.0.2/docs/index.md +8 -0
  15. snf_simulations-1.0.2/docs/make.bat +35 -0
  16. snf_simulations-1.0.2/docs/user_guide/about.md +25 -0
  17. snf_simulations-1.0.2/docs/user_guide/cask.md +5 -0
  18. snf_simulations-1.0.2/docs/user_guide/index.md +8 -0
  19. snf_simulations-1.0.2/docs/user_guide/spectrum.md +3 -0
  20. snf_simulations-1.0.2/pyproject.toml +92 -0
  21. snf_simulations-1.0.2/setup.cfg +4 -0
  22. snf_simulations-1.0.2/src/snf_simulations/__init__.py +6 -0
  23. snf_simulations-1.0.2/src/snf_simulations/_version.py +24 -0
  24. snf_simulations-1.0.2/src/snf_simulations/cask.py +179 -0
  25. snf_simulations-1.0.2/src/snf_simulations/data/__init__.py +135 -0
  26. snf_simulations-1.0.2/src/snf_simulations/data/isotopes.csv +17 -0
  27. snf_simulations-1.0.2/src/snf_simulations/data/reactor_data/hartlepool.csv +17 -0
  28. snf_simulations-1.0.2/src/snf_simulations/data/reactor_data/sizewell.csv +17 -0
  29. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Am242_an.txt +1 -0
  30. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Ce144_an.txt +1 -0
  31. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Cs135_an.txt +1 -0
  32. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Cs137_an.txt +1 -0
  33. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/I129_an.txt +1 -0
  34. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Kr88_an.txt +1 -0
  35. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Np239_an.txt +1 -0
  36. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Pr144_an.txt +1 -0
  37. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Pu241_an.txt +1 -0
  38. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Rb88_an.txt +1 -0
  39. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Rh106_an.txt +1 -0
  40. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Ru106_an.txt +396 -0
  41. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Sr90_an.txt +1 -0
  42. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Tc99_an.txt +1 -0
  43. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Y90_an.txt +1 -0
  44. snf_simulations-1.0.2/src/snf_simulations/data/spec_data/Zr93_an.txt +1 -0
  45. snf_simulations-1.0.2/src/snf_simulations/physics.py +144 -0
  46. snf_simulations-1.0.2/src/snf_simulations/py.typed +0 -0
  47. snf_simulations-1.0.2/src/snf_simulations/scripts/__init__.py +1 -0
  48. snf_simulations-1.0.2/src/snf_simulations/scripts/command_line.py +365 -0
  49. snf_simulations-1.0.2/src/snf_simulations/spec.py +279 -0
  50. snf_simulations-1.0.2/src/snf_simulations/utils.py +138 -0
  51. snf_simulations-1.0.2/src/snf_simulations.egg-info/PKG-INFO +37 -0
  52. snf_simulations-1.0.2/src/snf_simulations.egg-info/SOURCES.txt +68 -0
  53. snf_simulations-1.0.2/src/snf_simulations.egg-info/dependency_links.txt +1 -0
  54. snf_simulations-1.0.2/src/snf_simulations.egg-info/entry_points.txt +2 -0
  55. snf_simulations-1.0.2/src/snf_simulations.egg-info/requires.txt +2 -0
  56. snf_simulations-1.0.2/src/snf_simulations.egg-info/top_level.txt +1 -0
  57. snf_simulations-1.0.2/tests/__init__.py +1 -0
  58. snf_simulations-1.0.2/tests/data/Hartlepool_multiple.csv +5315 -0
  59. snf_simulations-1.0.2/tests/data/Hartlepool_single.csv +5315 -0
  60. snf_simulations-1.0.2/tests/data/Sizewell_multiple.csv +5315 -0
  61. snf_simulations-1.0.2/tests/data/Sizewell_single.csv +5315 -0
  62. snf_simulations-1.0.2/tests/data/__init__.py +1 -0
  63. snf_simulations-1.0.2/tests/test_cask.py +91 -0
  64. snf_simulations-1.0.2/tests/test_commandline.py +162 -0
  65. snf_simulations-1.0.2/tests/test_data.py +165 -0
  66. snf_simulations-1.0.2/tests/test_numpy_root.py +693 -0
  67. snf_simulations-1.0.2/tests/test_physics.py +125 -0
  68. snf_simulations-1.0.2/tests/test_spec.py +658 -0
  69. snf_simulations-1.0.2/tests/test_utils.py +200 -0
  70. snf_simulations-1.0.2/uv.lock +1755 -0
@@ -0,0 +1,3 @@
1
+ # major linting
2
+ e92002c91dde35bc0ee6abfc16062fc545f31aaf
3
+ a846ea7361c3e3c86b609d0657e16b8d9fd9b1a4
@@ -0,0 +1,35 @@
1
+ name: documentation
2
+
3
+ on: [push, pull_request, workflow_dispatch]
4
+
5
+ permissions:
6
+ contents: write
7
+
8
+ jobs:
9
+ docs:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ with:
14
+ fetch-depth: 0
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: '3.10'
18
+ - name: Install dependencies
19
+ run: |
20
+ python -m pip install --upgrade pip
21
+ pip install .
22
+ - name: Install documentation dependencies
23
+ run: |
24
+ pip install sphinx sphinx-autodoc2 myst_parser pydata-sphinx-theme
25
+ - name: Sphinx build
26
+ run: |
27
+ sphinx-build docs _build
28
+ - name: Deploy to GitHub Pages
29
+ uses: peaceiris/actions-gh-pages@v3
30
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
31
+ with:
32
+ publish_branch: gh-pages
33
+ github_token: ${{ secrets.GITHUB_TOKEN }}
34
+ publish_dir: _build/
35
+ force_orphan: true
@@ -0,0 +1,29 @@
1
+ name: Publish to PyPI
2
+ on:
3
+ release:
4
+ types: [created]
5
+
6
+ jobs:
7
+ pypi-publish:
8
+ name: Publish release to PyPI
9
+ runs-on: ubuntu-latest
10
+ environment:
11
+ name: pypi
12
+ url: https://pypi.org/p/snf_simulations
13
+ permissions:
14
+ id-token: write
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v4
19
+ with:
20
+ python-version: "3.x"
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install setuptools wheel build
25
+ - name: Build package
26
+ run: |
27
+ python -m build
28
+ - name: Publish package distributions to PyPI
29
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,19 @@
1
+ name: Pytest
2
+ on: [ push, pull_request ]
3
+ jobs:
4
+ pytest:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v5
8
+ - name: Set up Python
9
+ uses: actions/setup-python@v5
10
+ with:
11
+ python-version: '3.10'
12
+ - name: Install dependencies
13
+ run: |
14
+ python -m pip install --upgrade pip
15
+ pip install .
16
+ - name: Test with pytest
17
+ run: |
18
+ pip install pytest pytest-cov
19
+ pytest tests/ --doctest-modules --junitxml=junit/test-results.xml --cov=snf_simulations --cov-report=xml --cov-report=html
@@ -0,0 +1,8 @@
1
+ name: Ruff
2
+ on: [ push, pull_request ]
3
+ jobs:
4
+ ruff:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v5
8
+ - uses: astral-sh/ruff-action@v3
@@ -0,0 +1,224 @@
1
+ # source: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore
2
+
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ *.py[codz]
6
+ *$py.class
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ build/
14
+ develop-eggs/
15
+ dist/
16
+ downloads/
17
+ eggs/
18
+ .eggs/
19
+ lib/
20
+ lib64/
21
+ parts/
22
+ sdist/
23
+ var/
24
+ wheels/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+
31
+ # PyInstaller
32
+ # Usually these files are written by a python script from a template
33
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py.cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ cover/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+ docs/apidocs/
76
+
77
+ # PyBuilder
78
+ .pybuilder/
79
+ target/
80
+
81
+ # Jupyter Notebook
82
+ .ipynb_checkpoints
83
+
84
+ # IPython
85
+ profile_default/
86
+ ipython_config.py
87
+
88
+ # pyenv
89
+ # For a library or package, you might want to ignore these files since the code is
90
+ # intended to run in multiple environments; otherwise, check them in:
91
+ # .python-version
92
+
93
+ # pipenv
94
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
96
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
97
+ # install all needed dependencies.
98
+ # Pipfile.lock
99
+
100
+ # UV
101
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
102
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
103
+ # commonly ignored for libraries.
104
+ # uv.lock
105
+
106
+ # poetry
107
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111
+ # poetry.lock
112
+ # poetry.toml
113
+
114
+ # pdm
115
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
116
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
117
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
118
+ # pdm.lock
119
+ # pdm.toml
120
+ .pdm-python
121
+ .pdm-build/
122
+
123
+ # pixi
124
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
125
+ # pixi.lock
126
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
127
+ # in the .venv directory. It is recommended not to include this directory in version control.
128
+ .pixi
129
+
130
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
131
+ __pypackages__/
132
+
133
+ # Celery stuff
134
+ celerybeat-schedule
135
+ celerybeat.pid
136
+
137
+ # Redis
138
+ *.rdb
139
+ *.aof
140
+ *.pid
141
+
142
+ # RabbitMQ
143
+ mnesia/
144
+ rabbitmq/
145
+ rabbitmq-data/
146
+
147
+ # ActiveMQ
148
+ activemq-data/
149
+
150
+ # SageMath parsed files
151
+ *.sage.py
152
+
153
+ # Environments
154
+ .env
155
+ .envrc
156
+ .venv
157
+ env/
158
+ venv/
159
+ ENV/
160
+ env.bak/
161
+ venv.bak/
162
+
163
+ # Spyder project settings
164
+ .spyderproject
165
+ .spyproject
166
+
167
+ # Rope project settings
168
+ .ropeproject
169
+
170
+ # mkdocs documentation
171
+ /site
172
+
173
+ # mypy
174
+ .mypy_cache/
175
+ .dmypy.json
176
+ dmypy.json
177
+
178
+ # Pyre type checker
179
+ .pyre/
180
+
181
+ # pytype static type analyzer
182
+ .pytype/
183
+
184
+ # Cython debug symbols
185
+ cython_debug/
186
+
187
+ # PyCharm
188
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
189
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
190
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
191
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
192
+ # .idea/
193
+
194
+ # Abstra
195
+ # Abstra is an AI-powered process automation framework.
196
+ # Ignore directories containing user credentials, local state, and settings.
197
+ # Learn more at https://abstra.io/docs
198
+ .abstra/
199
+
200
+ # Visual Studio Code
201
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
202
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
203
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
204
+ # you could uncomment the following to ignore the entire vscode folder
205
+ .vscode/*
206
+ *.code-workspace
207
+ *.vsix
208
+
209
+ # Ruff stuff:
210
+ .ruff_cache/
211
+
212
+ # PyPI configuration file
213
+ .pypirc
214
+
215
+ # Marimo
216
+ marimo/_static/
217
+ marimo/_lsp/
218
+ __marimo__/
219
+
220
+ # Streamlit
221
+ .streamlit/secrets.toml
222
+
223
+ # Setuptools-scm version file
224
+ src/snf_simulations/_version.py
@@ -0,0 +1,11 @@
1
+ Copyright (c) 2025, E Kneale
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.4
2
+ Name: snf_simulations
3
+ Version: 1.0.2
4
+ Summary: Simulate antineutrino spectra for different compositions of spent nuclear fuel.
5
+ Author-email: Zuzanna Leliwa <zleliwa1@sheffield.ac.uk>, Abigail Power <apower3@sheffield.ac.uk>, Liz Kneale <e.kneale@sheffield.ac.uk>, Martin Dyer <martin.dyer@sheffield.ac.uk>
6
+ Maintainer-email: Liz Kneale <e.kneale@sheffield.ac.uk>
7
+ License-Expression: BSD-3-Clause
8
+ Project-URL: homepage, https://github.com/ekneale/SNF-simulations
9
+ Project-URL: documentation, https://github.com/ekneale/SNF-simulations
10
+ Project-URL: repository, https://github.com/ekneale/SNF-simulations
11
+ Keywords: nuclear,antineutrino,spectrum
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Topic :: Scientific/Engineering :: Physics
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE.txt
23
+ Requires-Dist: numpy
24
+ Requires-Dist: matplotlib
25
+ Dynamic: license-file
26
+
27
+ # SNF-simulations
28
+ SNF-simulations generates antineutrino spectra that can be used to simulate the antineutrino emission from spent nuclear fuel (SNF).
29
+
30
+ For more information about what this package does and how to use it, see the [documentation](https://ekneale.github.io/SNF-simulations/index.html).
31
+
32
+ ## Installation
33
+ To use, clone the repository then use the package manager [pip](https://pip.pypa.io/en/stable/) to install SNF_simulations.
34
+
35
+ ```bash
36
+ pip install snf-simulations
37
+ ```
@@ -0,0 +1,11 @@
1
+ # SNF-simulations
2
+ SNF-simulations generates antineutrino spectra that can be used to simulate the antineutrino emission from spent nuclear fuel (SNF).
3
+
4
+ For more information about what this package does and how to use it, see the [documentation](https://ekneale.github.io/SNF-simulations/index.html).
5
+
6
+ ## Installation
7
+ To use, clone the repository then use the package manager [pip](https://pip.pypa.io/en/stable/) to install SNF_simulations.
8
+
9
+ ```bash
10
+ pip install snf-simulations
11
+ ```
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,22 @@
1
+ # https://github.com/sphinx-extensions2/sphinx-autodoc2/issues/33#issuecomment-2684177928
2
+
3
+ from docutils import nodes
4
+ from myst_parser.parsers.sphinx_ import MystParser
5
+ from sphinx.ext.napoleon import docstring
6
+
7
+
8
+ class NapoleonParser(MystParser):
9
+ def parse(self, input_string: str, document: nodes.document) -> None:
10
+ # Get the Sphinx configuration
11
+ config = document.settings.env.config
12
+
13
+ parsed_content = str(
14
+ docstring.GoogleDocstring(
15
+ str(docstring.NumpyDocstring(input_string, config)),
16
+ config,
17
+ )
18
+ )
19
+ return super().parse(parsed_content, document)
20
+
21
+
22
+ Parser = NapoleonParser
@@ -0,0 +1,69 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # For the full list of built-in configuration values, see the documentation:
4
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
+
6
+ # -- Project information -----------------------------------------------------
7
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
+
9
+ project = "SNF-simulations"
10
+ copyright = "2026, Zuzanna Leliwa, Abigail Power, Liz Kneale, Martin Dyer"
11
+ author = "Zuzanna Leliwa, Abigail Power, Liz Kneale, Martin Dyer"
12
+ from importlib.metadata import version as get_version
13
+ release = get_version("snf_simulations")
14
+ release = ".".join(release.split('.')[:3]) # Only use major.minor.patch for docs
15
+
16
+ # -- General configuration ---------------------------------------------------
17
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
18
+
19
+ templates_path = ["_templates"]
20
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
21
+
22
+ # -- Options for HTML output -------------------------------------------------
23
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
24
+
25
+ html_theme = "pydata_sphinx_theme"
26
+ html_static_path = ["_static"]
27
+
28
+ # -- Extensions configuration ------------------------------------------------
29
+
30
+ extensions = [
31
+ "myst_parser", # Markdown support
32
+ "autodoc2", # Automatic API documentation generation
33
+ "sphinx.ext.napoleon", # Parse Google and NumPy style docstrings
34
+ "sphinx.ext.viewcode", # Add links to source code
35
+ ]
36
+
37
+ # -- Options for MyST Parser -------------------------------------------------
38
+ # https://myst-parser.readthedocs.io/en/latest/index.html
39
+
40
+ myst_enable_extensions = [
41
+ "fieldlist",
42
+ ]
43
+
44
+ # -- Options for autodoc2 ---------------------------------------------------
45
+ # https://sphinx-autodoc2.readthedocs.io/en/latest/index.html
46
+
47
+ autodoc2_packages = [
48
+ "../src/snf_simulations",
49
+ ]
50
+ autodoc2_render_plugin = "myst"
51
+
52
+ autodoc2_sort_names = True
53
+ autodoc2_class_docstring = "both"
54
+ autodoc2_hidden_objects = {"inherited", "dunder"}
55
+
56
+ # Below is needed for autodoc2_docstrings_parser,
57
+ # see https://github.com/sphinx-extensions2/sphinx-autodoc2/issues/33#issuecomment-2684177928
58
+ import os
59
+ import sys
60
+ sys.path.insert(0, os.path.abspath("."))
61
+ autodoc2_docstring_parser_regexes = [
62
+ (r".*", "autodoc2_docstrings_parser"),
63
+ ]
64
+
65
+ # -- Options for Napoleon -----------------------------------------------------
66
+ # https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
67
+
68
+ napoleon_google_docstring = True
69
+ napoleon_use_ivar = True