hydroBayesCal 0.1.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.
- hydrobayescal-0.1.0/LICENSE +29 -0
- hydrobayescal-0.1.0/PKG-INFO +128 -0
- hydrobayescal-0.1.0/README.md +71 -0
- hydrobayescal-0.1.0/pyproject.toml +114 -0
- hydrobayescal-0.1.0/setup.cfg +4 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/__init__.py +1 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/delft3d/__init__.py +5 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/delft3d/control_delft3d.py +106 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/doepy/DOE_functions.py +522 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/doepy/__init__.py +0 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/doepy/doe_control.py +177 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/doepy/pyDOE_corrected.py +339 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/function_pool.py +885 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/hysim.py +674 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/openfoam/__init__.py +1 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/openfoam/control_openfoam.py +1002 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/plots/__init__.py +0 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/plots/plots.py +3679 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/plots/plots_config.py +76 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/surrogate/__init__.py +10 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/surrogate/bal_functions.py +856 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/surrogate/exploration.py +389 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/surrogate/gpe_gpytorch.py +1029 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/surrogate/gpe_skl.py +469 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/__init__.py +0 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/config_telemac.py +61 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/control_telemac.py +2396 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/pputils/__init__.py +6 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/pputils/ppmodules/__init__.py +1 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/pputils/ppmodules/readMesh.py +294 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/pputils/ppmodules/selafin_io_pp.py +491 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/pputils/ppmodules/utilities.py +577 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/pputils/ppmodules/writeMesh.py +116 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/templates/parameters-gaia.csv +30 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/telemac/templates/parameters-telemac2d.csv +55 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/VectrinoPostproc/__init__.py +0 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/VectrinoPostproc/compute_tke.py +157 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/VectrinoPostproc/despiking.py +407 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/VectrinoPostproc/get_ascii_data.py +208 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/VectrinoPostproc/plot_velocities.py +124 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/VectrinoPostproc/transformation.py +191 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/__init__.py +0 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/config_logging.py +47 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/config_physics.py +10 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/configuration.py +59 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/get_les_mesh_size.py +61 -0
- hydrobayescal-0.1.0/src/hydroBayesCal/utils/log.py +34 -0
- hydrobayescal-0.1.0/src/hydroBayesCal.egg-info/PKG-INFO +128 -0
- hydrobayescal-0.1.0/src/hydroBayesCal.egg-info/SOURCES.txt +50 -0
- hydrobayescal-0.1.0/src/hydroBayesCal.egg-info/dependency_links.txt +1 -0
- hydrobayescal-0.1.0/src/hydroBayesCal.egg-info/requires.txt +43 -0
- hydrobayescal-0.1.0/src/hydroBayesCal.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022, Sebastian Schwindt, Eduardo Acuna Espinoza, Kilian Mouris, Farid Mohammadi, Sergey Oladyshkin
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hydroBayesCal
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Surrogate-assisted Bayesian calibration for hydrodynamic and morphodynamic models (Telemac, OpenFOAM).
|
|
5
|
+
Author: Sebastian Schwindt, Andres Heredia, Eduardo Acuna
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Project-URL: Documentation, https://hydrobayescal.readthedocs.io
|
|
8
|
+
Project-URL: Source, https://github.com/sschwindt/hydrobayescal
|
|
9
|
+
Keywords: Bayesian calibration,Gaussian process emulator,surrogate model,Bayesian active learning,Telemac,OpenFOAM
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Requires-Python: <3.12,>=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: numpy>=1.26
|
|
19
|
+
Requires-Dist: scipy>=1.11
|
|
20
|
+
Requires-Dist: pandas>=2.0
|
|
21
|
+
Requires-Dist: scikit-learn>=1.3
|
|
22
|
+
Requires-Dist: h5py>=3.10
|
|
23
|
+
Requires-Dist: openpyxl>=3.1
|
|
24
|
+
Requires-Dist: pyyaml>=6.0
|
|
25
|
+
Requires-Dist: matplotlib>=3.7
|
|
26
|
+
Requires-Dist: seaborn>=0.13
|
|
27
|
+
Requires-Dist: corner>=2.2
|
|
28
|
+
Requires-Dist: tqdm>=4.66
|
|
29
|
+
Requires-Dist: rich>=13
|
|
30
|
+
Requires-Dist: joblib>=1.3
|
|
31
|
+
Requires-Dist: pyvista>=0.43
|
|
32
|
+
Requires-Dist: torch>=2.2
|
|
33
|
+
Requires-Dist: gpytorch>=1.11
|
|
34
|
+
Requires-Dist: linear-operator>=0.5
|
|
35
|
+
Requires-Dist: emcee>=3.1
|
|
36
|
+
Requires-Dist: chaospy>=4.3
|
|
37
|
+
Requires-Dist: bayesvalidrox>=2.1
|
|
38
|
+
Provides-Extra: mesh
|
|
39
|
+
Requires-Dist: vtk>=9.2; extra == "mesh"
|
|
40
|
+
Requires-Dist: meshio>=5.3; extra == "mesh"
|
|
41
|
+
Requires-Dist: rasterio>=1.3; extra == "mesh"
|
|
42
|
+
Requires-Dist: affine>=2.4; extra == "mesh"
|
|
43
|
+
Provides-Extra: server
|
|
44
|
+
Requires-Dist: umbridge>=1.2; extra == "server"
|
|
45
|
+
Provides-Extra: mpi
|
|
46
|
+
Requires-Dist: mpi4py>=3.1; extra == "mpi"
|
|
47
|
+
Provides-Extra: docs
|
|
48
|
+
Requires-Dist: sphinx>=7.0; extra == "docs"
|
|
49
|
+
Requires-Dist: sphinx-rtd-theme>=2.0; extra == "docs"
|
|
50
|
+
Requires-Dist: sphinxcontrib-mermaid>=0.9; extra == "docs"
|
|
51
|
+
Provides-Extra: dev
|
|
52
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
53
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
54
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
55
|
+
Requires-Dist: ruff>=0.5; extra == "dev"
|
|
56
|
+
Dynamic: license-file
|
|
57
|
+
|
|
58
|
+
# HydroBayesCal
|
|
59
|
+
|
|
60
|
+
**Surrogate-assisted Bayesian calibration for computationally expensive
|
|
61
|
+
hydro- and morphodynamic models.**
|
|
62
|
+
|
|
63
|
+
[](https://hydrobayescal.readthedocs.io)
|
|
64
|
+
[](LICENSE)
|
|
65
|
+
|
|
66
|
+
HydroBayesCal calibrates expensive numerical models without running them
|
|
67
|
+
thousands of times. It trains a **Gaussian Process Emulator (GPE)** as a fast
|
|
68
|
+
surrogate from a small set of strategically sampled simulations, then refines it
|
|
69
|
+
with **Bayesian Active Learning (BAL)** — iteratively adding the training points
|
|
70
|
+
that maximise the information gain (relative entropy) and Bayesian model
|
|
71
|
+
evidence for the calibration. Single- and multi-output GPEs are supported.
|
|
72
|
+
|
|
73
|
+
The package couples to open-source modelling software through a common binding
|
|
74
|
+
layer:
|
|
75
|
+
|
|
76
|
+
* **TELEMAC** (2D/3D) — fully supported
|
|
77
|
+
* **OpenFOAM** (interFoam) — binding under active development
|
|
78
|
+
|
|
79
|
+
Experimental design and parameter sampling are delegated to
|
|
80
|
+
[BayesValidRox](https://pages.iws.uni-stuttgart.de/inversemodeling/bayesvalidrox/);
|
|
81
|
+
the GP emulators and the Bayesian active-learning logic are implemented in-tree.
|
|
82
|
+
|
|
83
|
+
## Installation
|
|
84
|
+
|
|
85
|
+
HydroBayesCal targets **Python 3.10–3.11** (the upper bound is imposed by the
|
|
86
|
+
`bayesvalidrox` dependency). It is developed and tested on Linux.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pip install hydroBayesCal
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
or, for a development/editable install from a clone:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/sschwindt/hydrobayescal.git
|
|
96
|
+
cd hydrobayescal
|
|
97
|
+
pip install -e ".[dev,docs,mesh]"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
A calibration additionally requires a working installation of the numerical
|
|
101
|
+
solver (e.g. TELEMAC) on the system. See the
|
|
102
|
+
[installation guide](https://hydrobayescal.readthedocs.io/en/latest/installation.html)
|
|
103
|
+
for the full environment setup, including coupling HydroBayesCal with TELEMAC.
|
|
104
|
+
|
|
105
|
+
## Quick start
|
|
106
|
+
|
|
107
|
+
Configure a calibration in a Python config file and run the TELEMAC driver:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
python bal_telemac.py --config config.py
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
See the [documentation](https://hydrobayescal.readthedocs.io) for the
|
|
114
|
+
end-to-end workflow, the configuration parameters, the code architecture, and
|
|
115
|
+
worked examples.
|
|
116
|
+
|
|
117
|
+
## Citing / scientific background
|
|
118
|
+
|
|
119
|
+
HydroBayesCal builds on the Bayesian active-learning framework of Oladyshkin et
|
|
120
|
+
al. (2020) and on Gaussian-process regression (Rasmussen & Williams, 2006). Its
|
|
121
|
+
application to reservoir sedimentation and 3D reservoir hydrodynamics is
|
|
122
|
+
documented in Mouris et al. (2023) and Schwindt et al. (2023). Full references
|
|
123
|
+
with DOIs are on the
|
|
124
|
+
[references page](https://hydrobayescal.readthedocs.io/en/latest/references.html).
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
Distributed under the BSD 3-Clause License. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# HydroBayesCal
|
|
2
|
+
|
|
3
|
+
**Surrogate-assisted Bayesian calibration for computationally expensive
|
|
4
|
+
hydro- and morphodynamic models.**
|
|
5
|
+
|
|
6
|
+
[](https://hydrobayescal.readthedocs.io)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
HydroBayesCal calibrates expensive numerical models without running them
|
|
10
|
+
thousands of times. It trains a **Gaussian Process Emulator (GPE)** as a fast
|
|
11
|
+
surrogate from a small set of strategically sampled simulations, then refines it
|
|
12
|
+
with **Bayesian Active Learning (BAL)** — iteratively adding the training points
|
|
13
|
+
that maximise the information gain (relative entropy) and Bayesian model
|
|
14
|
+
evidence for the calibration. Single- and multi-output GPEs are supported.
|
|
15
|
+
|
|
16
|
+
The package couples to open-source modelling software through a common binding
|
|
17
|
+
layer:
|
|
18
|
+
|
|
19
|
+
* **TELEMAC** (2D/3D) — fully supported
|
|
20
|
+
* **OpenFOAM** (interFoam) — binding under active development
|
|
21
|
+
|
|
22
|
+
Experimental design and parameter sampling are delegated to
|
|
23
|
+
[BayesValidRox](https://pages.iws.uni-stuttgart.de/inversemodeling/bayesvalidrox/);
|
|
24
|
+
the GP emulators and the Bayesian active-learning logic are implemented in-tree.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
HydroBayesCal targets **Python 3.10–3.11** (the upper bound is imposed by the
|
|
29
|
+
`bayesvalidrox` dependency). It is developed and tested on Linux.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install hydroBayesCal
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
or, for a development/editable install from a clone:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/sschwindt/hydrobayescal.git
|
|
39
|
+
cd hydrobayescal
|
|
40
|
+
pip install -e ".[dev,docs,mesh]"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
A calibration additionally requires a working installation of the numerical
|
|
44
|
+
solver (e.g. TELEMAC) on the system. See the
|
|
45
|
+
[installation guide](https://hydrobayescal.readthedocs.io/en/latest/installation.html)
|
|
46
|
+
for the full environment setup, including coupling HydroBayesCal with TELEMAC.
|
|
47
|
+
|
|
48
|
+
## Quick start
|
|
49
|
+
|
|
50
|
+
Configure a calibration in a Python config file and run the TELEMAC driver:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
python bal_telemac.py --config config.py
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
See the [documentation](https://hydrobayescal.readthedocs.io) for the
|
|
57
|
+
end-to-end workflow, the configuration parameters, the code architecture, and
|
|
58
|
+
worked examples.
|
|
59
|
+
|
|
60
|
+
## Citing / scientific background
|
|
61
|
+
|
|
62
|
+
HydroBayesCal builds on the Bayesian active-learning framework of Oladyshkin et
|
|
63
|
+
al. (2020) and on Gaussian-process regression (Rasmussen & Williams, 2006). Its
|
|
64
|
+
application to reservoir sedimentation and 3D reservoir hydrodynamics is
|
|
65
|
+
documented in Mouris et al. (2023) and Schwindt et al. (2023). Full references
|
|
66
|
+
with DOIs are on the
|
|
67
|
+
[references page](https://hydrobayescal.readthedocs.io/en/latest/references.html).
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
Distributed under the BSD 3-Clause License. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "hydroBayesCal"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Surrogate-assisted Bayesian calibration for hydrodynamic and morphodynamic models (Telemac, OpenFOAM)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "BSD-3-Clause"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
# bayesvalidrox currently declares python < 3.12 upstream, and the tested
|
|
13
|
+
# environment is CPython 3.11. Keep the upper bound aligned with that until
|
|
14
|
+
# the bayesvalidrox dependency boundary is resolved (see refactor item #3).
|
|
15
|
+
requires-python = ">=3.10,<3.12"
|
|
16
|
+
authors = [
|
|
17
|
+
{ name = "Sebastian Schwindt" },
|
|
18
|
+
{ name = "Andres Heredia" },
|
|
19
|
+
{ name = "Eduardo Acuna" },
|
|
20
|
+
]
|
|
21
|
+
keywords = [
|
|
22
|
+
"Bayesian calibration",
|
|
23
|
+
"Gaussian process emulator",
|
|
24
|
+
"surrogate model",
|
|
25
|
+
"Bayesian active learning",
|
|
26
|
+
"Telemac",
|
|
27
|
+
"OpenFOAM",
|
|
28
|
+
]
|
|
29
|
+
classifiers = [
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.10",
|
|
32
|
+
"Programming Language :: Python :: 3.11",
|
|
33
|
+
"Topic :: Scientific/Engineering",
|
|
34
|
+
"Intended Audience :: Science/Research",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
# Core runtime stack. These are the dependencies required to import the
|
|
38
|
+
# package and run a surrogate-assisted Bayesian calibration. Floors track the
|
|
39
|
+
# versions the code is currently tested against; upper bounds are intentionally
|
|
40
|
+
# omitted (the previous contradictory caps across requirements*.txt were the
|
|
41
|
+
# source of unresolvable environments).
|
|
42
|
+
dependencies = [
|
|
43
|
+
# scientific python
|
|
44
|
+
"numpy>=1.26",
|
|
45
|
+
"scipy>=1.11",
|
|
46
|
+
"pandas>=2.0",
|
|
47
|
+
"scikit-learn>=1.3",
|
|
48
|
+
# data IO
|
|
49
|
+
"h5py>=3.10",
|
|
50
|
+
"openpyxl>=3.1", # pandas.to_excel engine (function_pool)
|
|
51
|
+
"pyyaml>=6.0", # utils.configuration
|
|
52
|
+
# plotting
|
|
53
|
+
"matplotlib>=3.7",
|
|
54
|
+
"seaborn>=0.13",
|
|
55
|
+
"corner>=2.2",
|
|
56
|
+
# CLI / utilities
|
|
57
|
+
"tqdm>=4.66",
|
|
58
|
+
"rich>=13",
|
|
59
|
+
"joblib>=1.3",
|
|
60
|
+
# mesh / result-file IO (imported by function_pool on the core path)
|
|
61
|
+
"pyvista>=0.43",
|
|
62
|
+
# Gaussian process surrogate stack
|
|
63
|
+
"torch>=2.2",
|
|
64
|
+
"gpytorch>=1.11",
|
|
65
|
+
"linear-operator>=0.5",
|
|
66
|
+
# uncertainty quantification / sampling (numpoly comes in transitively via chaospy)
|
|
67
|
+
"emcee>=3.1",
|
|
68
|
+
"chaospy>=4.3",
|
|
69
|
+
# coupling: experimental design / sampling
|
|
70
|
+
"bayesvalidrox>=2.1",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[project.urls]
|
|
74
|
+
Documentation = "https://hydrobayescal.readthedocs.io"
|
|
75
|
+
Source = "https://github.com/sschwindt/hydrobayescal"
|
|
76
|
+
|
|
77
|
+
[project.optional-dependencies]
|
|
78
|
+
# Extra mesh / geospatial IO used by some post-processing utilities only.
|
|
79
|
+
mesh = [
|
|
80
|
+
"vtk>=9.2",
|
|
81
|
+
"meshio>=5.3",
|
|
82
|
+
"rasterio>=1.3",
|
|
83
|
+
"affine>=2.4",
|
|
84
|
+
]
|
|
85
|
+
# UM-Bridge model-server coupling protocol (used by the bayesvalidrox layer).
|
|
86
|
+
server = [
|
|
87
|
+
"umbridge>=1.2",
|
|
88
|
+
]
|
|
89
|
+
# Parallel execution on HPC clusters.
|
|
90
|
+
mpi = [
|
|
91
|
+
"mpi4py>=3.1",
|
|
92
|
+
]
|
|
93
|
+
docs = [
|
|
94
|
+
"sphinx>=7.0",
|
|
95
|
+
"sphinx-rtd-theme>=2.0",
|
|
96
|
+
"sphinxcontrib-mermaid>=0.9",
|
|
97
|
+
]
|
|
98
|
+
dev = [
|
|
99
|
+
"pytest>=7.4",
|
|
100
|
+
"build>=1.0",
|
|
101
|
+
"twine>=5.0",
|
|
102
|
+
"ruff>=0.5",
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
[tool.setuptools.packages.find]
|
|
106
|
+
where = ["src"]
|
|
107
|
+
|
|
108
|
+
# Ship the non-Python data files the package reads at runtime (Telemac
|
|
109
|
+
# parameter templates, etc.).
|
|
110
|
+
[tool.setuptools.package-data]
|
|
111
|
+
"hydroBayesCal" = [
|
|
112
|
+
"telemac/templates/*.csv",
|
|
113
|
+
"telemac/templates/*",
|
|
114
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""hydroBayesCal: surrogate-assisted Bayesian calibration for hydrodynamic models."""
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Delft3D-FLOW bindings for hydroBayesCal (planned -- not yet implemented).
|
|
2
|
+
#
|
|
3
|
+
# This sub-package is a placeholder that defines the intended interface for
|
|
4
|
+
# coupling HydroBayesCal to Delft3D-FLOW (Deltares). See
|
|
5
|
+
# ``control_delft3d.Delft3DModel`` and the ``usage-delft3d`` documentation page.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Delft3D-FLOW binding for HydroBayesCal -- **planned, not yet implemented**.
|
|
3
|
+
|
|
4
|
+
This module is a placeholder that mirrors the TELEMAC
|
|
5
|
+
(:mod:`hydroBayesCal.telemac.control_telemac`) and OpenFOAM
|
|
6
|
+
(:mod:`hydroBayesCal.openfoam.control_openfoam`) bindings. It defines the
|
|
7
|
+
intended public interface for coupling HydroBayesCal to the structured-grid
|
|
8
|
+
**Delft3D-FLOW** engine (Deltares) so that the coupling can be implemented
|
|
9
|
+
incrementally without changing the surrogate / Bayesian-active-learning layer.
|
|
10
|
+
|
|
11
|
+
The :class:`Delft3DModel` class subclasses
|
|
12
|
+
:class:`hydroBayesCal.hysim.HydroSimulations`; the Python attribute names are
|
|
13
|
+
shared across solvers, while the *string and file conventions* below are
|
|
14
|
+
Delft3D-specific and must be preserved when the binding is filled in:
|
|
15
|
+
|
|
16
|
+
* ``<case>.mdf`` -- master definition FLOW file (the control file); the engine
|
|
17
|
+
is launched through ``config_d_hydro.xml`` and the ``d_hydro`` executable.
|
|
18
|
+
* Bed roughness via Chézy / Manning / White-Colebrook (``.rgh`` file or
|
|
19
|
+
``Roughness`` keywords in the ``.mdf``); eddy viscosity/diffusivity
|
|
20
|
+
``Vicouv`` / ``Dicouv``.
|
|
21
|
+
* ``trim-<case>.dat`` / ``trim-<case>.def`` -- NEFIS map (field) output.
|
|
22
|
+
* ``trih-<case>.dat`` / ``trih-<case>.def`` -- NEFIS history (monitoring-point)
|
|
23
|
+
output.
|
|
24
|
+
|
|
25
|
+
See the :doc:`usage-delft3d <usage-delft3d>` page for the planned workflow.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from hydroBayesCal.hysim import HydroSimulations
|
|
29
|
+
|
|
30
|
+
#: Marker so callers / tests can detect that the binding is not ready yet.
|
|
31
|
+
DELFT3D_BINDING_IMPLEMENTED = False
|
|
32
|
+
|
|
33
|
+
_NOT_IMPLEMENTED_MSG = (
|
|
34
|
+
"The Delft3D-FLOW binding is planned but not yet implemented. "
|
|
35
|
+
"Use the TELEMAC (hydroBayesCal.telemac.control_telemac.TelemacModel) or "
|
|
36
|
+
"OpenFOAM (hydroBayesCal.openfoam.control_openfoam.OpenFOAMModel) bindings, "
|
|
37
|
+
"or contribute the Delft3D-FLOW implementation in "
|
|
38
|
+
"hydroBayesCal.delft3d.control_delft3d."
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class Delft3DModel(HydroSimulations):
|
|
43
|
+
"""
|
|
44
|
+
Placeholder Delft3D-FLOW model wrapper (planned).
|
|
45
|
+
|
|
46
|
+
Defines the intended constructor signature and interface but raises
|
|
47
|
+
:class:`NotImplementedError`. Instantiating it documents the Delft3D-specific
|
|
48
|
+
configuration the binding will need; it does not run a simulation.
|
|
49
|
+
|
|
50
|
+
Parameters
|
|
51
|
+
----------
|
|
52
|
+
control_file : str
|
|
53
|
+
Master definition FLOW file, default ``"control.mdf"`` (Delft3D-FLOW
|
|
54
|
+
convention ``<case>.mdf``).
|
|
55
|
+
d_hydro_config : str
|
|
56
|
+
Runtime configuration passed to the ``d_hydro`` launcher, default
|
|
57
|
+
``"config_d_hydro.xml"``.
|
|
58
|
+
flow_executable : str
|
|
59
|
+
Name of the Delft3D-FLOW launcher on ``PATH``, default ``"d_hydro"``.
|
|
60
|
+
roughness_formulation : str
|
|
61
|
+
Bed-roughness law used for the calibration parameters
|
|
62
|
+
(``"Chezy"``, ``"Manning"`` or ``"WhiteColebrook"``).
|
|
63
|
+
map_file_base, history_file_base : str
|
|
64
|
+
Base names of the NEFIS map (``trim-<case>``) and history
|
|
65
|
+
(``trih-<case>``) output files.
|
|
66
|
+
**kwargs
|
|
67
|
+
Common :class:`~hydroBayesCal.hysim.HydroSimulations` parameters
|
|
68
|
+
(``model_dir``, ``res_dir``, ``calibration_pts_file_path``,
|
|
69
|
+
``calibration_parameters``, ``param_values``, ``calibration_quantities``,
|
|
70
|
+
``init_runs``, ``max_runs`` ...).
|
|
71
|
+
|
|
72
|
+
Raises
|
|
73
|
+
------
|
|
74
|
+
NotImplementedError
|
|
75
|
+
Always -- the binding is not implemented yet.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
def __init__(
|
|
79
|
+
self,
|
|
80
|
+
control_file="control.mdf",
|
|
81
|
+
d_hydro_config="config_d_hydro.xml",
|
|
82
|
+
flow_executable="d_hydro",
|
|
83
|
+
roughness_formulation="Manning",
|
|
84
|
+
map_file_base="trim",
|
|
85
|
+
history_file_base="trih",
|
|
86
|
+
*args,
|
|
87
|
+
**kwargs,
|
|
88
|
+
):
|
|
89
|
+
# Keep the Delft3D-specific configuration on the instance so the intended
|
|
90
|
+
# interface is documented, then make the not-yet-implemented state
|
|
91
|
+
# explicit instead of silently constructing a non-functional model.
|
|
92
|
+
self.control_file = control_file
|
|
93
|
+
self.d_hydro_config = d_hydro_config
|
|
94
|
+
self.flow_executable = flow_executable
|
|
95
|
+
self.roughness_formulation = roughness_formulation
|
|
96
|
+
self.map_file_base = map_file_base
|
|
97
|
+
self.history_file_base = history_file_base
|
|
98
|
+
raise NotImplementedError(_NOT_IMPLEMENTED_MSG)
|
|
99
|
+
|
|
100
|
+
def run_multiple_simulations(self, *args, **kwargs):
|
|
101
|
+
"""Run the Delft3D-FLOW experimental-design simulations (planned)."""
|
|
102
|
+
raise NotImplementedError(_NOT_IMPLEMENTED_MSG)
|
|
103
|
+
|
|
104
|
+
def output_processing(self, *args, **kwargs):
|
|
105
|
+
"""Extract calibration quantities from NEFIS map/history output (planned)."""
|
|
106
|
+
raise NotImplementedError(_NOT_IMPLEMENTED_MSG)
|