wolfhece.scenario.config_manager
Author: HECE - University of Liege, Pierre Archambeau Date: 2024
Copyright (c) 2024 University of Liege. All rights reserved.
This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
Module Contents
- class wolfhece.scenario.config_manager.GPU_2D_file_extensions[source]
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- class wolfhece.scenario.config_manager.IC_scenario[source]
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- class wolfhece.scenario.config_manager.GPU_2D_file[source]
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- class wolfhece.scenario.config_manager.Hydrograph_scenario(fname: pathlib.Path, sep: str = '\t', decimal='.')[source]
Hydrograph for a scenario
- class wolfhece.scenario.config_manager.InitialConditions_scenario(dir: pathlib.Path)[source]
Initial conditions for a scenario
- class wolfhece.scenario.config_manager.Config_Manager_2D_GPU(workingdir: str = '', mapviewer: wolfhece.PyDraw.WolfMapViewer = None, python_venv: pathlib.Path = None)[source]
Gestionnaire de configurations 2D - code GPU
- _scan_dir(wd: pathlib.Path, curdict: dict)[source]
Scan récursif d’un répertoire de base et création de sous-dictionnaires
- scan_wdir()[source]
Récupération de tous les répertoires et sous-répertoires et placement dans le dictionnaire self.configs
- get_header() wolfhece.wolf_array.header_wolf [source]
Get header from .tif file
- _get_header(filearray: pathlib.Path) wolfhece.wolf_array.header_wolf [source]
Get header from .tif file
- check_consistency() str [source]
Check consistency of all files
All numpy files must have the same shape as the tif file in the root directory All hydrographs must have the same number of columns
- _find_files_subdirs(wd: pathlib.Path, curdict: dict, erase_cache: bool = True)[source]
Recherche des fichiers de simulation/scenario dans un répertoire
- _recursive_find_files(wd: pathlib.Path, curdict: dict, erase_cache: bool = True)[source]
Recherche récursive des fichiers de simulation/scenario dans les répertoires dont la structure a été traduite en dictionnaire
- find_files()[source]
Recehrche des fichiers de simulation/scenario dans les répertoires dont la structure a été traduite en dictionnaire
- get_tree(from_path: pathlib.Path) list[pathlib.Path] [source]
Get tree from a path
Fnd all directories from the current path to the working directory
- _select_tif_partname(curdict: dict, tifstr: Literal[bath_, mann_, infil_, roof_])[source]
Select tif files with a ‘str’ as name’s prefix
- create_vec(from_path: pathlib.Path, which: Literal[bath_, mann_, infil_, roof_] = 'bath_') wolfhece.PyVertexvectors.Zones [source]
Create a vec file from a path
- _import_scripts(from_path: pathlib.Path, which) list[types.ModuleType] [source]
List all modules in structure and import them.
As multiple files with a same name can be found in the structure, a copy of the file is made in the same folder with a unique name and then imported.
So, if a file is required in the script, the relative import can be used. If we cache the file in an other folder, the relative import will not work.
After the import, the copied files are deleted.
- _import_scripts_topo_manning_inf_roof(from_path: pathlib.Path) list[types.ModuleType] [source]
import all topo and manning scripts from a path
- _apply_scripts_update_topo_maning_inf_roof(modules: list[types.ModuleType] | pathlib.Path | str, array_bat: wolfhece.wolf_array.WolfArray, array_mann: wolfhece.wolf_array.WolfArray, array_inf: wolfhece.wolf_array.WolfArray, array_roof: wolfhece.wolf_array.WolfArray)[source]
Apply all scripts from a list of modules
- _import_scripts_bc(from_path: pathlib.Path) list[types.ModuleType] [source]
Import all BC’s scripts from a path
- _apply_scripts_bc(modules: list[types.ModuleType] | pathlib.Path | str, sim: wolfgpu.simple_simulation.SimpleSimulation)[source]
Apply all scripts from a list of modules
- load_hydrograph(path: pathlib.Path, toplot=True) tuple[Hydrograph_scenario, matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] [source]
Load hydrograph from a path
- load_ic(path: pathlib.Path) InitialConditions_scenario [source]
Load initial conditions from a path
- get_hydrographs() list[wolfhece.PyHydrographs.Hydrograph] [source]
Get all hydrographs
- get_initial_conditions() list[InitialConditions_scenario] [source]
Get all initial conditions
- class wolfhece.scenario.config_manager.UI_Manager_2D_GPU(data: dict, parent: Config_Manager_2D_GPU)[source]
User Interface for scenario 2D GPU
- create_UI()[source]
Création de l’interface graphique
Partie latérale gauche - arbre des simulations Partie latérale droite - boutons d’actions Partie inférieure - affichage des informations