studpy 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.
- studpy-0.1.0/.forgejo/workflows/release.yaml +165 -0
- studpy-0.1.0/.gitignore +46 -0
- studpy-0.1.0/PKG-INFO +20 -0
- studpy-0.1.0/README.md +241 -0
- studpy-0.1.0/docs/docs/assets/extra.css +12 -0
- studpy-0.1.0/docs/docs/assets/logo.png +0 -0
- studpy-0.1.0/docs/docs/assets/logo.svg +35 -0
- studpy-0.1.0/docs/docs/assets/logo_white.svg +35 -0
- studpy-0.1.0/docs/docs/documentation/_Guides/01-installation.md +21 -0
- studpy-0.1.0/docs/docs/documentation/_Guides/02-get-started.md +44 -0
- studpy-0.1.0/docs/docs/documentation/_Guides/03-configuration.md +7 -0
- studpy-0.1.0/docs/docs/documentation/api/BatchExecCmdIter.md +9 -0
- studpy-0.1.0/docs/docs/index.md +14 -0
- studpy-0.1.0/docs/docs/stylesheets/extra.css +3 -0
- studpy-0.1.0/docs/overrides/partials/header.html +72 -0
- studpy-0.1.0/docs/zensical.toml +41 -0
- studpy-0.1.0/pyproject.toml +66 -0
- studpy-0.1.0/src/studpy/__init__.py +2 -0
- studpy-0.1.0/src/studpy/batch/__init__.py +3 -0
- studpy-0.1.0/src/studpy/batch/batch_exec_cmd_iter.py +32 -0
- studpy-0.1.0/src/studpy/batch/validated_batch.py +25 -0
- studpy-0.1.0/src/studpy/params/__init__.py +5 -0
- studpy-0.1.0/src/studpy/params/configs.py +35 -0
- studpy-0.1.0/src/studpy/params/latin_hypercube_sampling.py +17 -0
- studpy-0.1.0/src/studpy/params/param.py +4 -0
- studpy-0.1.0/src/studpy/params/specs.py +18 -0
- studpy-0.1.0/src/studpy/study.py +9 -0
- studpy-0.1.0/src/studpy/targets/__init__.py +2 -0
- studpy-0.1.0/src/studpy/targets/one_file.py +16 -0
- studpy-0.1.0/src/studpy/targets/utils.py +5 -0
- studpy-0.1.0/src/studpy/utils/logger_print.py +6 -0
- studpy-0.1.0/tests/__init__.py +0 -0
- studpy-0.1.0/tests/data.py +79 -0
- studpy-0.1.0/tests/dev.py +15 -0
- studpy-0.1.0/tests/simulation.json +6 -0
- studpy-0.1.0/tests/test_00_utils.py +34 -0
- studpy-0.1.0/tests/test_10_params.py +41 -0
- studpy-0.1.0/tests/test_11_params_lhs.py +140 -0
- studpy-0.1.0/tests/test_19_params_combine.py +44 -0
- studpy-0.1.0/tests/test_20_targets.py +23 -0
- studpy-0.1.0/tests/test_30_study.py +40 -0
- studpy-0.1.0/tests/test_40_batch.py +72 -0
- studpy-0.1.0/tests/test_41_batch_study.py +60 -0
- studpy-0.1.0/tests/test_42_batch_val.py +157 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
name: Create Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
RELEASE_NAME: ${{ gitea.ref_name }}
|
|
10
|
+
VERSION: ${{ gitea.ref_name }}
|
|
11
|
+
SRC_FOLDER: src/studpy
|
|
12
|
+
PYTHON_COMMAND: python3
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
|
|
16
|
+
Release:
|
|
17
|
+
|
|
18
|
+
runs-on: node20
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
|
|
22
|
+
# Versions
|
|
23
|
+
|
|
24
|
+
- name: Ldd Version
|
|
25
|
+
run: ldd --version
|
|
26
|
+
|
|
27
|
+
- name: Node Version
|
|
28
|
+
run: node --version
|
|
29
|
+
|
|
30
|
+
- name: Python Version
|
|
31
|
+
run: ${{ env.PYTHON_COMMAND }} --version
|
|
32
|
+
|
|
33
|
+
- name: Echo `env.VERSION`
|
|
34
|
+
run: |
|
|
35
|
+
echo "VERSION: ${{ env.VERSION }}"
|
|
36
|
+
|
|
37
|
+
# Checkout
|
|
38
|
+
|
|
39
|
+
- name: Check out
|
|
40
|
+
uses: actions/checkout@v4
|
|
41
|
+
|
|
42
|
+
# Install pip zip
|
|
43
|
+
|
|
44
|
+
- name: Install pip zip
|
|
45
|
+
run: |
|
|
46
|
+
apt update && apt install -y python3-pip zip
|
|
47
|
+
|
|
48
|
+
# ############
|
|
49
|
+
# Docs - Build
|
|
50
|
+
|
|
51
|
+
# Docs - Pre build actions
|
|
52
|
+
|
|
53
|
+
# - name: Docs - Pre build actions
|
|
54
|
+
# run: python3 docs_gen.py
|
|
55
|
+
|
|
56
|
+
# Docs - Zensical Prerequisites + Build
|
|
57
|
+
|
|
58
|
+
# - name: Docs Prerequisites + Build
|
|
59
|
+
# run: |
|
|
60
|
+
# pip install zensical mkdocstrings-python --break-system-packages
|
|
61
|
+
# pip install -e . --break-system-packages
|
|
62
|
+
# zensical build -f docs/zensical.toml
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# ###############
|
|
66
|
+
# Package - Build
|
|
67
|
+
|
|
68
|
+
# Package - Prerequisites
|
|
69
|
+
|
|
70
|
+
- name: Package - Prerequisites
|
|
71
|
+
run: |
|
|
72
|
+
pip install python-minifier --break-system-packages
|
|
73
|
+
|
|
74
|
+
- name: Package - Minify
|
|
75
|
+
run: |
|
|
76
|
+
pyminify --in-place --remove-literal-statements ${{ env.SRC_FOLDER }}
|
|
77
|
+
|
|
78
|
+
- name: Package - Build
|
|
79
|
+
run: |
|
|
80
|
+
pip install build twine --break-system-packages
|
|
81
|
+
${{ env.PYTHON_COMMAND }} -m build
|
|
82
|
+
|
|
83
|
+
- name: Publish to PyPI
|
|
84
|
+
env:
|
|
85
|
+
TWINE_USERNAME: __token__
|
|
86
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
87
|
+
run: twine upload dist/*
|
|
88
|
+
|
|
89
|
+
# - name: Publish to PyPI
|
|
90
|
+
# uses: pypa/gh-action-pypi-publish@release/v1
|
|
91
|
+
|
|
92
|
+
# - name: Publish to PyPI
|
|
93
|
+
# uses: https://github.com/pypa/gh-action-pypi-publish@release/v1
|
|
94
|
+
# with:
|
|
95
|
+
# user: PinkSalmon
|
|
96
|
+
# password: ${{ secrets.PYPI_TOKEN }}
|
|
97
|
+
# verbose: true
|
|
98
|
+
# print-hash: true
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# # Create Release
|
|
102
|
+
|
|
103
|
+
# - name: Create Release
|
|
104
|
+
# id: create_release
|
|
105
|
+
# uses: https://github.com/softprops/action-gh-release@v1
|
|
106
|
+
# with:
|
|
107
|
+
# tag_name: ${{ gitea.ref_name }}
|
|
108
|
+
# name: ${{ gitea.ref_name }}
|
|
109
|
+
# # name: ${{ env.RELEASE_NAME }}
|
|
110
|
+
# draft: true
|
|
111
|
+
# # body_path: RELEASE.md
|
|
112
|
+
|
|
113
|
+
# # Add zip to Release
|
|
114
|
+
|
|
115
|
+
# - name: Push
|
|
116
|
+
# run: |
|
|
117
|
+
# curl -X 'POST' \
|
|
118
|
+
# '${{ env.asset_url }}?token=${{ gitea.token }}&name=${{ env.asset_release_name }}' \
|
|
119
|
+
# -H 'accept: application/json' \
|
|
120
|
+
# -H 'Content-Type: multipart/form-data' \
|
|
121
|
+
# -F 'attachment=@${{ env.asset_source_path }}'
|
|
122
|
+
# env:
|
|
123
|
+
# asset_url: ${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${{ steps.create_release.outputs.id }}/assets
|
|
124
|
+
# asset_source_path: site.zip
|
|
125
|
+
# asset_release_name: persee-documentations-${{ env.VERSION }}.zip
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
# # Docs - Deploy
|
|
129
|
+
|
|
130
|
+
# # Zip
|
|
131
|
+
|
|
132
|
+
# - name: Zip output
|
|
133
|
+
# run: zip -qq -r site.zip site/
|
|
134
|
+
# working-directory: docs
|
|
135
|
+
|
|
136
|
+
# - name: mv
|
|
137
|
+
# run: |
|
|
138
|
+
# mv docs/site.zip site.zip
|
|
139
|
+
|
|
140
|
+
# - name: Deploy - Copy files via SCP
|
|
141
|
+
# uses: https://github.com/appleboy/scp-action@v0.1.7
|
|
142
|
+
|
|
143
|
+
# with:
|
|
144
|
+
# host: ${{ secrets.DOCS_SSH_HOST }}
|
|
145
|
+
# username: ${{ secrets.DOCS_SSH_USERNAME }}
|
|
146
|
+
# password: ${{ secrets.DOCS_SSH_PASSWORD }}
|
|
147
|
+
# port: ${{ secrets.DOCS_SSH_PORT }}
|
|
148
|
+
# source: "site.zip"
|
|
149
|
+
# target: "${{ secrets.DOCS_FOLDER_PATH }}"
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
# - name: Deploy
|
|
153
|
+
# uses: https://github.com/appleboy/ssh-action@v1.0.3
|
|
154
|
+
# with:
|
|
155
|
+
# host: ${{ secrets.DOCS_SSH_HOST }}
|
|
156
|
+
# username: ${{ secrets.DOCS_SSH_USERNAME }}
|
|
157
|
+
# password: ${{ secrets.DOCS_SSH_PASSWORD }}
|
|
158
|
+
# port: ${{ secrets.DOCS_SSH_PORT }}
|
|
159
|
+
# script: |
|
|
160
|
+
# cd ${{ secrets.DOCS_FOLDER_PATH }}
|
|
161
|
+
# docker compose down
|
|
162
|
+
# rm -rf site
|
|
163
|
+
# unzip site.zip
|
|
164
|
+
# rm -f site.zip
|
|
165
|
+
# docker compose up -d
|
studpy-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
*.so
|
|
7
|
+
*.egg
|
|
8
|
+
*.egg-info/
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
.eggs/
|
|
12
|
+
|
|
13
|
+
# Virtual environments
|
|
14
|
+
.venv/
|
|
15
|
+
venv/
|
|
16
|
+
env/
|
|
17
|
+
__env__
|
|
18
|
+
|
|
19
|
+
# Testing & coverage
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.coverage
|
|
22
|
+
htmlcov/
|
|
23
|
+
.tox/
|
|
24
|
+
|
|
25
|
+
# Type checking
|
|
26
|
+
.mypy_cache/
|
|
27
|
+
|
|
28
|
+
# Linting
|
|
29
|
+
.ruff_cache/
|
|
30
|
+
|
|
31
|
+
# Editors
|
|
32
|
+
.vscode/
|
|
33
|
+
.idea/
|
|
34
|
+
*.swp
|
|
35
|
+
*.swo
|
|
36
|
+
|
|
37
|
+
# OS
|
|
38
|
+
.DS_Store
|
|
39
|
+
Thumbs.db
|
|
40
|
+
|
|
41
|
+
# Docs
|
|
42
|
+
site/
|
|
43
|
+
|
|
44
|
+
tests/tmp
|
|
45
|
+
|
|
46
|
+
|
studpy-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: studpy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A collection of useful functionalities for scientific studies.
|
|
5
|
+
Author-email: PinkSalmon <dev@pinksalmon.cloud>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Requires-Dist: pandas
|
|
12
|
+
Requires-Dist: pydantic
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
15
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
16
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
17
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
18
|
+
Provides-Extra: docs
|
|
19
|
+
Requires-Dist: mkdocstrings-python; extra == 'docs'
|
|
20
|
+
Requires-Dist: zensical; extra == 'docs'
|
studpy-0.1.0/README.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# StudPy
|
|
2
|
+
|
|
3
|
+
A collection of useful functionalities for scientific studies.
|
|
4
|
+
|
|
5
|
+
By PinkSalmon
|
|
6
|
+
|
|
7
|
+
## Development
|
|
8
|
+
|
|
9
|
+
### Install
|
|
10
|
+
|
|
11
|
+
- Clone this repo
|
|
12
|
+
- Install dev dependencies
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
cd studpy
|
|
16
|
+
pip install -e ".[dev]"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Tests
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pytest
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Lint & format
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
ruff check .
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Type check
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
mypy
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Documentations
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
zensical serve -f docs/zensical.toml
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Ajouts/Modifications TB
|
|
48
|
+
|
|
49
|
+
# StudPy — Nouvelles fonctionnalités
|
|
50
|
+
|
|
51
|
+
Ce document décrit les fonctionnalités ajoutées à StudPy dans le cadre du projet de modèles surrogate RAYOT. Ces ajouts sont génériques et réutilisables pour tout projet de simulation.
|
|
52
|
+
|
|
53
|
+
## Fichiers ajoutés
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
studpy/src/studpy/
|
|
57
|
+
├── params/
|
|
58
|
+
│ ├── configs.py ← LHSConfig ajouté
|
|
59
|
+
│ ├── specs.py ← ParamsSpecsLHS ajouté
|
|
60
|
+
│ ├── param.py ← LHSConfig ajouté dans le discriminated union pydantic
|
|
61
|
+
│ └── __init__.py ← exports mis à jour
|
|
62
|
+
├── batch/
|
|
63
|
+
│ ├── validated_batch.py ← NOUVEAU
|
|
64
|
+
│ └── __init__.py ← mis à jour
|
|
65
|
+
└── surrogate/ ← NOUVEAU subpackage
|
|
66
|
+
├── __init__.py
|
|
67
|
+
├── models.py
|
|
68
|
+
└── trainer.py
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## `params` — Échantillonnage Latin Hypercube
|
|
74
|
+
|
|
75
|
+
### `LHSConfig`
|
|
76
|
+
|
|
77
|
+
Config pydantic pour un paramètre LHS. Définit uniquement les bornes `lo` et `hi` — la génération effective est gérée par `ParamsSpecsLHS`.
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from studpy.params import LHSConfig, Param
|
|
81
|
+
|
|
82
|
+
param = Param(
|
|
83
|
+
target = "temperature",
|
|
84
|
+
name = "temperature",
|
|
85
|
+
config = LHSConfig(lo=5.0, hi=100.0),
|
|
86
|
+
)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Pourquoi ne pas utiliser `LinearConfig` ?**
|
|
90
|
+
`LinearConfig` génère `size` valeurs régulièrement espacées. Combiné avec `ParamsSpecs.build_cases()` qui fait un produit cartésien, on obtient `size^n_params` runs. Avec 5 valeurs et 8 paramètres : 5⁸ = 390 625 runs. `LHSConfig` avec `ParamsSpecsLHS` donne exactement `n_samples` runs.
|
|
91
|
+
|
|
92
|
+
### `ParamsSpecsLHS`
|
|
93
|
+
|
|
94
|
+
Remplace `ParamsSpecs` pour générer un plan Latin Hypercube au lieu d'un produit cartésien.
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from studpy.params import LHSConfig, Param, ParamsSpecsLHS
|
|
98
|
+
|
|
99
|
+
params = [
|
|
100
|
+
Param(target="debit", name="debit", config=LHSConfig(lo=10.0, hi=100.0)),
|
|
101
|
+
Param(target="temperature", name="temperature", config=LHSConfig(lo=5.0, hi=100.0)),
|
|
102
|
+
Param(target="diametre", name="diametre", config=LHSConfig(lo=0.01, hi=1.0)),
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
specs = ParamsSpecsLHS(
|
|
106
|
+
parameters = params,
|
|
107
|
+
n_samples = 200, # toujours 200 runs, peu importe le nombre de paramètres
|
|
108
|
+
random_seed = 42,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
print(specs.cases_count()) # 200
|
|
112
|
+
print(specs.cases) # DataFrame 200 × 3
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Algorithme LHS (pure stdlib, pas de scipy) :**
|
|
116
|
+
Pour chaque paramètre, l'intervalle `[lo, hi]` est découpé en `n_samples` strates égales. Un point est tiré aléatoirement dans chaque strate, et l'ordre des strates est mélangé indépendamment par paramètre. Cela garantit une couverture uniforme de l'espace avec exactement `n_samples` points.
|
|
117
|
+
|
|
118
|
+
**Compatibilité :** `ParamsSpecsLHS` hérite de `ParamsSpecs` et implémente la même interface — il est compatible avec `Study` sans modification.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## `batch` — Validation du fichier de sortie
|
|
123
|
+
|
|
124
|
+
### `ValidatedBatchExecCmdIter`
|
|
125
|
+
|
|
126
|
+
Extension de `BatchExecCmdIter` qui ajoute une validation du fichier de sortie après chaque run. Utile pour tout outil de simulation qui produit un fichier de résultats.
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from studpy.batch import ValidatedBatchExecCmdIter
|
|
130
|
+
from pathlib import Path
|
|
131
|
+
|
|
132
|
+
class MySimBatch(ValidatedBatchExecCmdIter):
|
|
133
|
+
|
|
134
|
+
def get_nb_runs(self) -> int:
|
|
135
|
+
return 50
|
|
136
|
+
|
|
137
|
+
def cmd_callable(self, index_run: int) -> str:
|
|
138
|
+
return f"./my_exe run_{index_run:03d}"
|
|
139
|
+
|
|
140
|
+
def expected_output_path(self, index_run: int) -> Path:
|
|
141
|
+
# Le run est valide seulement si ce fichier existe et n'est pas vide
|
|
142
|
+
return Path(f"Runs/run_{index_run:03d}/POST/result.tmp")
|
|
143
|
+
|
|
144
|
+
def cleanup_path(self, index_run: int) -> Path | None:
|
|
145
|
+
# Dossier supprimé en cas d'échec (optionnel)
|
|
146
|
+
return Path(f"Runs/run_{index_run:03d}/POST")
|
|
147
|
+
|
|
148
|
+
batch = MySimBatch()
|
|
149
|
+
batch.exec(max_parallel_jobs=4)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Ce que `ValidatedBatchExecCmdIter` ajoute par rapport à `BatchExecCmdIter` :**
|
|
153
|
+
|
|
154
|
+
| Fonctionnalité | `BatchExecCmdIter` | `ValidatedBatchExecCmdIter` |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| Lancement parallèle async | ✅ | ✅ |
|
|
157
|
+
| Vérification code de retour | via `post_callable` | ✅ automatique |
|
|
158
|
+
| Détection mots-clés erreur | via `post_callable` | ✅ automatique |
|
|
159
|
+
| Vérification fichier de sortie | ❌ | ✅ via `expected_output_path()` |
|
|
160
|
+
| Nettoyage en cas d'échec | ❌ | ✅ via `cleanup_path()` |
|
|
161
|
+
| Comptage `failed_runs` / `success_runs` | ❌ | ✅ |
|
|
162
|
+
| Rapport final | via `end_callable` | ✅ automatique |
|
|
163
|
+
|
|
164
|
+
**Méthodes à implémenter :**
|
|
165
|
+
- `get_nb_runs()` — obligatoire (hérité de `BatchExecCmdIter`)
|
|
166
|
+
- `cmd_callable(index_run)` — obligatoire (hérité de `BatchExecCmdIter`)
|
|
167
|
+
- `expected_output_path(index_run)` — obligatoire (nouveau)
|
|
168
|
+
- `cleanup_path(index_run)` — optionnel, retourne `None` par défaut
|
|
169
|
+
- `pre_callable(index_run)` — optionnel (hérité)
|
|
170
|
+
|
|
171
|
+
**Mots-clés d'erreur :** configurable via l'attribut de classe `error_keywords` (défaut : `["error", "erreur", "fatal"]`).
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## `surrogate` — Entraînement de modèles surrogate
|
|
176
|
+
|
|
177
|
+
Nouveau subpackage générique pour entraîner et évaluer des modèles sklearn sur un dataset CSV.
|
|
178
|
+
|
|
179
|
+
### `models.py` — Configs pydantic
|
|
180
|
+
|
|
181
|
+
Cohérent avec le style de `params/configs.py` — chaque modèle est une classe pydantic avec ses hyperparamètres.
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
from studpy.surrogate import (
|
|
185
|
+
LinearModelConfig,
|
|
186
|
+
GaussianProcessModelConfig,
|
|
187
|
+
NeuralNetworkModelConfig,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
model_configs = [
|
|
191
|
+
LinearModelConfig(),
|
|
192
|
+
GaussianProcessModelConfig(n_restarts_optimizer=5, normalize_y=True),
|
|
193
|
+
NeuralNetworkModelConfig(hidden_layer_sizes=[128, 64], max_iter=3000),
|
|
194
|
+
]
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### `trainer.py` — `SurrogateTrainer`
|
|
198
|
+
|
|
199
|
+
Entraîne et évalue les modèles par validation croisée, puis sauvegarde les pipelines en `.joblib`.
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
from studpy.surrogate import SurrogateTrainer
|
|
203
|
+
|
|
204
|
+
trainer = SurrogateTrainer(
|
|
205
|
+
feature_names = ["debit", "vent", "temperature", "diametre"],
|
|
206
|
+
target_names = ["hauteur_max", "longueur_sol", "bruit"],
|
|
207
|
+
model_configs = model_configs,
|
|
208
|
+
n_folds = 5,
|
|
209
|
+
random_seed = 42,
|
|
210
|
+
models_dir = Path("models_saved"),
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
results = trainer.run(Path("dataset_complete.csv"))
|
|
214
|
+
SurrogateTrainer.print_best(results, trainer.target_names)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Ce que `SurrogateTrainer.run()` fait :**
|
|
218
|
+
1. Charge le CSV et supprime les lignes avec des valeurs manquantes dans les cibles
|
|
219
|
+
2. Pour chaque combinaison (modèle × cible) : validation croisée k-fold → R², MAE, RMSE
|
|
220
|
+
3. Entraîne le modèle final sur toutes les données
|
|
221
|
+
4. Sauvegarde dans `models_dir/<cible>/<modèle>.joblib`
|
|
222
|
+
|
|
223
|
+
**`CVResult`** — résultat pour un (modèle × cible) :
|
|
224
|
+
```python
|
|
225
|
+
@dataclass
|
|
226
|
+
class CVResult:
|
|
227
|
+
model_name: str
|
|
228
|
+
target_name: str
|
|
229
|
+
r2: float
|
|
230
|
+
mae: float
|
|
231
|
+
rmse: float
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Pipeline sklearn :** chaque modèle est encapsulé dans `Pipeline([StandardScaler, estimateur])` — les données sont toujours normalisées avant entraînement, ce qui est critique pour GP et MLP.
|
|
235
|
+
|
|
236
|
+
**Charger un modèle sauvegardé :**
|
|
237
|
+
```python
|
|
238
|
+
import joblib
|
|
239
|
+
pipeline = joblib.load("models_saved/hauteur_max/Gaussian_Process.joblib")
|
|
240
|
+
y_pred = pipeline.predict(X_new)
|
|
241
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.nopadding {
|
|
2
|
+
padding: 2px 4px !important;
|
|
3
|
+
}
|
|
4
|
+
.noborder {
|
|
5
|
+
border: none !important;
|
|
6
|
+
}
|
|
7
|
+
:root > * {
|
|
8
|
+
--md-text-font: "poppins";
|
|
9
|
+
--md-primary-fg-color: #010E31;
|
|
10
|
+
--md-primary-fg-color--light: #001755;
|
|
11
|
+
--md-primary-fg-color--dark: #010E31;
|
|
12
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="335 335 584 584">
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<path fill="#000000" transform="translate(498,509)" d="M0 0 C3.81752984 0.65443369 6.51125274 2.42851698 9.75 4.5 C17.33844633 9.2906018 25.15381637 13.64884297 33 18 C32.51789062 18.97839844 32.03578125 19.95679688 31.5390625 20.96484375 C30.90054714 22.28882412 30.26255441 23.61305662 29.625 24.9375 C29.14933594 25.8975293 29.14933594 25.8975293 28.6640625 26.87695312 C22.4616073 39.8633437 21.77727479 56.48165593 25.90234375 70.23828125 C32.59880258 87.08666699 44.56318504 98.33109527 60.75390625 105.703125 C74.45210841 111.17581226 93.14591559 111.2579796 107 106 C114.25330118 102.81950253 121.25554412 99.15043439 128 95 C130.27547141 99.49226304 132.52833805 103.99519228 134.76416016 108.50732422 C135.5738239 110.14040736 136.38591058 111.77229198 137.20068359 113.40283203 C145.74527525 130.56399145 153.08652221 148.19926766 160.44198608 165.89248657 C162.55416381 170.9628952 164.73086166 175.9974495 167 181 C188.0946725 159.70278807 196.28760208 125.42006669 202 97 C204.96404628 98.39210264 207.52782057 100.03357647 210.1875 101.9375 C220.08240815 108.49668547 230.06429221 109.38335225 241.80078125 107.56640625 C253.47550442 104.56859057 263.13985918 96.78402234 269.4609375 86.66015625 C270.80256034 84.1517281 271.92584187 81.63378986 273 79 C273.39316406 78.08089844 273.78632812 77.16179687 274.19140625 76.21484375 C280.32031141 59.6646643 277.712074 42.55176014 270.75 26.8125 C270.41484375 26.11769531 270.0796875 25.42289063 269.734375 24.70703125 C269 23 269 23 269 21 C270.40527344 19.77905273 270.40527344 19.77905273 272.359375 18.43359375 C273.06320312 17.94826172 273.76703125 17.46292969 274.4921875 16.96289062 C275.23726562 16.45951172 275.98234375 15.95613281 276.75 15.4375 C277.47960937 14.93025391 278.20921875 14.42300781 278.9609375 13.90039062 C282.30373709 11.61817018 284.98156225 9.79575789 289 9 C294.51941819 19.03675182 298.20412286 28.91630368 301 40 C301.26111572 40.96518555 301.52223145 41.93037109 301.79125977 42.92480469 C303.87153851 51.07292352 304.50908897 58.73048879 304.4375 67.125 C304.42920166 68.39182617 304.42090332 69.65865234 304.41235352 70.96386719 C303.91160972 98.99839196 293.40227732 122.09610956 275 143 C274.46246094 143.62132812 273.92492187 144.24265625 273.37109375 144.8828125 C267.77715888 150.91136386 260.73661051 155.35631703 254 160 C255.70019502 165.47840617 257.69176844 170.68368936 260 175.9375 C263.94148069 185.04973506 266.24675418 193.46708373 267.5703125 203.3125 C267.85597929 205.96228694 267.85597929 205.96228694 269 208 C269.160892 210.65048406 269.26074684 213.27262098 269.30859375 215.92578125 C269.3314872 217.13585594 269.3314872 217.13585594 269.35484314 218.37037659 C269.66712125 238.73919981 268.57521108 257.28044963 263 277 C262.73848145 277.92506348 262.47696289 278.85012695 262.20751953 279.80322266 C259.92394946 287.62033856 257.27234796 295.23116433 253.38671875 302.4140625 C251.96772966 305.06017737 250.6931181 307.75997488 249.40966797 310.47363281 C240.30663121 329.44781793 227.43139209 345.81004675 213 361 C212.49307617 361.53560547 211.98615234 362.07121094 211.46386719 362.62304688 C203.56470623 370.91149898 195.25247813 378.25580087 186 385 C185.17072998 385.61174072 185.17072998 385.61174072 184.32470703 386.23583984 C168.99401737 397.41118857 151.56908392 405.97745381 134 413 C134 412.01 134 411.02 134 410 C134.66 410 135.32 410 136 410 C136.23332031 409.47019531 136.46664062 408.94039062 136.70703125 408.39453125 C138.0577007 405.8931404 139.6652286 403.69826076 141.37646484 401.43334961 C158.14627697 379.10170593 163.00961524 352.93614845 159.68359375 325.37841797 C158.89605877 321.08233819 157.57937974 317.06274656 156 313 C155.649375 312.01257813 155.29875 311.02515625 154.9375 310.0078125 C149.88943623 296.79170111 142.56650282 284.41377763 133 274 C132.56349121 273.52111328 132.12698242 273.04222656 131.67724609 272.54882812 C117.86442002 257.56179003 101.01749688 246.31701564 82 239 C82 238.34 82 237.68 82 237 C80.0509375 236.814375 80.0509375 236.814375 78.0625 236.625 C75.84765625 236.4140625 75.84765625 236.4140625 74 236 C73.67 235.34 73.34 234.68 73 234 C83.26414815 233.60690496 92.27680264 235.7393832 102.125 238.375 C102.87716797 238.57182373 103.62933594 238.76864746 104.40429688 238.97143555 C108.92629415 240.21835351 112.94513631 241.83053772 117.0925293 244.01879883 C118.87465676 244.93552355 120.72411338 245.7179095 122.57421875 246.48828125 C126.20988957 248.09261946 129.49807728 250.01722518 132.8125 252.1875 C133.4206958 252.58404785 134.0288916 252.9805957 134.65551758 253.38916016 C157.68073963 268.60577586 174.98043356 290.1484546 182 317 C182.28617188 317.89203125 182.57234375 318.7840625 182.8671875 319.703125 C185.9114754 329.85075135 185.74599564 340.48618412 186 351 C200.5463678 319.1640288 206.86025574 288.42507121 194.69140625 254.42578125 C180.90636893 217.53590905 149.6621111 194.12078631 115 178 C100.94349036 171.87447493 86.59022696 166.51022772 72.125 161.4375 C37.24101277 149.16707355 1.6396674 131.43037267 -15.25 96.75 C-24.41715909 76.81678389 -25.26200063 52.75542094 -18 32 C-17.66097656 30.98679687 -17.32195312 29.97359375 -16.97265625 28.9296875 C-13.10203902 18.59885858 -6.78327899 8.68969074 0 0 Z "/>
|
|
6
|
+
|
|
7
|
+
<path fill="#000000" transform="translate(460,402)" d="M0 0 C3.04438473 2.85987657 5.66384265 5.7940115 8.1875 9.125 C16.39027982 19.75692921 25.20438754 28.12983826 36 36 C36.55187988 36.41072754 37.10375977 36.82145508 37.67236328 37.24462891 C54.51301296 49.66379527 74.19467519 57.89611371 93.28637695 66.18505859 C106.45704874 71.90961089 118.783232 78.22398678 130.8671875 85.99609375 C133.75956615 87.92362588 133.75956615 87.92362588 136 89 C128.25980254 79.77976478 119.55497607 71.18739692 109.1875 64.9375 C108.135625 64.298125 107.08375 63.65875 106 63 C106 62.34 106 61.68 106 61 C116.18620354 57.21432282 126.3331382 54.30436289 137 52.1875 C138.55545532 51.87776245 138.55545532 51.87776245 140.14233398 51.56176758 C149.68072774 49.74096139 159.0948371 48.85067795 168.80078125 48.7265625 C170.16075478 48.70783836 170.16075478 48.70783836 171.54820251 48.68873596 C192.57786319 48.45533103 212.4717921 48.95951395 233 54 C233.87479004 54.21350098 234.74958008 54.42700195 235.65087891 54.64697266 C245.69144552 57.18548593 256.33337628 60.22225085 265 66 C263.38937849 69.63466459 261.13544336 72.50644358 258.6875 75.625 C254.72564357 80.82653409 251.6309631 86.02414411 249 92 C249.845625 91.071875 250.69125 90.14375 251.5625 89.1875 C265.28388779 75.60250771 283.02424619 66.56709413 300.04296875 57.85498047 C324.95952889 45.08846378 348.96150506 28.36246931 364.36328125 4.51171875 C366 2 366 2 368 0 C372.59489711 9.18979422 369.27852645 26.01601406 366.32421875 35.41796875 C353.38921149 70.40735418 327.78260274 92.57277823 297.17431641 112.56762695 C291.24405657 116.4507487 285.61651354 120.67398596 280 125 C279.21109375 125.59425781 278.4221875 126.18851563 277.609375 126.80078125 C271.78587066 131.22949521 266.33782634 135.99872283 261 141 C260.03835938 141.89589844 259.07671875 142.79179688 258.0859375 143.71484375 C232.07549441 168.49212409 219.44884929 202.29701365 211.72192383 236.71899414 C211.48368896 237.47172607 211.2454541 238.22445801 211 239 C210.34 239.33 209.68 239.66 209 240 C208.73074707 238.92407593 208.73074707 238.92407593 208.45605469 237.82641602 C200.64376796 207.21694266 188.36160922 180.64974609 166 158 C165.1788269 157.14704346 165.1788269 157.14704346 164.34106445 156.27685547 C160.37761491 152.21072589 156.24697357 148.63044884 151.6875 145.25 C150.9958374 144.73687256 150.3041748 144.22374512 149.59155273 143.69506836 C132.25173488 131.03674859 112.95573422 120.58604498 93.29467773 112.02172852 C69.0712492 101.23600148 46.37912358 88.22560432 27 70 C25.98679687 69.10087891 25.98679687 69.10087891 24.953125 68.18359375 C10.1671315 54.49176376 -0.35104347 32.93074933 -1.27734375 12.72265625 C-1.46323822 2.92647645 -1.46323822 2.92647645 0 0 Z "/>
|
|
8
|
+
|
|
9
|
+
<path d="M0 0 C1.875 0.875 1.875 0.875 3.875 2.875 C6.60776254 4.98468816 6.60776254 4.98468816 9.17578125 5.2890625 C12.5790816 6.02783971 15.06626571 7.4857577 18.0625 9.25 C19.10792969 9.85585938 20.15335938 10.46171875 21.23046875 11.0859375 C23.875 12.875 23.875 12.875 25.875 15.875 C26.30240092 21.17477145 26.39851458 24.62248241 22.875 28.875 C19.94604403 31.23443675 18.12818497 31.84335188 14.375 32.3125 C10.3431503 31.80851879 8.75226072 30.665071 5.875 27.875 C6.11959876 34.7237654 7.98634428 38.99715989 12.875 43.875 C18.49086002 48.01800333 24.15719268 47.59795629 30.875 46.875 C36.86430326 45.18423975 40.36637997 41.88731432 43.875 36.875 C44.93294332 34.90503657 45.95336462 32.91229925 46.875 30.875 C48.15109323 31.78433009 49.42065553 32.70282853 50.6875 33.625 C51.39519531 34.13546875 52.10289062 34.6459375 52.83203125 35.171875 C54.92811445 36.91927897 56.40417272 38.58087946 57.875 40.875 C58.02053967 46.1144282 54.21117973 50.17540199 50.875 53.875 C42.31031368 61.88949234 33.14614765 64.54533875 21.63598633 64.48828125 C14.37582855 64.18466775 8.88524427 61.97978828 2.875 57.875 C1.86566406 57.20791016 1.86566406 57.20791016 0.8359375 56.52734375 C-5.99596581 51.36579565 -11.59625879 42.87677394 -12.8984375 34.3671875 C-12.97320313 33.54476562 -13.04796875 32.72234375 -13.125 31.875 C-13.24101563 30.82570313 -13.35703125 29.77640625 -13.4765625 28.6953125 C-14.10909667 18.17650345 -11.00727114 9.46510971 -4.0234375 1.46875 C-2.125 -0.125 -2.125 -0.125 0 0 Z " fill="#6863F1" transform="translate(559.125,542.125)"/>
|
|
10
|
+
<path d="M0 0 C0.433125 1.134375 0.86625 2.26875 1.3125 3.4375 C1.869375 4.613125 2.42625 5.78875 3 7 C3.99 7.33 4.98 7.66 6 8 C11.4815986 17.60654738 11.23579761 28.35632318 8.4375 38.75 C5.02940146 48.62871919 -0.84094861 55.06446877 -10 60 C-16.25282076 62.98780105 -23.72492091 63.23549084 -30.37890625 61.3125 C-36.182387 58.58679475 -42.93845557 53.74039581 -46 48 C-45.5351624 44.61026123 -44.10543812 42.44727771 -42.0625 39.75 C-41.53785156 39.04359375 -41.01320313 38.3371875 -40.47265625 37.609375 C-39.98667969 37.07828125 -39.50070312 36.5471875 -39 36 C-38.34 36 -37.68 36 -37 36 C-35.67536185 37.6850839 -34.56632247 39.46699122 -33.4140625 41.2734375 C-31.11092418 44.08555666 -28.991481 44.88467668 -25.4140625 45.30078125 C-17.7580752 45.34521635 -17.7580752 45.34521635 -11 42 C-6.51889879 36.27414846 -4.84214073 31.15819616 -4 24 C-4.66 24 -5.32 24 -6 24 C-6.268125 24.61875 -6.53625 25.2375 -6.8125 25.875 C-8 28 -8 28 -11 30 C-15.11136265 30.45681807 -17.26502493 30.45731782 -20.8125 28.25 C-22.85465233 26.14950046 -24.13090389 24.78110754 -25 22 C-24.47578144 15.70937729 -17.47407875 11.80461551 -13 8 C-12.06027344 7.19820312 -11.12054687 6.39640625 -10.15234375 5.5703125 C-3.42237544 0 -3.42237544 0 0 0 Z " fill="#6555E9" transform="translate(750,544)"/>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<path d="M0 0 C3.9016337 1.65006592 6.60953995 3.41430992 9 7 C9.42740092 12.29977145 9.52351458 15.74748241 6 20 C3.07104403 22.35943675 1.25318497 22.96835188 -2.5 23.4375 C-6.5973411 22.92533236 -8.11262703 21.88737297 -11 19 C-13.6816265 14.97756025 -13.68957829 11.72734998 -13 7 C-9.67929422 1.61816649 -6.37478637 -0.73555227 0 0 Z " fill="#F3F4F6" transform="translate(576,551)"/>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<path d="M0 0 C3.41219223 1.30618488 4.52452754 2.70115661 6.31640625 5.88671875 C6.92863293 9.01587734 6.99496845 11.76533263 6.31640625 14.88671875 C3.87890625 17.88671875 3.87890625 17.88671875 1.31640625 19.88671875 C0.98640625 20.21671875 0.65640625 20.54671875 0.31640625 20.88671875 C-3.74577484 21.27731309 -5.98711969 21.32008039 -9.49609375 19.13671875 C-11.53824608 17.03621921 -12.81449764 15.66782629 -13.68359375 12.88671875 C-13.30891181 8.72061244 -10.91744333 6.80647155 -7.93359375 4.07421875 C-7.0725 3.26339844 -6.21140625 2.45257812 -5.32421875 1.6171875 C-2.68359375 -0.11328125 -2.68359375 -0.11328125 0 0 Z " fill="#F0F1F5" transform="translate(738.68359375,553.11328125)"/>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
</svg>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="335 335 584 584">
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<path d="M0 0 C3.81752984 0.65443369 6.51125274 2.42851698 9.75 4.5 C17.33844633 9.2906018 25.15381637 13.64884297 33 18 C32.51789062 18.97839844 32.03578125 19.95679688 31.5390625 20.96484375 C30.90054714 22.28882412 30.26255441 23.61305662 29.625 24.9375 C29.14933594 25.8975293 29.14933594 25.8975293 28.6640625 26.87695312 C22.4616073 39.8633437 21.77727479 56.48165593 25.90234375 70.23828125 C32.59880258 87.08666699 44.56318504 98.33109527 60.75390625 105.703125 C74.45210841 111.17581226 93.14591559 111.2579796 107 106 C114.25330118 102.81950253 121.25554412 99.15043439 128 95 C130.27547141 99.49226304 132.52833805 103.99519228 134.76416016 108.50732422 C135.5738239 110.14040736 136.38591058 111.77229198 137.20068359 113.40283203 C145.74527525 130.56399145 153.08652221 148.19926766 160.44198608 165.89248657 C162.55416381 170.9628952 164.73086166 175.9974495 167 181 C188.0946725 159.70278807 196.28760208 125.42006669 202 97 C204.96404628 98.39210264 207.52782057 100.03357647 210.1875 101.9375 C220.08240815 108.49668547 230.06429221 109.38335225 241.80078125 107.56640625 C253.47550442 104.56859057 263.13985918 96.78402234 269.4609375 86.66015625 C270.80256034 84.1517281 271.92584187 81.63378986 273 79 C273.39316406 78.08089844 273.78632812 77.16179687 274.19140625 76.21484375 C280.32031141 59.6646643 277.712074 42.55176014 270.75 26.8125 C270.41484375 26.11769531 270.0796875 25.42289063 269.734375 24.70703125 C269 23 269 23 269 21 C270.40527344 19.77905273 270.40527344 19.77905273 272.359375 18.43359375 C273.06320312 17.94826172 273.76703125 17.46292969 274.4921875 16.96289062 C275.23726562 16.45951172 275.98234375 15.95613281 276.75 15.4375 C277.47960937 14.93025391 278.20921875 14.42300781 278.9609375 13.90039062 C282.30373709 11.61817018 284.98156225 9.79575789 289 9 C294.51941819 19.03675182 298.20412286 28.91630368 301 40 C301.26111572 40.96518555 301.52223145 41.93037109 301.79125977 42.92480469 C303.87153851 51.07292352 304.50908897 58.73048879 304.4375 67.125 C304.42920166 68.39182617 304.42090332 69.65865234 304.41235352 70.96386719 C303.91160972 98.99839196 293.40227732 122.09610956 275 143 C274.46246094 143.62132812 273.92492187 144.24265625 273.37109375 144.8828125 C267.77715888 150.91136386 260.73661051 155.35631703 254 160 C255.70019502 165.47840617 257.69176844 170.68368936 260 175.9375 C263.94148069 185.04973506 266.24675418 193.46708373 267.5703125 203.3125 C267.85597929 205.96228694 267.85597929 205.96228694 269 208 C269.160892 210.65048406 269.26074684 213.27262098 269.30859375 215.92578125 C269.3314872 217.13585594 269.3314872 217.13585594 269.35484314 218.37037659 C269.66712125 238.73919981 268.57521108 257.28044963 263 277 C262.73848145 277.92506348 262.47696289 278.85012695 262.20751953 279.80322266 C259.92394946 287.62033856 257.27234796 295.23116433 253.38671875 302.4140625 C251.96772966 305.06017737 250.6931181 307.75997488 249.40966797 310.47363281 C240.30663121 329.44781793 227.43139209 345.81004675 213 361 C212.49307617 361.53560547 211.98615234 362.07121094 211.46386719 362.62304688 C203.56470623 370.91149898 195.25247813 378.25580087 186 385 C185.17072998 385.61174072 185.17072998 385.61174072 184.32470703 386.23583984 C168.99401737 397.41118857 151.56908392 405.97745381 134 413 C134 412.01 134 411.02 134 410 C134.66 410 135.32 410 136 410 C136.23332031 409.47019531 136.46664062 408.94039062 136.70703125 408.39453125 C138.0577007 405.8931404 139.6652286 403.69826076 141.37646484 401.43334961 C158.14627697 379.10170593 163.00961524 352.93614845 159.68359375 325.37841797 C158.89605877 321.08233819 157.57937974 317.06274656 156 313 C155.649375 312.01257813 155.29875 311.02515625 154.9375 310.0078125 C149.88943623 296.79170111 142.56650282 284.41377763 133 274 C132.56349121 273.52111328 132.12698242 273.04222656 131.67724609 272.54882812 C117.86442002 257.56179003 101.01749688 246.31701564 82 239 C82 238.34 82 237.68 82 237 C80.0509375 236.814375 80.0509375 236.814375 78.0625 236.625 C75.84765625 236.4140625 75.84765625 236.4140625 74 236 C73.67 235.34 73.34 234.68 73 234 C83.26414815 233.60690496 92.27680264 235.7393832 102.125 238.375 C102.87716797 238.57182373 103.62933594 238.76864746 104.40429688 238.97143555 C108.92629415 240.21835351 112.94513631 241.83053772 117.0925293 244.01879883 C118.87465676 244.93552355 120.72411338 245.7179095 122.57421875 246.48828125 C126.20988957 248.09261946 129.49807728 250.01722518 132.8125 252.1875 C133.4206958 252.58404785 134.0288916 252.9805957 134.65551758 253.38916016 C157.68073963 268.60577586 174.98043356 290.1484546 182 317 C182.28617188 317.89203125 182.57234375 318.7840625 182.8671875 319.703125 C185.9114754 329.85075135 185.74599564 340.48618412 186 351 C200.5463678 319.1640288 206.86025574 288.42507121 194.69140625 254.42578125 C180.90636893 217.53590905 149.6621111 194.12078631 115 178 C100.94349036 171.87447493 86.59022696 166.51022772 72.125 161.4375 C37.24101277 149.16707355 1.6396674 131.43037267 -15.25 96.75 C-24.41715909 76.81678389 -25.26200063 52.75542094 -18 32 C-17.66097656 30.98679687 -17.32195312 29.97359375 -16.97265625 28.9296875 C-13.10203902 18.59885858 -6.78327899 8.68969074 0 0 Z " fill="#EBEDFB" transform="translate(498,509)"/>
|
|
6
|
+
|
|
7
|
+
<path d="M0 0 C3.04438473 2.85987657 5.66384265 5.7940115 8.1875 9.125 C16.39027982 19.75692921 25.20438754 28.12983826 36 36 C36.55187988 36.41072754 37.10375977 36.82145508 37.67236328 37.24462891 C54.51301296 49.66379527 74.19467519 57.89611371 93.28637695 66.18505859 C106.45704874 71.90961089 118.783232 78.22398678 130.8671875 85.99609375 C133.75956615 87.92362588 133.75956615 87.92362588 136 89 C128.25980254 79.77976478 119.55497607 71.18739692 109.1875 64.9375 C108.135625 64.298125 107.08375 63.65875 106 63 C106 62.34 106 61.68 106 61 C116.18620354 57.21432282 126.3331382 54.30436289 137 52.1875 C138.55545532 51.87776245 138.55545532 51.87776245 140.14233398 51.56176758 C149.68072774 49.74096139 159.0948371 48.85067795 168.80078125 48.7265625 C170.16075478 48.70783836 170.16075478 48.70783836 171.54820251 48.68873596 C192.57786319 48.45533103 212.4717921 48.95951395 233 54 C233.87479004 54.21350098 234.74958008 54.42700195 235.65087891 54.64697266 C245.69144552 57.18548593 256.33337628 60.22225085 265 66 C263.38937849 69.63466459 261.13544336 72.50644358 258.6875 75.625 C254.72564357 80.82653409 251.6309631 86.02414411 249 92 C249.845625 91.071875 250.69125 90.14375 251.5625 89.1875 C265.28388779 75.60250771 283.02424619 66.56709413 300.04296875 57.85498047 C324.95952889 45.08846378 348.96150506 28.36246931 364.36328125 4.51171875 C366 2 366 2 368 0 C372.59489711 9.18979422 369.27852645 26.01601406 366.32421875 35.41796875 C353.38921149 70.40735418 327.78260274 92.57277823 297.17431641 112.56762695 C291.24405657 116.4507487 285.61651354 120.67398596 280 125 C279.21109375 125.59425781 278.4221875 126.18851563 277.609375 126.80078125 C271.78587066 131.22949521 266.33782634 135.99872283 261 141 C260.03835938 141.89589844 259.07671875 142.79179688 258.0859375 143.71484375 C232.07549441 168.49212409 219.44884929 202.29701365 211.72192383 236.71899414 C211.48368896 237.47172607 211.2454541 238.22445801 211 239 C210.34 239.33 209.68 239.66 209 240 C208.73074707 238.92407593 208.73074707 238.92407593 208.45605469 237.82641602 C200.64376796 207.21694266 188.36160922 180.64974609 166 158 C165.1788269 157.14704346 165.1788269 157.14704346 164.34106445 156.27685547 C160.37761491 152.21072589 156.24697357 148.63044884 151.6875 145.25 C150.9958374 144.73687256 150.3041748 144.22374512 149.59155273 143.69506836 C132.25173488 131.03674859 112.95573422 120.58604498 93.29467773 112.02172852 C69.0712492 101.23600148 46.37912358 88.22560432 27 70 C25.98679687 69.10087891 25.98679687 69.10087891 24.953125 68.18359375 C10.1671315 54.49176376 -0.35104347 32.93074933 -1.27734375 12.72265625 C-1.46323822 2.92647645 -1.46323822 2.92647645 0 0 Z " fill="#FBFAFB" transform="translate(460,402)"/>
|
|
8
|
+
|
|
9
|
+
<path d="M0 0 C1.875 0.875 1.875 0.875 3.875 2.875 C6.60776254 4.98468816 6.60776254 4.98468816 9.17578125 5.2890625 C12.5790816 6.02783971 15.06626571 7.4857577 18.0625 9.25 C19.10792969 9.85585938 20.15335938 10.46171875 21.23046875 11.0859375 C23.875 12.875 23.875 12.875 25.875 15.875 C26.30240092 21.17477145 26.39851458 24.62248241 22.875 28.875 C19.94604403 31.23443675 18.12818497 31.84335188 14.375 32.3125 C10.3431503 31.80851879 8.75226072 30.665071 5.875 27.875 C6.11959876 34.7237654 7.98634428 38.99715989 12.875 43.875 C18.49086002 48.01800333 24.15719268 47.59795629 30.875 46.875 C36.86430326 45.18423975 40.36637997 41.88731432 43.875 36.875 C44.93294332 34.90503657 45.95336462 32.91229925 46.875 30.875 C48.15109323 31.78433009 49.42065553 32.70282853 50.6875 33.625 C51.39519531 34.13546875 52.10289062 34.6459375 52.83203125 35.171875 C54.92811445 36.91927897 56.40417272 38.58087946 57.875 40.875 C58.02053967 46.1144282 54.21117973 50.17540199 50.875 53.875 C42.31031368 61.88949234 33.14614765 64.54533875 21.63598633 64.48828125 C14.37582855 64.18466775 8.88524427 61.97978828 2.875 57.875 C1.86566406 57.20791016 1.86566406 57.20791016 0.8359375 56.52734375 C-5.99596581 51.36579565 -11.59625879 42.87677394 -12.8984375 34.3671875 C-12.97320313 33.54476562 -13.04796875 32.72234375 -13.125 31.875 C-13.24101563 30.82570313 -13.35703125 29.77640625 -13.4765625 28.6953125 C-14.10909667 18.17650345 -11.00727114 9.46510971 -4.0234375 1.46875 C-2.125 -0.125 -2.125 -0.125 0 0 Z " fill="#6863F1" transform="translate(559.125,542.125)"/>
|
|
10
|
+
<path d="M0 0 C0.433125 1.134375 0.86625 2.26875 1.3125 3.4375 C1.869375 4.613125 2.42625 5.78875 3 7 C3.99 7.33 4.98 7.66 6 8 C11.4815986 17.60654738 11.23579761 28.35632318 8.4375 38.75 C5.02940146 48.62871919 -0.84094861 55.06446877 -10 60 C-16.25282076 62.98780105 -23.72492091 63.23549084 -30.37890625 61.3125 C-36.182387 58.58679475 -42.93845557 53.74039581 -46 48 C-45.5351624 44.61026123 -44.10543812 42.44727771 -42.0625 39.75 C-41.53785156 39.04359375 -41.01320313 38.3371875 -40.47265625 37.609375 C-39.98667969 37.07828125 -39.50070312 36.5471875 -39 36 C-38.34 36 -37.68 36 -37 36 C-35.67536185 37.6850839 -34.56632247 39.46699122 -33.4140625 41.2734375 C-31.11092418 44.08555666 -28.991481 44.88467668 -25.4140625 45.30078125 C-17.7580752 45.34521635 -17.7580752 45.34521635 -11 42 C-6.51889879 36.27414846 -4.84214073 31.15819616 -4 24 C-4.66 24 -5.32 24 -6 24 C-6.268125 24.61875 -6.53625 25.2375 -6.8125 25.875 C-8 28 -8 28 -11 30 C-15.11136265 30.45681807 -17.26502493 30.45731782 -20.8125 28.25 C-22.85465233 26.14950046 -24.13090389 24.78110754 -25 22 C-24.47578144 15.70937729 -17.47407875 11.80461551 -13 8 C-12.06027344 7.19820312 -11.12054687 6.39640625 -10.15234375 5.5703125 C-3.42237544 0 -3.42237544 0 0 0 Z " fill="#6555E9" transform="translate(750,544)"/>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<path d="M0 0 C3.9016337 1.65006592 6.60953995 3.41430992 9 7 C9.42740092 12.29977145 9.52351458 15.74748241 6 20 C3.07104403 22.35943675 1.25318497 22.96835188 -2.5 23.4375 C-6.5973411 22.92533236 -8.11262703 21.88737297 -11 19 C-13.6816265 14.97756025 -13.68957829 11.72734998 -13 7 C-9.67929422 1.61816649 -6.37478637 -0.73555227 0 0 Z " fill="#F3F4F6" transform="translate(576,551)"/>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<path d="M0 0 C3.41219223 1.30618488 4.52452754 2.70115661 6.31640625 5.88671875 C6.92863293 9.01587734 6.99496845 11.76533263 6.31640625 14.88671875 C3.87890625 17.88671875 3.87890625 17.88671875 1.31640625 19.88671875 C0.98640625 20.21671875 0.65640625 20.54671875 0.31640625 20.88671875 C-3.74577484 21.27731309 -5.98711969 21.32008039 -9.49609375 19.13671875 C-11.53824608 17.03621921 -12.81449764 15.66782629 -13.68359375 12.88671875 C-13.30891181 8.72061244 -10.91744333 6.80647155 -7.93359375 4.07421875 C-7.0725 3.26339844 -6.21140625 2.45257812 -5.32421875 1.6171875 C-2.68359375 -0.11328125 -2.68359375 -0.11328125 0 0 Z " fill="#F0F1F5" transform="translate(738.68359375,553.11328125)"/>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
icon: lucide/package-open
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
|
|
7
|
+
**StudPy** is written in **Python** and is published as a **Python package**.
|
|
8
|
+
|
|
9
|
+
It could be installed with **pip** or with your favorite **package manager**.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Install with pip
|
|
13
|
+
|
|
14
|
+
We recommend to use a Python virtual environment when installing with pip.
|
|
15
|
+
|
|
16
|
+
``` sh
|
|
17
|
+
pip install studpy
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
icon: lucide/file-box
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Getting Started
|
|
6
|
+
|
|
7
|
+
TODO
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
``` py linenums="1"
|
|
15
|
+
from studpy.params import LinearConfig, Param, ParamsSpecs
|
|
16
|
+
|
|
17
|
+
SPECS_LINEAR = ParamsSpecs(
|
|
18
|
+
parameters=[
|
|
19
|
+
Param(
|
|
20
|
+
target="thermodynamic.temperature",
|
|
21
|
+
name="Temperature",
|
|
22
|
+
config=LinearConfig(
|
|
23
|
+
size=3,
|
|
24
|
+
low=0,
|
|
25
|
+
high=6,
|
|
26
|
+
)
|
|
27
|
+
),
|
|
28
|
+
Param(
|
|
29
|
+
target="thermodynamic.pressure",
|
|
30
|
+
name="Pressure",
|
|
31
|
+
config=LinearConfig(
|
|
32
|
+
size=3,
|
|
33
|
+
low=0,
|
|
34
|
+
high=6000,
|
|
35
|
+
)
|
|
36
|
+
),
|
|
37
|
+
]
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
...
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
```
|