smashbox 1.0__tar.gz → 1.1__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.
- {smashbox-1.0 → smashbox-1.1}/PKG-INFO +4 -4
- smashbox-1.1/mail_pr/303/251sentation_smashbox.txt +17 -0
- smashbox-1.1/pyproject.toml +27 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/backups/workspace.ini.bak +1 -1
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/workspace.ini +1 -1
- smashbox-1.1/smashbox/mesh.hdf5 +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/model/model.py +11 -5
- {smashbox-1.0 → smashbox-1.1}/smashbox/test.py +53 -57
- {smashbox-1.0 → smashbox-1.1}/smashbox/tools/tools.py +1 -1
- smashbox-1.0/mail_pr/303/251sentation_smashbox.txt +0 -16
- smashbox-1.0/pyproject.toml +0 -27
- {smashbox-1.0 → smashbox-1.1}/LICENSE +0 -0
- {smashbox-1.0 → smashbox-1.1}/README.md +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/backups/codestyle.ini.bak +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/backups/encoding.ini.bak +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/backups/vcs.ini.bak +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/codestyle.ini +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/defaults/defaults-codestyle-0.2.0.ini +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/defaults/defaults-encoding-0.2.0.ini +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/defaults/defaults-vcs-0.2.0.ini +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/defaults/defaults-workspace-0.2.0.ini +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/encoding.ini +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/vcs.ini +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/__init__.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/flwdir/flowdir_fr_1000m.tif +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/outlets/.Rhistory +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/outlets/db_bnbv_fr.csv +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/outlets/db_bnbv_light.csv +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/outlets/db_sites.csv +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/outlets/db_stations.csv +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/outlets/db_stations_example.csv +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/outlets/edit_database.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/outlets/readme.txt +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/params/ci.tif +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/params/cp.tif +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/params/ct.tif +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/params/kexc.tif +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/params/kmlt.tif +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/params/llr.tif +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/setup/setup_rhax_gr4_dt3600.yaml +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/setup/setup_rhax_gr4_dt900.yaml +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/setup/setup_rhax_gr5_dt3600.yaml +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/asset/setup/setup_rhax_gr5_dt900.yaml +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/init/README.md +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/init/__init__.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/init/multimodel_statistics.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/init/param.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/init/smashbox.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/model/__init__.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/model/atmos_data_connector.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/model/mesh.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/model/setup.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/plot/__init__.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/plot/myplot.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/plot/plot.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/read_inputdata/__init__.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/read_inputdata/read_data.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/read_inputdata/smashmodel.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/stats/__init__.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/stats/mystats.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/stats/stats.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/test_average_stats.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/test_mesh.r +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/test_mesh_from_graffas.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tools/__init__.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tools/geo_toolbox.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorial_R.r +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorial_R_graffas.r +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorial_R_graffas_local.r +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorial_python.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorial_readme.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorial_report.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorials/Python_tutorial.md +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorials/R_Graffas_tutorial.md +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorials/R_tutorial.md +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorials/__init__.py +0 -0
- {smashbox-1.0 → smashbox-1.1}/smashbox/tutorials/generate_doc.md +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: smashbox
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: A python library developed by Hydris-hydrologie (https://www.hydris-hydrologie.fr/) to provide an technical environment for performing hydrological simulation with Smash. This library is preloaded with data (France only), comes with preconfigured setup, own some extra features such as the in-memory atmospheric data connector, has statistical and plot capabilities. Plot and stats functions can be used as a separate module with your own Smash model object.
|
|
5
|
-
Project-URL: Homepage, https://codeberg.org/maximejay/
|
|
6
|
-
Project-URL: Issues, https://codeberg.org/maximejay/
|
|
3
|
+
Version: 1.1
|
|
4
|
+
Summary: A python library developed by Hydris-hydrologie (https://www.hydris-hydrologie.fr/) and INRAE to provide an technical environment for performing hydrological simulation with Smash. This library is preloaded with data (France only), comes with preconfigured setup, own some extra features such as the in-memory atmospheric data connector, has statistical and plot capabilities. Plot and stats functions can be used as a separate module with your own Smash model object.
|
|
5
|
+
Project-URL: Homepage, https://codeberg.org/maximejay/smashbox
|
|
6
|
+
Project-URL: Issues, https://codeberg.org/maximejay/smashbox/issues
|
|
7
7
|
Author-email: Maxime Jay-Allemand <maxime.jay.allemand@hydris-hydrologie.fr>
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Keywords: hydro-smash,plot,smash,statistics
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Bonjour,
|
|
2
|
+
|
|
3
|
+
Je vous présente la librairie Python "SmashBox" (anciennement "EasySmash", présentée à la dernière réunion d'équipe). L'objectif de SmashBox est de fournir un environnement de travail simplifié pour Smash afin de gérer des pré et post traitements (maillage, calculs de statistiques et réalisation de graphique). Smashbox intègre des données prêtes à l’emploi (base de données d'exutoires, direction d'écoulement 1km², paramètres issus de la régionalisation nationale de Julie 2025) et des setup pré-configurés pour fonctionner sur les serveurs Rhax.
|
|
4
|
+
L'idée derrière ce module, est de simplifier certaines opérations courantes réalisées avec Smash (telle que les REX), fournir des interfaces vers d'autres outils de calcul (SCHYPRE-Graffas) et de mutualiser progressivement les outils de post-traitements (graphiques, statistiques, etc...).
|
|
5
|
+
|
|
6
|
+
La librairie s'installe facilement via Pypi (https://pypi.org/project/smashbox/) par la commande :
|
|
7
|
+
pip install smashbox
|
|
8
|
+
|
|
9
|
+
Remarque importante pour les testeurs : Smashbox fonctionne avec la future version de SMASH 1.2 (qui n'est pas encore sortie). En attendant cette version, vous devez donc installer SMASH manuellement dans votre environnement Python en repartant de la branche "main" : https://github.com/DassHydro/smash.git
|
|
10
|
+
|
|
11
|
+
Le code est disponible ici: https://codeberg.org/maximejay/smashbox et la documentation complète en ligne est là: https://maximejay.codeberg.page/smashbox.html
|
|
12
|
+
|
|
13
|
+
Les contributions, rapport de bug, idées, tests en tout genre sont les bienvenus :) Je vous laisse découvrir l'outil via la documentation. Il y a une petite rubrique "tutorial" un peu cachée tout en bas à gauche dans le sommaire qui pourrait vous servir. N'hésitez pas à me contacter si vous souhaitez tester cette librairie et si vous avez des questions !
|
|
14
|
+
|
|
15
|
+
A bientôt
|
|
16
|
+
|
|
17
|
+
Maxime
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling >= 1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "smashbox"
|
|
7
|
+
version = "1.1"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Maxime Jay-Allemand", email="maxime.jay.allemand@hydris-hydrologie.fr" },
|
|
10
|
+
]
|
|
11
|
+
dependencies = [
|
|
12
|
+
"pyhdf5_handler",
|
|
13
|
+
"hydro-smash",
|
|
14
|
+
"matplotlib",
|
|
15
|
+
"mpld3",
|
|
16
|
+
"pdoc",
|
|
17
|
+
"rich",
|
|
18
|
+
"pyhdf5_handler",
|
|
19
|
+
]
|
|
20
|
+
description = "A python library developed by Hydris-hydrologie (https://www.hydris-hydrologie.fr/) and INRAE to provide an technical environment for performing hydrological simulation with Smash. This library is preloaded with data (France only), comes with preconfigured setup, own some extra features such as the in-memory atmospheric data connector, has statistical and plot capabilities. Plot and stats functions can be used as a separate module with your own Smash model object."
|
|
21
|
+
readme = "README.md"
|
|
22
|
+
license-files = ["LICEN[CS]E*"]
|
|
23
|
+
keywords = ["hydro-smash", "smash", "statistics", "plot"]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://codeberg.org/maximejay/smashbox"
|
|
27
|
+
Issues = "https://codeberg.org/maximejay/smashbox/issues"
|
|
@@ -4,7 +4,7 @@ save_data_on_exit = True
|
|
|
4
4
|
save_history = True
|
|
5
5
|
save_non_project_files = False
|
|
6
6
|
project_type = 'empty-project-type'
|
|
7
|
-
recent_files = ['tutorial_report.py', 'init/smashbox.py', 'model/model.py', 'stats/mystats.py', 'init/multimodel_statistics.py', 'stats/stats.py', 'init/param.py', 'test.py', 'test_average_stats.py', 'test_mesh.r', 'test_mesh_from_graffas.py', 'init/__init__.py', 'plot/plot.py']
|
|
7
|
+
recent_files = ['tutorial_report.py', 'init/smashbox.py', 'model/model.py', 'stats/mystats.py', 'init/multimodel_statistics.py', 'stats/stats.py', 'init/param.py', 'test.py', 'test_average_stats.py', 'test_mesh.r', 'test_mesh_from_graffas.py', 'init/__init__.py', 'plot/plot.py', 'tutorial_python.py']
|
|
8
8
|
|
|
9
9
|
[main]
|
|
10
10
|
version = 0.2.0
|
|
@@ -4,7 +4,7 @@ save_data_on_exit = True
|
|
|
4
4
|
save_history = True
|
|
5
5
|
save_non_project_files = False
|
|
6
6
|
project_type = 'empty-project-type'
|
|
7
|
-
recent_files = ['tutorial_report.py', 'init/smashbox.py', 'model/model.py', 'stats/mystats.py', 'init/multimodel_statistics.py', 'stats/stats.py', 'init/param.py', 'test.py', 'test_average_stats.py', 'test_mesh.r', 'test_mesh_from_graffas.py', 'init/__init__.py', 'plot/plot.py']
|
|
7
|
+
recent_files = ['tutorial_report.py', 'init/smashbox.py', 'model/model.py', 'stats/mystats.py', 'init/multimodel_statistics.py', 'stats/stats.py', 'init/param.py', 'test.py', 'test_average_stats.py', 'test_mesh.r', 'test_mesh_from_graffas.py', 'init/__init__.py', 'plot/plot.py', 'tutorial_python.py', 'tools/tools.py', 'model/mesh.py']
|
|
8
8
|
|
|
9
9
|
[main]
|
|
10
10
|
version = 0.2.0
|
|
Binary file
|
|
@@ -393,7 +393,13 @@ class model:
|
|
|
393
393
|
o_setup["read_prcp"] = True
|
|
394
394
|
o_setup["read_pet"] = True
|
|
395
395
|
|
|
396
|
-
self
|
|
396
|
+
# ~ if hasattr(self, "optimize_model") and self.optimize_model is not None:
|
|
397
|
+
# ~ previous_optimized_model_rr_parameters = self.optimize_model.rr_parameters.copy()
|
|
398
|
+
|
|
399
|
+
if not hasattr(self, "optimize_model") or self.optimize_model is None:
|
|
400
|
+
self.optimize_model = self._model(setup=o_setup, mesh=self.mymesh.mesh)
|
|
401
|
+
print(f"</> Getting parameters the default model `mysmashmodel` ...")
|
|
402
|
+
self.optimize_model.rr_parameters = self.mysmashmodel.rr_parameters.copy()
|
|
397
403
|
|
|
398
404
|
default_cost_option = {"end_warmup": o_setup["start_time"], "gauge": "all"}
|
|
399
405
|
if cost_options is not None:
|
|
@@ -662,7 +668,7 @@ class model:
|
|
|
662
668
|
def import_parameters(self, model=None):
|
|
663
669
|
"""
|
|
664
670
|
Import Geotiff parameter in Smash. This function wrap
|
|
665
|
-
smash.io.
|
|
671
|
+
smash.io.read_grid_parameters(). Path to the parameters is defined in
|
|
666
672
|
self._myparam.param.smash_parameters.
|
|
667
673
|
|
|
668
674
|
Parameter
|
|
@@ -691,15 +697,15 @@ class model:
|
|
|
691
697
|
if model is None:
|
|
692
698
|
model = self.mysmashmodel
|
|
693
699
|
|
|
694
|
-
smash.io.
|
|
700
|
+
smash.io.read_grid_parameters(
|
|
695
701
|
model=model,
|
|
696
|
-
|
|
702
|
+
path=self._myparam.param.smash_parameters,
|
|
697
703
|
)
|
|
698
704
|
|
|
699
705
|
def export_parameters(self, path: os.PathLike = "./output_smash_param"):
|
|
700
706
|
"""
|
|
701
707
|
Export Geotiff Smash parameter as Geotiff. This function wrap
|
|
702
|
-
smash.io.
|
|
708
|
+
smash.io.save_grid_parameters().
|
|
703
709
|
|
|
704
710
|
Parameters
|
|
705
711
|
----------
|
|
@@ -4,20 +4,20 @@ if __name__ == "__main__":
|
|
|
4
4
|
|
|
5
5
|
from smashbox import tools
|
|
6
6
|
|
|
7
|
-
@tools.tools.autocast_args
|
|
8
|
-
def test(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
):
|
|
7
|
+
# @tools.tools.autocast_args
|
|
8
|
+
# def test(
|
|
9
|
+
# a: int | None = None,
|
|
10
|
+
# b: None | int = None,
|
|
11
|
+
# c: int | None = 1,
|
|
12
|
+
# d: int = 2,
|
|
13
|
+
# e: None = None,
|
|
14
|
+
# f: None | dict | tuple = None,
|
|
15
|
+
# g=1,
|
|
16
|
+
# ):
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
# print(a, b, c, d, e)
|
|
19
19
|
|
|
20
|
-
test(a=1.0, b=1.0, c=1.0, d=1.0, e=None, f=(2,), g=2)
|
|
20
|
+
# test(a=1.0, b=1.0, c=1.0, d=1.0, e=None, f=(2,), g=2)
|
|
21
21
|
|
|
22
22
|
# Main object creation
|
|
23
23
|
sb = smashbox.SmashBox()
|
|
@@ -29,20 +29,12 @@ if __name__ == "__main__":
|
|
|
29
29
|
"outlets_database",
|
|
30
30
|
"/home/maxime/DEV/smashbox/smashbox/asset/outlets/db_stations_example.csv",
|
|
31
31
|
)
|
|
32
|
-
|
|
33
|
-
sb.myparam.set_param(
|
|
34
|
-
"outlets_database_fields",
|
|
35
|
-
{"coord_x": "X_L93", "coord_y": "Y_L93", "area": "SURF", "id": "ID_HYDRO"},
|
|
36
|
-
) # change/update/set the value of the parameter 'outlets_database_fields'.
|
|
32
|
+
sb.myparam.set_param("outletsID", ["Y4604020"])
|
|
37
33
|
|
|
38
34
|
sb.myparam.set_param(
|
|
39
35
|
"smash_parameters", "/home/maxime/DEV/smashbox/smashbox/asset/params"
|
|
40
36
|
) # change the value of myparam used byRealCollobrier
|
|
41
37
|
|
|
42
|
-
# Read/write param
|
|
43
|
-
# sb.myparam.write_param("param.yaml") #write smashbox param
|
|
44
|
-
sb.myparam.load_param("param.yaml") # load smashbox param
|
|
45
|
-
|
|
46
38
|
# New model creation
|
|
47
39
|
sb.newmodel(
|
|
48
40
|
"RealCollobrier"
|
|
@@ -50,58 +42,62 @@ if __name__ == "__main__":
|
|
|
50
42
|
|
|
51
43
|
# create an second model with different parameters
|
|
52
44
|
sb.myparam.param.setup_file = "setup_rhax_gr5_dt3600.yaml"
|
|
53
|
-
sb.myparam.set_param(
|
|
54
|
-
"outlets_database_fields",
|
|
55
|
-
{"coord_x": "X", "coord_y": "Y", "area": "area", "id": "Nom"},
|
|
56
|
-
) # change/update/set the value of the parameter 'outlets_database_fields'.
|
|
57
|
-
sb.newmodel(
|
|
58
|
-
"Lez"
|
|
59
|
-
) # create a new model named RealCollobrier and copy the previous parameters used for mymodel1 (default behaviour, but it can turned off)
|
|
60
|
-
|
|
61
|
-
# Remove a model
|
|
62
|
-
sb.delmodel("Lez")
|
|
63
45
|
|
|
64
46
|
# Param associated to the model (hidden) has been copied
|
|
65
47
|
sb.RealCollobrier._myparam.list_param() # Notice that myparam is also stored in each model object. So you can access to the model param inside the model attribute.
|
|
66
|
-
sb.RealCollobrier._myparam.param.epsg
|
|
67
48
|
|
|
68
49
|
# Setup utilities
|
|
69
50
|
sb.RealCollobrier.mysetup.setup # print the setup to the screen
|
|
70
|
-
# sb.RealCollobrier.mysetup.write_setup("setup.yaml") #Write the Smash setup
|
|
71
|
-
sb.RealCollobrier.mysetup.load_setup("setup.yaml") # Read a custom Smash setup
|
|
72
51
|
sb.RealCollobrier.mysetup.update_setup(
|
|
73
52
|
{
|
|
74
53
|
"hydrological_module": "gr4",
|
|
75
|
-
"end_time": "2014-
|
|
54
|
+
"end_time": "2014-02-01 12:00",
|
|
76
55
|
"start_time": "2014-01-01 01:00",
|
|
77
56
|
"pet_directory": "/home/maxime/DATA/ETP-SFR-FRA-INTERA_L93",
|
|
78
57
|
"prcp_directory": "/home/maxime/DATA/PLUIE",
|
|
79
|
-
"qobs_directory": "/home/maxime/DATA/
|
|
58
|
+
"qobs_directory": "/home/maxime/DATA/QOBS_60min",
|
|
80
59
|
}
|
|
81
60
|
) # Change value of the Smash setup
|
|
82
61
|
sb.RealCollobrier.mysetup.setup # print the setup to the screen
|
|
83
62
|
|
|
84
|
-
#
|
|
85
|
-
|
|
86
|
-
sb.RealCollobrier.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
sb.RealCollobrier.
|
|
90
|
-
sb.RealCollobrier.
|
|
91
|
-
sb.RealCollobrier.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
63
|
+
sb.RealCollobrier.generate_mesh() # direct method to build the mesh (recommended)
|
|
64
|
+
|
|
65
|
+
sb.RealCollobrier.model()
|
|
66
|
+
|
|
67
|
+
sb.RealCollobrier.mysmashmodel.set_rr_parameters("cp", 500.0)
|
|
68
|
+
sb.RealCollobrier.mysmashmodel.set_rr_parameters("ct", 200.0)
|
|
69
|
+
sb.RealCollobrier.mysmashmodel.set_rr_parameters("llr", 50.0)
|
|
70
|
+
sb.RealCollobrier.mysmashmodel.set_rr_parameters("kexc", 0.0)
|
|
71
|
+
|
|
72
|
+
sb.RealCollobrier.optimize(
|
|
73
|
+
cost_options={"end_warmup": "2014-01-10 01:00", "gauge": "all"},
|
|
74
|
+
mapping="uniform",
|
|
75
|
+
optimizer="sbs",
|
|
76
|
+
optimize_options={
|
|
77
|
+
"bounds": {
|
|
78
|
+
"cp": [1, 1000],
|
|
79
|
+
"ct": [1, 1000],
|
|
80
|
+
"kexc": [-50, 50],
|
|
81
|
+
"llr": [1, 1000],
|
|
82
|
+
},
|
|
83
|
+
"termination_crit": {"maxiter": 10},
|
|
84
|
+
},
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
sb.RealCollobrier.optimize(
|
|
88
|
+
cost_options={"end_warmup": "2014-01-10 01:00", "gauge": "all"},
|
|
89
|
+
mapping="distributed",
|
|
90
|
+
optimizer="lbfgsb",
|
|
91
|
+
optimize_options={
|
|
92
|
+
"bounds": {
|
|
93
|
+
"cp": [1, 1000],
|
|
94
|
+
"ct": [1, 1000],
|
|
95
|
+
"kexc": [-50, 50],
|
|
96
|
+
"llr": [1, 1000],
|
|
97
|
+
},
|
|
98
|
+
"termination_crit": {"maxiter": 10},
|
|
99
|
+
},
|
|
100
|
+
)
|
|
105
101
|
|
|
106
102
|
# Stat utilities
|
|
107
103
|
|
|
@@ -230,7 +230,7 @@ def check_asset_path(asset_dir: str = "", path: None | os.PathLike = None):
|
|
|
230
230
|
if len(matched_file) == 0:
|
|
231
231
|
raise ValueError(
|
|
232
232
|
f"'{path}' is not a valid {asset_dir} filename."
|
|
233
|
-
"Choice are: {os.listdir(mypath)}"
|
|
233
|
+
f"Choice are: {os.listdir(mypath)}"
|
|
234
234
|
)
|
|
235
235
|
else:
|
|
236
236
|
path = matched_file[0]
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Bonjour,
|
|
2
|
-
|
|
3
|
-
Je vous présente la librairie Python "SmashBox" (anciennement "EasySmash", présenté à la dernière réunion d'équipe). L'objectif de SmashBox est de fournir un environnement de travail simplifié pour Smash afin de gérer des pré et post traitements (maillage, calculs de statistique et réalisation de graphique). Smashbox intègre des données prêtes à l’emploi (base de données d'exutoires, direction d'écoulement 1km², paramètres issus de la régio nationale de Julie) et des setup pré-configurés pour fonctionner sur les serveurs Rhax.
|
|
4
|
-
L'idée derrière ce module, est de simplifier certaines opérations courantes réalisées avec Smash (telle que les REX), fournir des interface vers d'autres outils de calcul (SCHYPRE-Graffas) et de mutualiser progressivement les outils de post-traitements (graphiques, statistiques, etc...).
|
|
5
|
-
|
|
6
|
-
Le code est disponible ici: https://codeberg.org/maximejay/smashbox et la documentation est là: https://maximejay.codeberg.page/smashbox.html
|
|
7
|
-
|
|
8
|
-
Les contributions, rapport de bug, idées, tests en tout genre sont les bienvenus :) Je vous laisse découvrir l'outil via la documentation. Il y a une petite rubrique "tutorial" un peu caché tout en bas à gauche dans le sommaire qui pourrait vous servir. N'hésitez pas à me contacter si vous souhaitez tester cette librairie et si vous avez des questions !
|
|
9
|
-
|
|
10
|
-
A bientôt
|
|
11
|
-
|
|
12
|
-
Maxime
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
smashbox-1.0/pyproject.toml
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["hatchling >= 1.26"]
|
|
3
|
-
build-backend = "hatchling.build"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "smashbox"
|
|
7
|
-
version = "1.0"
|
|
8
|
-
authors = [
|
|
9
|
-
{ name="Maxime Jay-Allemand", email="maxime.jay.allemand@hydris-hydrologie.fr" },
|
|
10
|
-
]
|
|
11
|
-
dependencies = [
|
|
12
|
-
"pyhdf5_handler",
|
|
13
|
-
"hydro-smash",
|
|
14
|
-
"matplotlib",
|
|
15
|
-
"mpld3",
|
|
16
|
-
"pdoc",
|
|
17
|
-
"rich",
|
|
18
|
-
"pyhdf5_handler",
|
|
19
|
-
]
|
|
20
|
-
description = "A python library developed by Hydris-hydrologie (https://www.hydris-hydrologie.fr/) to provide an technical environment for performing hydrological simulation with Smash. This library is preloaded with data (France only), comes with preconfigured setup, own some extra features such as the in-memory atmospheric data connector, has statistical and plot capabilities. Plot and stats functions can be used as a separate module with your own Smash model object."
|
|
21
|
-
readme = "README.md"
|
|
22
|
-
license-files = ["LICEN[CS]E*"]
|
|
23
|
-
keywords = ["hydro-smash", "smash", "statistics", "plot"]
|
|
24
|
-
|
|
25
|
-
[project.urls]
|
|
26
|
-
Homepage = "https://codeberg.org/maximejay/easysmash"
|
|
27
|
-
Issues = "https://codeberg.org/maximejay/easysmash/issues"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/defaults/defaults-codestyle-0.2.0.ini
RENAMED
|
File without changes
|
{smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/defaults/defaults-encoding-0.2.0.ini
RENAMED
|
File without changes
|
|
File without changes
|
{smashbox-1.0 → smashbox-1.1}/smashbox/.spyproject/config/defaults/defaults-workspace-0.2.0.ini
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|