PyTracerLab 0.2.0__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 (113) hide show
  1. pytracerlab-0.2.0/.github/workflows/ci.yml +22 -0
  2. pytracerlab-0.2.0/.github/workflows/docs.yml +38 -0
  3. pytracerlab-0.2.0/.github/workflows/release.yml +117 -0
  4. pytracerlab-0.2.0/.gitignore +22 -0
  5. pytracerlab-0.2.0/.pre-commit-config.yaml +27 -0
  6. pytracerlab-0.2.0/LICENSE +21 -0
  7. pytracerlab-0.2.0/PKG-INFO +37 -0
  8. pytracerlab-0.2.0/docs/_static/.gitkeep +0 -0
  9. pytracerlab-0.2.0/docs/_static/logo.png +0 -0
  10. pytracerlab-0.2.0/docs/api/PyTracerLab.gui.app.rst +7 -0
  11. pytracerlab-0.2.0/docs/api/PyTracerLab.gui.controller.rst +7 -0
  12. pytracerlab-0.2.0/docs/api/PyTracerLab.gui.database.rst +7 -0
  13. pytracerlab-0.2.0/docs/api/PyTracerLab.gui.main_window.rst +7 -0
  14. pytracerlab-0.2.0/docs/api/PyTracerLab.gui.rst +22 -0
  15. pytracerlab-0.2.0/docs/api/PyTracerLab.gui.state.rst +7 -0
  16. pytracerlab-0.2.0/docs/api/PyTracerLab.model.model.rst +7 -0
  17. pytracerlab-0.2.0/docs/api/PyTracerLab.model.registry.rst +7 -0
  18. pytracerlab-0.2.0/docs/api/PyTracerLab.model.rst +21 -0
  19. pytracerlab-0.2.0/docs/api/PyTracerLab.model.solver.rst +7 -0
  20. pytracerlab-0.2.0/docs/api/PyTracerLab.model.units.rst +7 -0
  21. pytracerlab-0.2.0/docs/api/PyTracerLab.rst +19 -0
  22. pytracerlab-0.2.0/docs/api/modules.rst +7 -0
  23. pytracerlab-0.2.0/docs/conf.py +88 -0
  24. pytracerlab-0.2.0/docs/development/devguide.md +16 -0
  25. pytracerlab-0.2.0/docs/development/index.md +9 -0
  26. pytracerlab-0.2.0/docs/development/package_scheme.png +0 -0
  27. pytracerlab-0.2.0/docs/examples/3H_SF6_input.csv +122 -0
  28. pytracerlab-0.2.0/docs/examples/3H_SF6_observations.csv +122 -0
  29. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_input_6monthly.csv +242 -0
  30. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_input_multitracer.csv +242 -0
  31. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_input_multitracer_yearly.csv +122 -0
  32. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_input_yearly.csv +172 -0
  33. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_observations_6monthly.csv +242 -0
  34. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_observations_multitracer.csv +242 -0
  35. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_observations_yearly.csv +172 -0
  36. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_simulations_1.csv +62 -0
  37. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_simulations_2.csv +62 -0
  38. pytracerlab-0.2.0/docs/examples/TracerLPM_benchmark_simulations_3.csv +62 -0
  39. pytracerlab-0.2.0/docs/examples/benchmark_input_monthly.csv +121 -0
  40. pytracerlab-0.2.0/docs/examples/benchmark_input_yearly.csv +11 -0
  41. pytracerlab-0.2.0/docs/examples/calibration_benchmark.png +0 -0
  42. pytracerlab-0.2.0/docs/examples/calibration_benchmark_4models.png +0 -0
  43. pytracerlab-0.2.0/docs/examples/errors_benchmark.png +0 -0
  44. pytracerlab-0.2.0/docs/examples/example_01.ipynb +319 -0
  45. pytracerlab-0.2.0/docs/examples/example_02.ipynb +449 -0
  46. pytracerlab-0.2.0/docs/examples/example_03.ipynb +440 -0
  47. pytracerlab-0.2.0/docs/examples/example_04.ipynb +296 -0
  48. pytracerlab-0.2.0/docs/examples/example_05.ipynb +387 -0
  49. pytracerlab-0.2.0/docs/examples/example_06.ipynb +260 -0
  50. pytracerlab-0.2.0/docs/examples/example_07.ipynb +1651 -0
  51. pytracerlab-0.2.0/docs/examples/example_08.ipynb +721 -0
  52. pytracerlab-0.2.0/docs/examples/example_09.ipynb +2192 -0
  53. pytracerlab-0.2.0/docs/examples/example_10.ipynb +2116 -0
  54. pytracerlab-0.2.0/docs/examples/example_11.ipynb +555 -0
  55. pytracerlab-0.2.0/docs/examples/example_input_series_1tracer.csv +601 -0
  56. pytracerlab-0.2.0/docs/examples/example_input_series_2tracer.csv +1201 -0
  57. pytracerlab-0.2.0/docs/examples/example_observation_series_1tracer.csv +601 -0
  58. pytracerlab-0.2.0/docs/examples/example_observation_series_2tracer.csv +1201 -0
  59. pytracerlab-0.2.0/docs/examples/example_output_series_1tracer.csv +601 -0
  60. pytracerlab-0.2.0/docs/examples/example_output_series_2tracer.csv +1201 -0
  61. pytracerlab-0.2.0/docs/examples/index.md +14 -0
  62. pytracerlab-0.2.0/docs/examples/input_monthly_modflow.csv +601 -0
  63. pytracerlab-0.2.0/docs/examples/joint_posterior_benchmark.png +0 -0
  64. pytracerlab-0.2.0/docs/examples/modflow_PyTracerLab.png +0 -0
  65. pytracerlab-0.2.0/docs/examples/obs_monthly_modflow.csv +601 -0
  66. pytracerlab-0.2.0/docs/examples/simulation_benchmark.png +0 -0
  67. pytracerlab-0.2.0/docs/examples/test_input_14C_yearly.csv +11 -0
  68. pytracerlab-0.2.0/docs/examples/test_target_14C_yearly.csv +11 -0
  69. pytracerlab-0.2.0/docs/examples/tracer_tracer_plots_benchmark.png +0 -0
  70. pytracerlab-0.2.0/docs/examples/tts_weights_modflow.csv +5194 -0
  71. pytracerlab-0.2.0/docs/index.md +56 -0
  72. pytracerlab-0.2.0/docs/userguide/concepts.md +3 -0
  73. pytracerlab-0.2.0/docs/userguide/index.md +11 -0
  74. pytracerlab-0.2.0/docs/userguide/plot.png +0 -0
  75. pytracerlab-0.2.0/docs/userguide/report.png +0 -0
  76. pytracerlab-0.2.0/docs/userguide/tab01.png +0 -0
  77. pytracerlab-0.2.0/docs/userguide/tab02.png +0 -0
  78. pytracerlab-0.2.0/docs/userguide/tab03.png +0 -0
  79. pytracerlab-0.2.0/docs/userguide/tab04.png +0 -0
  80. pytracerlab-0.2.0/docs/userguide/usage.md +160 -0
  81. pytracerlab-0.2.0/docs/userguide/usage_de.md +3 -0
  82. pytracerlab-0.2.0/logo.png +0 -0
  83. pytracerlab-0.2.0/pyproject.toml +79 -0
  84. pytracerlab-0.2.0/pytracerlab_icon.ico +0 -0
  85. pytracerlab-0.2.0/readme.md +24 -0
  86. pytracerlab-0.2.0/setup.cfg +4 -0
  87. pytracerlab-0.2.0/src/PyTracerLab/__init__.py +8 -0
  88. pytracerlab-0.2.0/src/PyTracerLab/__main__.py +7 -0
  89. pytracerlab-0.2.0/src/PyTracerLab/gui/__init__.py +10 -0
  90. pytracerlab-0.2.0/src/PyTracerLab/gui/app.py +15 -0
  91. pytracerlab-0.2.0/src/PyTracerLab/gui/controller.py +419 -0
  92. pytracerlab-0.2.0/src/PyTracerLab/gui/database.py +16 -0
  93. pytracerlab-0.2.0/src/PyTracerLab/gui/main_window.py +75 -0
  94. pytracerlab-0.2.0/src/PyTracerLab/gui/state.py +122 -0
  95. pytracerlab-0.2.0/src/PyTracerLab/gui/tabs/file_input.py +436 -0
  96. pytracerlab-0.2.0/src/PyTracerLab/gui/tabs/model_design.py +322 -0
  97. pytracerlab-0.2.0/src/PyTracerLab/gui/tabs/parameters.py +131 -0
  98. pytracerlab-0.2.0/src/PyTracerLab/gui/tabs/simulation.py +300 -0
  99. pytracerlab-0.2.0/src/PyTracerLab/gui/tabs/solver_params.py +697 -0
  100. pytracerlab-0.2.0/src/PyTracerLab/gui/tabs/tracer_tracer.py +331 -0
  101. pytracerlab-0.2.0/src/PyTracerLab/gui/tabs/widgets.py +106 -0
  102. pytracerlab-0.2.0/src/PyTracerLab/model/__init__.py +52 -0
  103. pytracerlab-0.2.0/src/PyTracerLab/model/model.py +680 -0
  104. pytracerlab-0.2.0/src/PyTracerLab/model/registry.py +25 -0
  105. pytracerlab-0.2.0/src/PyTracerLab/model/solver.py +1335 -0
  106. pytracerlab-0.2.0/src/PyTracerLab/model/units.py +626 -0
  107. pytracerlab-0.2.0/src/PyTracerLab.egg-info/PKG-INFO +37 -0
  108. pytracerlab-0.2.0/src/PyTracerLab.egg-info/SOURCES.txt +111 -0
  109. pytracerlab-0.2.0/src/PyTracerLab.egg-info/dependency_links.txt +1 -0
  110. pytracerlab-0.2.0/src/PyTracerLab.egg-info/entry_points.txt +5 -0
  111. pytracerlab-0.2.0/src/PyTracerLab.egg-info/requires.txt +17 -0
  112. pytracerlab-0.2.0/src/PyTracerLab.egg-info/top_level.txt +1 -0
  113. pytracerlab-0.2.0/tests/test_model.py +61 -0
@@ -0,0 +1,22 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-python@v5
13
+ with:
14
+ python-version: '3.11'
15
+ - name: Install deps (pkg + dev tools)
16
+ run: |
17
+ python -m pip install -U pip
18
+ pip install -e .[dev]
19
+ - name: Run pre-commit
20
+ run: pre-commit run --all-files
21
+ - name: Run tests
22
+ run: pytest -q
@@ -0,0 +1,38 @@
1
+ name: Docs
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+
6
+ jobs:
7
+ deploy:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ contents: write
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - uses: actions/setup-python@v5
15
+ with:
16
+ python-version: "3.11"
17
+
18
+ - name: Install doc deps
19
+ run: |
20
+ python -m pip install -U pip
21
+ # Either install dev extras...
22
+ # pip install -e .[dev]
23
+ # ...or install only what's needed for docs:
24
+ pip install sphinx myst-parser furo sphinx-design myst-nb
25
+
26
+ - name: Generate API stubs (sphinx-apidoc)
27
+ run: |
28
+ python -m sphinx.ext.apidoc -o docs/api src/PyTracerLab -f -e
29
+
30
+ - name: Build HTML
31
+ run: |
32
+ sphinx-build -b html -W -E docs docs/_build/html
33
+
34
+ - name: Publish to gh-pages
35
+ uses: peaceiris/actions-gh-pages@v3
36
+ with:
37
+ github_token: ${{ secrets.GITHUB_TOKEN }}
38
+ publish_dir: docs/_build/html
@@ -0,0 +1,117 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ tags:
5
+ - 'v*'
6
+ # optional but handy:
7
+ workflow_dispatch:
8
+ release:
9
+ types: [published]
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ with:
17
+ fetch-depth: 0
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: '3.11'
21
+ - run: python -m pip install -U pip build twine
22
+ - run: python -m build
23
+ - run: twine check dist/*
24
+ - name: Inspect METADATA/PKG-INFO
25
+ run: |
26
+ python - << 'PY'
27
+ import glob, zipfile, tarfile
28
+ whl = sorted(glob.glob('dist/*.whl'))[-1]
29
+ with zipfile.ZipFile(whl) as zf:
30
+ meta = [n for n in zf.namelist() if n.endswith('METADATA')][0]
31
+ text = zf.read(meta).decode('utf-8', errors='replace')
32
+ print("---- WHEEL METADATA ----")
33
+ print("\n".join([l for l in text.splitlines()
34
+ if l.startswith(('Metadata-Version','Name:','Version:',
35
+ 'Summary:','Description-Content-Type',
36
+ 'Classifier','Requires-Python'))]))
37
+ print("\nHas Description section? ", "\n\n" in text)
38
+
39
+ sdist = sorted(glob.glob('dist/*.tar.gz'))[-1]
40
+ import tarfile
41
+ with tarfile.open(sdist, 'r:gz') as tf:
42
+ member = [m for m in tf.getmembers() if m.name.endswith('PKG-INFO')][0]
43
+ text = tf.extractfile(member).read().decode('utf-8', errors='replace')
44
+ print("\n---- SDIST PKG-INFO ----")
45
+ print("\n".join([l for l in text.splitlines()
46
+ if l.startswith(('Metadata-Version','Name:','Version:',
47
+ 'Summary:','Description-Content-Type',
48
+ 'Classifier','Requires-Python'))]))
49
+ print("\nHas Description section? ", "\n\n" in text)
50
+ PY
51
+ - uses: actions/upload-artifact@v4
52
+ with:
53
+ name: dist
54
+ path: dist/*
55
+
56
+ pyinstaller-windows:
57
+ runs-on: windows-latest
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ with:
61
+ fetch-depth: 0
62
+ - uses: actions/setup-python@v5
63
+ with:
64
+ python-version: "3.11"
65
+ - name: Install package + PyInstaller
66
+ run: |
67
+ python -m pip install -U pip
68
+ pip install pyinstaller .
69
+ - name: Build EXE (one-file)
70
+ run: pyinstaller --noconfirm --onefile --windowed --name PyTracerLab -p src --hidden-import=scipy.signal --hidden-import=scipy.optimize src/PyTracerLab/__main__.py
71
+ - name: (Optional) add tag to filename
72
+ if: startsWith(github.ref, 'refs/tags/')
73
+ shell: pwsh
74
+ run: |
75
+ Rename-Item dist\PyTracerLab.exe "PyTracerLab-${{ github.ref_name }}.exe"
76
+ - uses: actions/upload-artifact@v4
77
+ with:
78
+ name: PyTracerLab-win
79
+ path: dist\*.exe
80
+
81
+ pypi-publish:
82
+ needs: build
83
+ runs-on: ubuntu-latest
84
+ permissions:
85
+ id-token: write
86
+ contents: read
87
+ steps:
88
+ - uses: actions/download-artifact@v4
89
+ with:
90
+ name: dist
91
+ path: dist
92
+ - name: Publish to PyPI via OIDC
93
+ uses: pypa/gh-action-pypi-publish@release/v1
94
+ with:
95
+ packages-dir: dist
96
+
97
+ github-release:
98
+ needs: [build, pyinstaller-windows]
99
+ runs-on: ubuntu-latest
100
+ steps:
101
+ - uses: actions/download-artifact@v4
102
+ with:
103
+ name: dist
104
+ path: dist
105
+ - uses: actions/download-artifact@v4
106
+ with:
107
+ name: PyTracerLab-win
108
+ path: dist
109
+ - uses: softprops/action-gh-release@v2
110
+ with:
111
+ files: |
112
+ dist/*.whl
113
+ dist/*.tar.gz
114
+ dist/*.exe
115
+ generate_release_notes: true
116
+ env:
117
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,22 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .venv/
6
+ .env
7
+
8
+ # Build artifacts
9
+ build/
10
+ dist/
11
+ *.spec
12
+
13
+ # IDE
14
+ .vscode/
15
+ .idea/
16
+
17
+ # OS
18
+ .DS_Store
19
+ Thumbs.db
20
+
21
+ # Locally built docs
22
+ docs/_build/
@@ -0,0 +1,27 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: black
5
+ name: black
6
+ entry: python -m black
7
+ language: system
8
+ types: [python]
9
+
10
+ - id: ruff
11
+ name: ruff
12
+ entry: python -m ruff check
13
+ language: system
14
+ args: [--fix]
15
+ types: [python]
16
+
17
+ - id: end-of-file-fixer
18
+ name: end-of-file-fixer
19
+ entry: python -m pre_commit_hooks.end_of_file_fixer
20
+ language: system
21
+ types: [text]
22
+
23
+ - id: trailing-whitespace
24
+ name: trailing-whitespace
25
+ entry: python -m pre_commit_hooks.trailing_whitespace_fixer
26
+ language: system
27
+ types: [text]
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 M. G. Rudolph
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyTracerLab
3
+ Version: 0.2.0
4
+ Summary: Lumped parameter groundwater age simulations with a simple user interface - in Python
5
+ Author: Max G. Rudolph
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/iGW-TU-Dresden/PyTracerLab
8
+ Project-URL: Documentation, https://iGW-TU-Dresden.github.io/PyTracerLab/
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Topic :: Scientific/Engineering :: Hydrology
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: Intended Audience :: End Users/Desktop
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 10
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy>=1.24
22
+ Requires-Dist: matplotlib>=3.7
23
+ Requires-Dist: scipy>=1.10
24
+ Requires-Dist: PyQt5>=5.15
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest; extra == "dev"
27
+ Requires-Dist: pre-commit; extra == "dev"
28
+ Requires-Dist: black; extra == "dev"
29
+ Requires-Dist: ruff; extra == "dev"
30
+ Requires-Dist: pre-commit-hooks; extra == "dev"
31
+ Requires-Dist: mkdocs-material; extra == "dev"
32
+ Requires-Dist: mkdocstrings[python]; extra == "dev"
33
+ Requires-Dist: sphinx; extra == "dev"
34
+ Requires-Dist: furo; extra == "dev"
35
+ Requires-Dist: myst-parser; extra == "dev"
36
+ Requires-Dist: sphinx-autodoc-typehints; extra == "dev"
37
+ Dynamic: license-file
File without changes
Binary file
@@ -0,0 +1,7 @@
1
+ PyTracerLab.gui.app module
2
+ ==========================
3
+
4
+ .. automodule:: PyTracerLab.gui.app
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab.gui.controller module
2
+ =================================
3
+
4
+ .. automodule:: PyTracerLab.gui.controller
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab.gui.database module
2
+ ===============================
3
+
4
+ .. automodule:: PyTracerLab.gui.database
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab.gui.main\_window module
2
+ ===================================
3
+
4
+ .. automodule:: PyTracerLab.gui.main_window
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,22 @@
1
+ PyTracerLab.gui package
2
+ =======================
3
+
4
+ Submodules
5
+ ----------
6
+
7
+ .. toctree::
8
+ :maxdepth: 4
9
+
10
+ PyTracerLab.gui.app
11
+ PyTracerLab.gui.controller
12
+ PyTracerLab.gui.database
13
+ PyTracerLab.gui.main_window
14
+ PyTracerLab.gui.state
15
+
16
+ Module contents
17
+ ---------------
18
+
19
+ .. automodule:: PyTracerLab.gui
20
+ :members:
21
+ :show-inheritance:
22
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab.gui.state module
2
+ ============================
3
+
4
+ .. automodule:: PyTracerLab.gui.state
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab.model.model module
2
+ ==============================
3
+
4
+ .. automodule:: PyTracerLab.model.model
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab.model.registry module
2
+ =================================
3
+
4
+ .. automodule:: PyTracerLab.model.registry
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,21 @@
1
+ PyTracerLab.model package
2
+ =========================
3
+
4
+ Submodules
5
+ ----------
6
+
7
+ .. toctree::
8
+ :maxdepth: 4
9
+
10
+ PyTracerLab.model.model
11
+ PyTracerLab.model.registry
12
+ PyTracerLab.model.solver
13
+ PyTracerLab.model.units
14
+
15
+ Module contents
16
+ ---------------
17
+
18
+ .. automodule:: PyTracerLab.model
19
+ :members:
20
+ :show-inheritance:
21
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab.model.solver module
2
+ ===============================
3
+
4
+ .. automodule:: PyTracerLab.model.solver
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab.model.units module
2
+ ==============================
3
+
4
+ .. automodule:: PyTracerLab.model.units
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
@@ -0,0 +1,19 @@
1
+ PyTracerLab package
2
+ ===================
3
+
4
+ Subpackages
5
+ -----------
6
+
7
+ .. toctree::
8
+ :maxdepth: 4
9
+
10
+ PyTracerLab.gui
11
+ PyTracerLab.model
12
+
13
+ Module contents
14
+ ---------------
15
+
16
+ .. automodule:: PyTracerLab
17
+ :members:
18
+ :show-inheritance:
19
+ :undoc-members:
@@ -0,0 +1,7 @@
1
+ PyTracerLab
2
+ ===========
3
+
4
+ .. toctree::
5
+ :maxdepth: 4
6
+
7
+ PyTracerLab
@@ -0,0 +1,88 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import sys
5
+ from pathlib import Path
6
+
7
+ ROOT = Path(__file__).resolve().parents[1]
8
+ sys.path.insert(0, str(ROOT / "src"))
9
+
10
+ os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
11
+
12
+ project = "PyTracerLab"
13
+ author = "Max G. Rudolph"
14
+
15
+ extensions = [
16
+ "myst_nb",
17
+ "sphinx.ext.autodoc",
18
+ "sphinx.ext.autosummary",
19
+ "sphinx.ext.napoleon",
20
+ "sphinx.ext.viewcode",
21
+ "sphinx.ext.intersphinx",
22
+ "sphinx_design",
23
+ ]
24
+
25
+ # notebook execution (safe default for CI)
26
+ nb_execution_mode = "off" # "cache" or "auto" for execution enabled
27
+ nb_execution_timeout = 300
28
+
29
+ # mock heavy deps during doc builds
30
+ autodoc_mock_imports = ["PyQt5", "numpy", "scipy", "matplotlib"]
31
+
32
+ autosummary_generate = True
33
+ autodoc_default_options = {"members": True, "undoc-members": False, "show-inheritance": False}
34
+
35
+ napoleon_google_docstring = False # True if using Google style
36
+ napoleon_numpy_docstring = True # True if using NumPy style
37
+ # Render class attribute docs from "Attributes" sections as plain ivar fields
38
+ # (prevents duplicate attribute targets alongside autodoc's member listing)
39
+ napoleon_use_ivar = True
40
+
41
+ myst_enable_extensions = [
42
+ "colon_fence",
43
+ "deflist",
44
+ "fieldlist",
45
+ "attrs_inline",
46
+ "attrs_block",
47
+ ]
48
+
49
+ templates_path = ["_templates"]
50
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**/.ipynb_checkpoints"]
51
+
52
+ html_theme = "furo"
53
+ html_static_path = ["_static"]
54
+ html_logo = "_static/logo.png"
55
+ html_title = "PyTracerLab Documentation"
56
+ html_short_title = "PyTracerLab"
57
+ html_show_sphinx = True
58
+ html_show_copyright = True
59
+
60
+ # html_theme_options = {
61
+ # "use_edit_page_button": True,
62
+ # "header_links_before_dropdown": 6,
63
+ # "icon_links": [
64
+ # {
65
+ # "name": "GitHub",
66
+ # "url": "https://github.com/iGW-TU-Dresden/PyTracerLab",
67
+ # "icon": "fab fa-github-square",
68
+ # "type": "fontawesome",
69
+ # }
70
+ # ],
71
+ # }
72
+
73
+ # use None for inventories (Sphinx 8+)
74
+ intersphinx_mapping = {
75
+ "python": ("https://docs.python.org/3", None),
76
+ "numpy": ("https://numpy.org/doc/stable/", None),
77
+ "scipy": ("https://docs.scipy.org/doc/scipy/", None),
78
+ }
79
+
80
+ # do not document re-exported names (prevents duplicate objects)
81
+ autosummary_imported_members = False
82
+
83
+ # Disambiguate short type names in NumPy-style docstrings
84
+ napoleon_type_aliases = {
85
+ "Unit": "PyTracerLab.model.units.Unit",
86
+ "Model": "PyTracerLab.model.Model", # prefer public alias to avoid ambiguity
87
+ "Solver": "PyTracerLab.model.solver.Solver",
88
+ }
@@ -0,0 +1,16 @@
1
+ # Development
2
+
3
+ Here we discuss how PyTracerLab is structured internally and how new functionality (especially to the GUI) can be added easily.
4
+
5
+ ## PyTracerLab Structure
6
+
7
+ PyTracerLab has to principal parts: the `model` sub-package and the `gui` sub-package. This structure is depicted in Figure 1. The `model` sub-package contains the main functions for the model; it can be used as a regular python package and includes, i.a., modules to create and run lumped parameter models using various model units, and to optimize model parameters. The `gui` sub-package contains the main functions for the GUI; it creates an interface to various parts of the `model` sub-package and enables non-technical users to load data, create and run models, to optimize model parameters, and to view and export results.
8
+
9
+ ```{figure} package_scheme.png
10
+
11
+ Figure 1: The pricipal structure of the PyTracerLab package and its main parts. Main modules are written in bold; main mechanisms and connections are represented via arrows.
12
+ ```
13
+
14
+ ## Adding New Functionality
15
+
16
+ The addition of new functionality is best illustrated looking at the general structure of PyTracerLab.
@@ -0,0 +1,9 @@
1
+ # Development
2
+
3
+ ```{toctree}
4
+ :maxdepth: 2
5
+ :caption: Guides
6
+ :hidden:
7
+
8
+ devguide
9
+ ```