wolfhece.PyGui

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

wolfhece.PyGui.GEOM_GROUP_NAME[source]
wolfhece.PyGui.MAGN_GROUP_NAME[source]
class wolfhece.PyGui.GenMapManager(*args, **kw)[source]

Bases: wx.Frame

Inheritance diagram of wolfhece.PyGui.GenMapManager

Default class for a Wolf Map Manager.

Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel.

It is not suitable for direct use.

setup_mapviewer(title: str, wolfparent)[source]

Setup of a WolfMapViewer

get_mapviewer() wolfhece.PyDraw.WolfMapViewer[source]

Retourne une instance WolfMapViewer

get_configuration() wolfhece.PyConfig.WolfConfiguration[source]

Retourne la configuration de Wolf

class wolfhece.PyGui.MapManager(*args, **kw)[source]

Bases: GenMapManager

Inheritance diagram of wolfhece.PyGui.MapManager

Default class for a Wolf Map Manager.

Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel.

It is not suitable for direct use.

class wolfhece.PyGui.GPU2DModel(dir: str = '', *args, **kw)[source]

Bases: GenMapManager

Inheritance diagram of wolfhece.PyGui.GPU2DModel

Default class for a Wolf Map Manager.

Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel.

It is not suitable for direct use.

mydir: str[source]
files_results_array: dict[source]
mybed: wolfhece.wolf_array.WolfArray[source]
class wolfhece.PyGui.HydrologyModel(dir: str = '', splash=True, *args, **kw)[source]

Bases: GenMapManager

Inheritance diagram of wolfhece.PyGui.HydrologyModel

Default class for a Wolf Map Manager.

Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel.

It is not suitable for direct use.

mydir: str[source]
mydircharact: str[source]
mydirwhole: str[source]
files_hydrology_array: dict[source]
files_hydrology_vectors: dict[source]
mainparams: wolfhece.PyParams.Wolf_Param[source]
basinparams: wolfhece.PyParams.Wolf_Param[source]
SPWstations: wolfhece.RatingCurve.SPWMIGaugingStations[source]
DCENNstations: wolfhece.RatingCurve.SPWDCENNGaugingStations[source]
mycatchment: wolfhece.hydrology.Catchment.Catchment[source]
myexchanges: wolfhece.hydrology.forcedexchanges.forced_exchanges[source]
class wolfhece.PyGui.Wolf2DPartArrays(sim: wolfhece.mesh2d.wolf2dprev.prev_sim2D, mapviewer: wolfhece.PyDraw.WolfMapViewer)[source]
setup_gui()[source]

Create the GUI

A listbox in the upper part of the window will list the different part arrays.

When a part array is selected, the listbox on the left will list the files associated with the selected part array. The listbox on the right will list the blocks associated with the selected file.

on_toviewer(event)[source]

Add the selected array to the mapviewer

on_list(event)[source]

When a part array is selected

on_list_files(event)[source]

When a file is selected

on_list_blocks(event)[source]
on_addfile(event)[source]

Add a file to the selected part array

on_delfile(event)[source]

Delete the selected file

on_apply(event)[source]
Show()[source]
class wolfhece.PyGui.Wolf2DInfiltration(sim: wolfhece.mesh2d.wolf2dprev.prev_sim2D = None)[source]
property number_of_infiltration[source]
setup_gui()[source]
on_apply(event)[source]
_fillgrid()[source]

Fill the CpGrid

on_adjust(event)[source]

Adjust the number of rows and columns of the CpGrid

on_plus(event)[source]

Add a zone or steps

on_minus(event)[source]

Remove a zone or steps

on_check(event)[source]
on_reload(event)[source]
on_plot(event)[source]
Show()[source]
class wolfhece.PyGui.Wolf2DModel(*args, dir: str = '', **kw)[source]

Bases: GenMapManager

Inheritance diagram of wolfhece.PyGui.Wolf2DModel

Default class for a Wolf Map Manager.

Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel.

It is not suitable for direct use.

property mymnap[source]
property xyzones[source]
property mysuxsuy[source]
property blocfile[source]
property writing_mode[source]
property writing_frequency[source]
property dx_fine[source]
property dy_fine[source]
property scheme_rk[source]
property is_multiblock[source]

Deprecated, use the property from the infiltration object

property nb_blocks[source]

Deprecated, use the property from the infiltration object

mydir: str[source]
sim: wolfhece.mesh2d.wolf2dprev.prev_sim2D[source]
filenamegen: str[source]
SPWstations: wolfhece.RatingCurve.SPWMIGaugingStations[source]
DCENNstations: wolfhece.RatingCurve.SPWDCENNGaugingStations[source]
_dx_block(idx)[source]
_dy_block(idx)[source]
_add_arrays_to_mapviewer(force_reload=False)[source]

Add arrays to the mapviewer

_add_vectors_to_mapviewer()[source]

Add vectors to the mapviewer

mimic_mask(source: wolfhece.wolf_array.WolfArray)[source]

Copy the mask of the source array to all arrays in the model.

show_properties()[source]

Show the properties of the model

_set_bc(e: wx.EVT_BUTTON)[source]

Set the boundary conditions

_set_infiltration(e: wx.EVT_BUTTON)[source]
_set_part_arrays(e: wx.EVT_BUTTON)[source]
add_boundary_condition(i: int, j: int, bc_type: wolfhece.mesh2d.wolf2dprev.BCType_2D, bc_value: float, border: wolfhece.mesh2d.wolf2dprev.Direction)[source]

alias

reset_boundary_conditions()[source]

Reset the boundary conditions

_check_errors(e: wx.EVT_BUTTON)[source]

Check the errors in the model

_write_files(e: wx.EVT_BUTTON)[source]

Write the files to disk

_run(e: wx.EVT_BUTTON)[source]

Run the simulation

_results(e: wx.EVT_BUTTON)[source]

Display the results

_results2ic(e: wx.EVT_BUTTON)[source]

Choose one result as initial conditions

_copy2gpu(e: wx.EVT_BUTTON)[source]

Click on the button to copy to the GPU

_wizard(e: wx.EVT_BUTTON)[source]

Launch the wizard

_mesher(e: wx.EVT_BUTTON)[source]

Call the mesher

_create_arrays(e: wx.EVT_BUTTON)[source]

Create the fine arrays

_add_blocks(e: wx.EVT_BUTTON)[source]

Add blocks to the model

_create_from_vector(e: wx.EVT_BUTTON)[source]

Create a simulation from a vector

_create_from_array(e: wx.EVT_BUTTON)[source]

Create a simulation from an array

_create_from_footprint(e: wx.EVT_BUTTON)[source]

Create a simulation from a footprint

_set_magnetic_grid(e: wx.EVT_BUTTON)[source]

Set the magnetic grid

_choose_fine_resolution(e: wx.EVT_BUTTON)[source]

Choose the fine resolution

_add_block(e: wx.EVT_BUTTON)[source]

Add a block to the model

_remove_block(e: wx.EVT_BUTTON)[source]

Remove a block from the model

_update_structure(e: wx.EVT_BUTTON)[source]

Update the structure of the model

_all_parameters(e: wx.EVT_CHECKBOX)[source]

Show all parameters

_force_update(e: wx.EVT_CHECKBOX)[source]

Force the update

_update_layout()[source]

Update the layout of the frame

_fill_buttons_genblocks()[source]

Fill the buttons for the blocks

_get_togglestates()[source]

Get the toggle states of the buttons

_show_glob_properties()[source]

Show the general properties

_set_default_background()[source]

Set the default background

_set_color_background()[source]

Set the color background

OnToggleGen(e: wx.EVT_TOGGLEBUTTON)[source]

Toggle the global properties

OnToggleBlock(e: wx.EVT_TOGGLEBUTTON)[source]

Toggle the properties of a block

_append_magnetic_grid_to_prop()[source]

Append the magnetic grid to the properties

_append_geometry_block_to_prop(idx: int)[source]

Append the geometry of the block to the properties

_apply_changes(e: wx.EVT_BUTTON)[source]

Apply the changes to the parameters

extend_bed_elevation()[source]

Extension du modèle topographique

extend_freesurface_elevation(selection: list)[source]

Extension des Conditions Initiales

extend_roughness(selection: list)[source]

Extension du frottement

set_type_ic(which: wolfhece.mesh2d.wolf2dprev.Literal[1, 2, 3] = 2, dialog: bool = True)[source]

Définition du type de conditions initiales

replace_external_contour(newvec: wolfhece.mesh2d.wolf2dprev.vector, interior: bool)[source]

Remplacement du contour externe

transfer_ic(vector)[source]

Transfert de conditions initiales

help_files()[source]

Aide sur les fichiers

Deprecated, use the method from the infiltration object

check_infiltration()[source]

Vérification des zones d’infiltration

Deprecated, use the method from the infiltration object

copy2gpu(dirout: str = '')[source]

Copie des matrices pour le code GPU

Deprecated, use the method from the simulation object

write_bloc_file()[source]

Mise à jour du fichier de blocs

get_header_MB(abs=False)[source]

Renvoi d’un header avec les infos multi-blocs

Parameters:

abs (bool) – If True, the header will be absolute, if False, it will be relative

Returns:

header_wolf

get_header(abs=False)[source]

Renvoi d’un header de matrice “fine” non MB

Parameters:

abs (bool) – If True, the header will be absolute, if False, it will be relative

Returns:

header_wolf

read_fine_array(which: str = '')[source]

Lecture d’une matrice fine

Parameters:

which (str) – suffixe du fichier

read_MB_array(which: str = '')[source]

Lecture d’une matrice MB

Parameters:

which (str) – suffixe du fichier

read_fine_nap() wolfhece.mesh2d.wolf2dprev.np.ndarray[source]

Lecture de la matrice nap sur le maillage fin