mantis-rtm 0.1.1.dev0__tar.gz → 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.
- mantis_rtm-0.2.0/.github/workflows/publish-pypi.yml +47 -0
- mantis_rtm-0.2.0/.github/workflows/tests.yml +35 -0
- {mantis_rtm-0.1.1.dev0/src/mantis_rtm.egg-info → mantis_rtm-0.2.0}/PKG-INFO +10 -49
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/README.md +10 -49
- mantis_rtm-0.2.0/changelog.md +104 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/docs/tutorial.md +282 -132
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/examples/velde_et_al_2016/fes_reactions.py +21 -2
- mantis_rtm-0.1.1.dev0/examples/velde_et_al_2016/kinetic_constants_slow.py → mantis_rtm-0.2.0/examples/velde_et_al_2016/kinetic_constants_fast.py +9 -3
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/examples/velde_et_al_2016/plot_layout.py +1 -1
- mantis_rtm-0.1.1.dev0/examples/velde_et_al_2016/run_velde_model.py → mantis_rtm-0.2.0/examples/velde_et_al_2016/run_velde_fast.py +8 -3
- mantis_rtm-0.2.0/examples/velde_et_al_2016/run_velde_fast_equations.py +823 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/examples/velde_et_al_2016/species.py +33 -1
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/_version.py +3 -3
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/diff_lib.py +110 -44
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/generate_equation_system.py +325 -222
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/live_plot_lib.py +34 -18
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/model.py +349 -134
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/monolithic_solver.py +16 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/plot_data_new.py +60 -65
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0/src/mantis_rtm.egg-info}/PKG-INFO +10 -49
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis_rtm.egg-info/SOURCES.txt +6 -3
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis_rtm.egg-info/scm_file_list.json +6 -3
- mantis_rtm-0.2.0/src/mantis_rtm.egg-info/scm_version.json +8 -0
- mantis_rtm-0.2.0/tests/test_diagenetic_model.py +285 -0
- mantis_rtm-0.1.1.dev0/docs/tutorial.org +0 -515
- mantis_rtm-0.1.1.dev0/src/mantis_rtm.egg-info/scm_version.json +0 -8
- mantis_rtm-0.1.1.dev0/tests/test_diagenetic_model.py +0 -65
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/.gitignore +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/.python-version +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/LICENSE +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/examples/velde_et_al_2016/00readme.md +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/pyproject.toml +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/pyrightconfig.json +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/requirements.txt +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/setup.cfg +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/.vscode/settings.json +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/__init__.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/monitor_plots.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/parallel_video.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis/solvers_numba.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis_rtm.egg-info/dependency_links.txt +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis_rtm.egg-info/entry_points.txt +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis_rtm.egg-info/requires.txt +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/src/mantis_rtm.egg-info/top_level.txt +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_direct_solver_numpy.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_equivalence.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_fes_flux_limited.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_fes_predictor_corrector.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_fes_smooth_transition.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_fes_symmetrical_picard.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_generate_equation_system.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_log_compression.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_monod_linearization.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_parallel_video.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_plot_data_options.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_reactant_coexistence.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_s0_disproportionation.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_solvers_numba.py +0 -0
- {mantis_rtm-0.1.1.dev0 → mantis_rtm-0.2.0}/tests/test_video_queue_and_logging.py +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Build and Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-publish:
|
|
10
|
+
name: Build distribution and publish to PyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment:
|
|
13
|
+
name: pypi
|
|
14
|
+
url: https://pypi.org/p/mantis-rtm
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write # Required for PyPI Trusted Publishing (OIDC)
|
|
17
|
+
contents: read # Required to checkout repository
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Check out repository
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0 # Required for setuptools_scm to extract version from tags
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install build tools
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip
|
|
33
|
+
python -m pip install build twine
|
|
34
|
+
|
|
35
|
+
- name: Build source distribution and wheel
|
|
36
|
+
run: python -m build
|
|
37
|
+
|
|
38
|
+
- name: Verify distribution archives
|
|
39
|
+
run: twine check dist/*
|
|
40
|
+
|
|
41
|
+
- name: Publish to PyPI
|
|
42
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
43
|
+
# PyPI Trusted Publishing (OIDC) is used automatically when permissions.id-token is set.
|
|
44
|
+
# If you prefer using a classic PyPI API token instead of Trusted Publishing,
|
|
45
|
+
# add a repository secret named PYPI_API_TOKEN and uncomment the line below:
|
|
46
|
+
# with:
|
|
47
|
+
# password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, staging]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, staging]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Run test suite (${{ matrix.python-version }})
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Check out repository
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
python -m pip install -e ".[test]"
|
|
33
|
+
|
|
34
|
+
- name: Run pytest
|
|
35
|
+
run: pytest
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mantis-rtm
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: MANTIS: A Monolithic Assembly of Nonlinear Transport Interactions Solver
|
|
5
5
|
Author-email: Uli Wortmann <uli.wortmann@utoronto.ca>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -41,20 +41,21 @@ Dynamic: license-file
|
|
|
41
41
|
|
|
42
42
|
# MANTIS: A *M*onolithic *A*ssembly of *N*onlinear *T*ransport *I*nteractions *S*olver
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
[](https://github.com/uliw/mantis/actions/workflows/tests.yml)
|
|
45
|
+
[](https://pypi.org/project/mantis-rtm/)
|
|
46
|
+
[](https://pypi.org/project/mantis-rtm/)
|
|
47
|
+
[](https://github.com/uliw/mantis/blob/main/LICENSE)
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
**MANTIS** is a high-performance 1D reactive-transport modeling (RTM) framework written in Python, designed to simulate stiff, tightly coupled advection-diffusion-reaction networks, by building a fully coupled monolithic equation system. Mantis stands for *M*onolithic *A*ssembly of *N*onlinear *T*ransport *I*nteraction*S*
|
|
47
50
|
|
|
48
|
-
## What is MANTIS?
|
|
49
51
|
|
|
50
|
-
Reactive-transport systems in natural environments—such as marine sediments, groundwater aquifers, and geochemical reactors—involve simultaneous transport (advection, molecular diffusion, bio-irrigation, and bioturbation) coupled with complex networks of nonlinear chemical, mineral, and biological reactions.
|
|
51
52
|
|
|
52
53
|
MANTIS provides:
|
|
53
|
-
- **Declarative Geochemical Model Definition**: Define chemical species, phases, reaction stoichiometries, and kinetic limiters (Monod, inhibition, threshold laws)
|
|
54
|
+
- **Declarative Geochemical Model Definition**: Define chemical species, phases, reaction stoichiometries, and kinetic limiters (Monod, inhibition, threshold laws), and isotope effects using intuitive, human-readable Python configuration files.
|
|
54
55
|
- **Automated Symbolic Jacobian Generation**: Automatically parses reaction networks and compiles analytical chemical Jacobians using symbolic computer algebra (`SymPy`), eliminating error-prone manual differentiation.
|
|
55
56
|
- **Monolithic Block Newton-Raphson Solver**: Solves all chemical species and transport equations simultaneously in a coupled block-tridiagonal system using a Numba-accelerated Block Thomas algorithm.
|
|
56
57
|
- **Adaptive Time Stepping**: Features PID-controlled adaptive time stepping with automatic step rejection and convergence recovery.
|
|
57
|
-
- **Unified Declarative Interface**: Configure and run simulations through `DiageneticModel`, complete with automatic CLI argument handling,
|
|
58
|
+
- **Unified Declarative Interface**: Configure and run simulations through `DiageneticModel`, complete with automatic CLI argument handling, and an integrated plotting system that supports asynchronous time-lapse video generation.
|
|
58
59
|
|
|
59
60
|
---
|
|
60
61
|
|
|
@@ -99,7 +100,7 @@ While MANTIS provides robust and unconditionally stable solutions for stiff reac
|
|
|
99
100
|
2. **Time-Invariant Porosity**:
|
|
100
101
|
- The porosity profile $\phi(z)$ is stationary in time (steady-state compaction). Transient sediment compaction or compaction-driven dynamic fluid expulsion over time is not currently modeled.
|
|
101
102
|
3. **Time-Invariant Temperature**:
|
|
102
|
-
- The temperature profile $T(z)$ is steady-state. Dynamic thermal evolution and time-dependent diffusion coefficients or rate constants driven by non-isothermal thermal transients are not currently supported.
|
|
103
|
+
- The temperature profile of $T(z)$ is steady-state. Dynamic thermal evolution and time-dependent diffusion coefficients or rate constants driven by non-isothermal thermal transients are not currently supported.
|
|
103
104
|
|
|
104
105
|
---
|
|
105
106
|
|
|
@@ -118,47 +119,7 @@ Dependencies include `numpy`, `pandas`, `matplotlib`, `numba`, `sympy`, `chempy`
|
|
|
118
119
|
---
|
|
119
120
|
|
|
120
121
|
## Quick Start Example
|
|
121
|
-
|
|
122
|
-
A typical simulation directory contains declarative configuration files defining species, reactions, rate constants, and plot layouts:
|
|
123
|
-
|
|
124
|
-
```python
|
|
125
|
-
from mantis import DiageneticModel
|
|
126
|
-
|
|
127
|
-
# 1. Initialize the model (auto-detects species.py, reactions, constants in the directory)
|
|
128
|
-
model = DiageneticModel(
|
|
129
|
-
reactions="fes_reactions.py",
|
|
130
|
-
constants="kinetic_constants_slow.py",
|
|
131
|
-
layout="plot_layout.py",
|
|
132
|
-
experiment="marine_diagenesis",
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
# 2. Configure environmental and grid parameters
|
|
136
|
-
model.configure(
|
|
137
|
-
max_depth="0.5 m",
|
|
138
|
-
t_end="2 kyr",
|
|
139
|
-
dt_init="1 day",
|
|
140
|
-
dt_max="1 year",
|
|
141
|
-
w="0.2 cm/yr",
|
|
142
|
-
phi=0.8,
|
|
143
|
-
bioturbation={
|
|
144
|
-
"BT0": "4 cm^2/year",
|
|
145
|
-
"depth": "6 cm",
|
|
146
|
-
"attenuation": "2 cm",
|
|
147
|
-
},
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
# 3. Enable CLI flag overrides (--video, --solver-tol, --t-end, etc.)
|
|
151
|
-
model.parse_cli_args()
|
|
152
|
-
|
|
153
|
-
# 4. Run the simulation
|
|
154
|
-
result = model.run()
|
|
155
|
-
|
|
156
|
-
# 5. Export results and summary plots
|
|
157
|
-
df, csv_path = result.save_csv()
|
|
158
|
-
result.plot_summary()
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
---
|
|
122
|
+
A quick-start tutorial is available in the `./docs` folder
|
|
162
123
|
|
|
163
124
|
## Running Tests
|
|
164
125
|
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
# MANTIS: A *M*onolithic *A*ssembly of *N*onlinear *T*ransport *I*nteractions *S*olver
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/uliw/mantis/actions/workflows/tests.yml)
|
|
4
|
+
[](https://pypi.org/project/mantis-rtm/)
|
|
5
|
+
[](https://pypi.org/project/mantis-rtm/)
|
|
6
|
+
[](https://github.com/uliw/mantis/blob/main/LICENSE)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
**MANTIS** is a high-performance 1D reactive-transport modeling (RTM) framework written in Python, designed to simulate stiff, tightly coupled advection-diffusion-reaction networks, by building a fully coupled monolithic equation system. Mantis stands for *M*onolithic *A*ssembly of *N*onlinear *T*ransport *I*nteraction*S*
|
|
6
9
|
|
|
7
|
-
## What is MANTIS?
|
|
8
10
|
|
|
9
|
-
Reactive-transport systems in natural environments—such as marine sediments, groundwater aquifers, and geochemical reactors—involve simultaneous transport (advection, molecular diffusion, bio-irrigation, and bioturbation) coupled with complex networks of nonlinear chemical, mineral, and biological reactions.
|
|
10
11
|
|
|
11
12
|
MANTIS provides:
|
|
12
|
-
- **Declarative Geochemical Model Definition**: Define chemical species, phases, reaction stoichiometries, and kinetic limiters (Monod, inhibition, threshold laws)
|
|
13
|
+
- **Declarative Geochemical Model Definition**: Define chemical species, phases, reaction stoichiometries, and kinetic limiters (Monod, inhibition, threshold laws), and isotope effects using intuitive, human-readable Python configuration files.
|
|
13
14
|
- **Automated Symbolic Jacobian Generation**: Automatically parses reaction networks and compiles analytical chemical Jacobians using symbolic computer algebra (`SymPy`), eliminating error-prone manual differentiation.
|
|
14
15
|
- **Monolithic Block Newton-Raphson Solver**: Solves all chemical species and transport equations simultaneously in a coupled block-tridiagonal system using a Numba-accelerated Block Thomas algorithm.
|
|
15
16
|
- **Adaptive Time Stepping**: Features PID-controlled adaptive time stepping with automatic step rejection and convergence recovery.
|
|
16
|
-
- **Unified Declarative Interface**: Configure and run simulations through `DiageneticModel`, complete with automatic CLI argument handling,
|
|
17
|
+
- **Unified Declarative Interface**: Configure and run simulations through `DiageneticModel`, complete with automatic CLI argument handling, and an integrated plotting system that supports asynchronous time-lapse video generation.
|
|
17
18
|
|
|
18
19
|
---
|
|
19
20
|
|
|
@@ -58,7 +59,7 @@ While MANTIS provides robust and unconditionally stable solutions for stiff reac
|
|
|
58
59
|
2. **Time-Invariant Porosity**:
|
|
59
60
|
- The porosity profile $\phi(z)$ is stationary in time (steady-state compaction). Transient sediment compaction or compaction-driven dynamic fluid expulsion over time is not currently modeled.
|
|
60
61
|
3. **Time-Invariant Temperature**:
|
|
61
|
-
- The temperature profile $T(z)$ is steady-state. Dynamic thermal evolution and time-dependent diffusion coefficients or rate constants driven by non-isothermal thermal transients are not currently supported.
|
|
62
|
+
- The temperature profile of $T(z)$ is steady-state. Dynamic thermal evolution and time-dependent diffusion coefficients or rate constants driven by non-isothermal thermal transients are not currently supported.
|
|
62
63
|
|
|
63
64
|
---
|
|
64
65
|
|
|
@@ -77,47 +78,7 @@ Dependencies include `numpy`, `pandas`, `matplotlib`, `numba`, `sympy`, `chempy`
|
|
|
77
78
|
---
|
|
78
79
|
|
|
79
80
|
## Quick Start Example
|
|
80
|
-
|
|
81
|
-
A typical simulation directory contains declarative configuration files defining species, reactions, rate constants, and plot layouts:
|
|
82
|
-
|
|
83
|
-
```python
|
|
84
|
-
from mantis import DiageneticModel
|
|
85
|
-
|
|
86
|
-
# 1. Initialize the model (auto-detects species.py, reactions, constants in the directory)
|
|
87
|
-
model = DiageneticModel(
|
|
88
|
-
reactions="fes_reactions.py",
|
|
89
|
-
constants="kinetic_constants_slow.py",
|
|
90
|
-
layout="plot_layout.py",
|
|
91
|
-
experiment="marine_diagenesis",
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
# 2. Configure environmental and grid parameters
|
|
95
|
-
model.configure(
|
|
96
|
-
max_depth="0.5 m",
|
|
97
|
-
t_end="2 kyr",
|
|
98
|
-
dt_init="1 day",
|
|
99
|
-
dt_max="1 year",
|
|
100
|
-
w="0.2 cm/yr",
|
|
101
|
-
phi=0.8,
|
|
102
|
-
bioturbation={
|
|
103
|
-
"BT0": "4 cm^2/year",
|
|
104
|
-
"depth": "6 cm",
|
|
105
|
-
"attenuation": "2 cm",
|
|
106
|
-
},
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
# 3. Enable CLI flag overrides (--video, --solver-tol, --t-end, etc.)
|
|
110
|
-
model.parse_cli_args()
|
|
111
|
-
|
|
112
|
-
# 4. Run the simulation
|
|
113
|
-
result = model.run()
|
|
114
|
-
|
|
115
|
-
# 5. Export results and summary plots
|
|
116
|
-
df, csv_path = result.save_csv()
|
|
117
|
-
result.plot_summary()
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
---
|
|
81
|
+
A quick-start tutorial is available in the `./docs` folder
|
|
121
82
|
|
|
122
83
|
## Running Tests
|
|
123
84
|
|
|
@@ -131,4 +92,4 @@ pytest
|
|
|
131
92
|
|
|
132
93
|
## License
|
|
133
94
|
|
|
134
|
-
This project is licensed under the GPL-3.0 License. See the [LICENSE](LICENSE) file for details.
|
|
95
|
+
This project is licensed under the GPL-3.0 License. See the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.0] - 2026-10-15
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Generalized Isotope Modeling & Standards Framework**:
|
|
13
|
+
- Dynamically handle all isotope companion species across `diff_lib.py` and `live_plot_lib.py` instead of relying on hardcoded mappings.
|
|
14
|
+
- Added support for explicit isotope reference standards (e.g., `VCDT` for sulfur) with custom standard ratios and metadata-defined `delta_name`.
|
|
15
|
+
- Added support for species without explicit stoichiometry (defaulting to 1.0) and maintained backwards compatibility for legacy `d_<base>` column names alongside `d34S_<species>`.
|
|
16
|
+
- Updated isotope unit representations from per mil (`permil` / `‰`) to milli Urey (`mUr`) per IUPAC conventions across documentation, examples, and plot exports.
|
|
17
|
+
|
|
18
|
+
- **Equation System Generation & Dynamic Limiters**:
|
|
19
|
+
- Dynamic extraction of Monod half-saturation constants from rate expressions with phase-aware (solid vs. fluid phase) scaling based on sediment porosity.
|
|
20
|
+
- Implemented dynamic limiter inclusion based on actual reactant and inhibition usage, eliminating unused terms and redundant code in generated equation scripts.
|
|
21
|
+
- Added `force_regen` and `rebuild_equations` options in `generate_equation_system` and added the `--force-regen` CLI argument to bypass cached equations and rebuild.
|
|
22
|
+
- Added automatic equation regeneration checks comparing file modification timestamps of generator and reaction scripts.
|
|
23
|
+
- **Model Configuration & Video Controls**:
|
|
24
|
+
- Added strict pH validation during `DiageneticModel` initialization with descriptive error guidance.
|
|
25
|
+
- Enhanced `configure()` with generic Pint-based unit conversions for geometric, environmental, transport, and grid parameters.
|
|
26
|
+
- **CI/CD & Documentation**:
|
|
27
|
+
- Added Python 3.14 to GitHub Actions test matrix across Linux environments.
|
|
28
|
+
- Added status, PyPI version, Python versions (3.12–3.14), and AGPL license badges to `README.md`.
|
|
29
|
+
- Expanded tutorial documentation (`docs/tutorial.md`) with isotope delta boundary condition examples, updated geochemical constants, and equation regeneration options.
|
|
30
|
+
- Added comprehensive test coverage in `tests/test_diagenetic_model.py` for isotope standards, delta columns, and missing file diagnostics.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- **Examples**:
|
|
35
|
+
- Streamlined `examples/velde_et_al_2016/run_velde_fast.py` by removing unnecessary manual time stepping parameters (`dt_init`, `dt_min`, `dt_tolerance`).
|
|
36
|
+
- Simplified limiter calculation logic in `velde_et_al_2016` by consolidating phase scaling into a unified block.
|
|
37
|
+
- **Plotting**:
|
|
38
|
+
- Refactored `plot_data_new.py` to dynamically detect and plot isotope delta columns.
|
|
39
|
+
|
|
40
|
+
### Removed
|
|
41
|
+
|
|
42
|
+
- Removed obsolete `docs/tutorial.org` file.
|
|
43
|
+
- Removed deprecated default parameter assignments for `Fe2_diss`, `Fe2_sorb`, `hs_frac`, and `h2s_frac`.
|
|
44
|
+
|
|
45
|
+
## [0.1.2] - 2026-10-12
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- **File Path Resolution & Diagnostic Error Handling**:
|
|
50
|
+
- Enhanced file path resolution in `DiageneticModel` (`_resolve`), searching the current working directory, the model script directory (`base_dir`), and fallback naming patterns (such as `<experiment>_reactions.py`).
|
|
51
|
+
- Implemented early file validation (`validate_simulation_files()`) during `DiageneticModel` initialization and setup to catch missing simulation files before simulation execution.
|
|
52
|
+
- Added informative error diagnostics (`[MANTIS ERROR]`) detailing exact search locations and resolution guidance when species, reactions, constants, limiters, or plot layout files are missing.
|
|
53
|
+
- Improved plot layout file resolution in `plot_data_new.load_layout_from_file` and `plot_summary` with clear error reporting and search path feedback.
|
|
54
|
+
- Added unit test suite in `tests/test_diagenetic_model.py` testing missing file scenarios, exit behavior, and directory resolution from both CWD and model base directories.
|
|
55
|
+
|
|
56
|
+
## [0.1.1] - 2026-10-12
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- **Steady-State Detection & Convergence**:
|
|
61
|
+
- Implemented a grid-independent spatial $L_2$ steady-state convergence check in `run_non_steady_state_solver_monolithic`. Computes a volume-weighted root-mean-square (RMS) change across grid cells per species and checks against `steady_state_tolerance` (or falls back to `dt_tolerance` if set).
|
|
62
|
+
- Added a minimum step requirement (step > 5) to prevent premature steady-state termination.
|
|
63
|
+
- **Model Parameters & Unit Conversions**:
|
|
64
|
+
- Added support for grid spacing parameters with unit conversion in `DiageneticModel`: `initial_spacing`, `reaction_zone_spacing`, and `max_spacing`.
|
|
65
|
+
- Added support for the `reaction_zone` tuple/list interval parameter with unit conversion.
|
|
66
|
+
- Added support for `steady_state_tolerance` and `dt_tolerance` solver tolerance parameters.
|
|
67
|
+
- Added `check_reactant_coexistence` boolean option and enabled the post-simulation reactant coexistence diagnostic by default.
|
|
68
|
+
- **Examples**:
|
|
69
|
+
- Added fast and slow simulation setups for the Velde et al. (2016) sediment diagenesis benchmark:
|
|
70
|
+
- `examples/velde_et_al_2016/run_velde_fast.py` & `kinetic_constants_fast.py`: fast configuration with pyrite precipitation.
|
|
71
|
+
- `examples/velde_et_al_2016/run_velde_slow.py` & `kinetic_constants_slow.py`: slow configuration tracking sulfur isotopes.
|
|
72
|
+
- **CI/CD & Automation**:
|
|
73
|
+
- Added GitHub Actions workflow `.github/workflows/tests.yml` to run automated test suites across Python 3.12, 3.13, and 3.14.
|
|
74
|
+
- Added GitHub Actions workflow `.github/workflows/publish-pypi.yml` for automated PyPI package publishing upon GitHub releases.
|
|
75
|
+
- **Documentation**:
|
|
76
|
+
- Added comprehensive documentation on physical units (`pint` integration) and non-uniform grid generation to `docs/tutorial.md` and `docs/tutorial.org`.
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
|
|
80
|
+
- **Rate Laws & Equation System Generation**:
|
|
81
|
+
- Simplified particulate organic carbon (POC) respiration rate equations by removing redundant coefficient calculations.
|
|
82
|
+
- Simplified FeS precipitation and dissolution rate formulation by removing unnecessary Michaelis-Menten terms.
|
|
83
|
+
- Adjusted default smoothing parameter `fes_smooth_epsilon` from `0.05` to `0.01` for sharper, smoother reaction transitions.
|
|
84
|
+
- Dynamically extract and handle active POC species and kinetic parameter pairs instead of using hardcoded POC fast/slow loops.
|
|
85
|
+
- **Differential Operators Library (`diff_lib`)**:
|
|
86
|
+
- Added type annotations across numerical and differential operator functions.
|
|
87
|
+
- Improved formatting, line wrapping, indentation, and visual structure.
|
|
88
|
+
- **Project Packaging & Metadata**:
|
|
89
|
+
- Updated package distribution name to `mantis-rtm` and enabled dynamic versioning using `setuptools_scm`.
|
|
90
|
+
- Added `pint` as an explicit core dependency in `pyproject.toml` and `requirements.txt`.
|
|
91
|
+
- Added AGPL-3.0-or-later license configuration and classifiers.
|
|
92
|
+
- Configured project URLs (Homepage, Repository, Issues) and updated build ignore patterns in `.gitignore`.
|
|
93
|
+
- **Examples**:
|
|
94
|
+
- Corrected FeS dissolution rate constant in `examples/velde_et_al_2016/kinetic_constants_slow.py`.
|
|
95
|
+
- Adjusted broken axis limits in `examples/velde_et_al_2016/plot_layout.py` for clearer concentration profile visualization.
|
|
96
|
+
|
|
97
|
+
### Removed
|
|
98
|
+
|
|
99
|
+
- Removed obsolete `examples/velde_et_al_2016/run_velde_model.py` script.
|
|
100
|
+
- Removed legacy table of contents from tutorial documentation.
|
|
101
|
+
|
|
102
|
+
## [0.1.0] - 2026-10-11
|
|
103
|
+
|
|
104
|
+
- Initial tagged release with core MANTIS reactive transport solver and tutorial documentation.
|