:py:mod:`wolfhece.pyGui1D` ========================== .. py:module:: wolfhece.pyGui1D .. autoapi-nested-parse:: Author: HECE - University of Liege, Pierre Archambeau, Utashi Ciraane Docile 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 --------------- .. py:class:: Constants Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.pyGui1D.Constants :parts: 1 :private-bases: Constants used by this module. .. py:attribute:: BANK_WIDTH :value: 1 .. py:attribute:: CENTERED_TEXT .. py:attribute:: DPI :value: 60 .. py:attribute:: FRAMESIZE :value: (460, 560) .. py:attribute:: GENERAL_FONTSIZE :value: 'small' .. py:attribute:: GRAVITATION :value: 9.81 .. py:attribute:: GRIDSIZE :value: (280, 540) .. py:attribute:: NULL .. py:attribute:: NUMBER_OF_PAGES :value: 4 .. py:attribute:: POLYGONE_NUMBER :value: 1 .. py:attribute:: PRECISION :value: ':#.20F' .. py:attribute:: SEPARATOR :value: '\t' .. py:attribute:: BATHYMETRY :value: 'Bathymetry' .. py:attribute:: BED_AND_BANKS :value: 'bank and bed' .. py:attribute:: CROSS_SECTIONS :value: 'cross sections' .. py:attribute:: FRICTIONS :value: 'frictions' .. py:attribute:: GUI_ID_BATHYMETRY .. py:attribute:: GUI_ID_BED_AND_BANKS .. py:attribute:: GUI_ID_CROSS_SECTION .. py:attribute:: GUI_ID_FRICTION .. py:attribute:: GUI_ID_LANDMARK .. py:attribute:: LANDMARK :value: 'Landmarks' .. py:attribute:: NAME_PREFIX .. py:attribute:: MAPVIEWER_SELECT_NEAREST_PROFILE :value: 'Select nearest profile' .. py:attribute:: MAPVIEWER_SET_1D_PROFILE :value: 'Set 1D profile' .. py:class:: Titles Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.pyGui1D.Titles :parts: 1 :private-bases: Titles (string names) of buttons, menus, etc, used by this module and seen in the interface. @ the sign _() enclosing strings is required for translation purposes (see .pytranslate). .. py:attribute:: ADD .. py:attribute:: ADD_BATHYMETRY .. py:attribute:: ADD_BED_AND_BANKS .. py:attribute:: ADD_CROSS_SECTIONS .. py:attribute:: ADD_FRICTIONS .. py:attribute:: ADD_LANDMARKS .. py:attribute:: AVAILABLE_DATA .. py:attribute:: BATHYMETRIC_DATA .. py:attribute:: BC_CONDITIONS .. py:attribute:: BC_DISCHARGE_3 .. py:attribute:: BC_DOWNSTREAM .. py:attribute:: BC_FREE_5 .. py:attribute:: BC_FROUDE_4 .. py:attribute:: BC_IMPERVIOUS_99 .. py:attribute:: BC_JUNCTION_100 .. py:attribute:: BC_MOBILE_DAM_127 .. py:attribute:: BC_UPSTREAM .. py:attribute:: BC_VALUE .. py:attribute:: BC_WATER_DEPTH_1 .. py:attribute:: BC_WATER_LEVEL_2 .. py:attribute:: BED_BANKS .. py:attribute:: BETWEEN_PROFILES .. py:attribute:: BRANCH .. py:attribute:: COMPUTATION_DATA .. py:attribute:: COMPUTATION_MODE .. py:attribute:: CROSS_SECTIONS_CATEGORY .. py:attribute:: CROSS_SECTIONS_DATA .. py:attribute:: EPSILON .. py:attribute:: EVOLUTIVE .. py:attribute:: EXECUTABLE .. py:attribute:: FIXED .. py:attribute:: FORCE_VALUE .. py:attribute:: FRICTION_DATA .. py:attribute:: GUI_GRID_BOUNDARY_CONDITIONS .. py:attribute:: HYDROGRAPH_PREPROCESS .. py:attribute:: INFILTRATIONS .. py:attribute:: LANDMARK_DATA :value: 'Landmarks' .. py:attribute:: MAIN :value: 'Main' .. py:attribute:: MAXIMUM .. py:attribute:: MEAN .. py:attribute:: MEDIAN .. py:attribute:: MESSAGE_AGGLOMERATION_FRICTIONS .. py:attribute:: MESSAGE_BUTTON_PARAMETERS .. py:attribute:: MESSAGE_BUTTON_SAVE .. py:attribute:: MESSAGE_COMPUTATION_MODE .. py:attribute:: MESSAGE_DATA .. py:attribute:: MESSAGE_DISCHARGE .. py:attribute:: MESSAGE_EPSILON .. py:attribute:: MESSAGE_EXECUTABLE :value: 'Left double click -> To provide the wolf executable.' .. py:attribute:: MESSAGE_EXTREMITIES .. py:attribute:: MESSAGE_FILE_FORMAT .. py:attribute:: MESSAGE_FORCED_VALUE .. py:attribute:: MESSAGE_HYDROGRAPH_PREPROCESS .. py:attribute:: MESSAGE_MODE_FRICTIONS :value: 'The frictions values are forced or collected from the 2D array of frictions.' .. py:attribute:: MESSAGE_RUN .. py:attribute:: MESSAGE_STEADINESS .. py:attribute:: MESSAGE_WATER_DEPTH .. py:attribute:: MINIMUM .. py:attribute:: NO_PRECOMPUTATION .. py:attribute:: NO_PREPROCESSING .. py:attribute:: PARAMETERS .. py:attribute:: PRECOMPUTATION .. py:attribute:: PREPROCESS_OPTIONS .. py:attribute:: RAISE_EXTREMITIES .. py:attribute:: RUN_SIMULATION .. py:attribute:: SAVE .. py:attribute:: STEADINESS :value: 'Steadiness' .. py:attribute:: STEADY .. py:attribute:: STEPWISE .. py:attribute:: UNDER_PROFILES .. py:attribute:: VERBOSITY .. py:attribute:: WOLF_PARAM_WINDOW .. py:attribute:: WOLFCLI :value: 'Wolfcli' .. py:attribute:: WOLFCLID :value: 'Wolfclid' .. py:attribute:: WX .. py:class:: Colors Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.pyGui1D.Colors :parts: 1 :private-bases: Color names and parameters used in this module. .. py:attribute:: BED :value: 'black' .. py:attribute:: LEFT_BANK :value: 'red' .. py:attribute:: MATPLOTLIB_CYCLE .. py:attribute:: PROPOSED .. py:attribute:: RIGHT_BANK :value: 'blue' .. py:attribute:: TQDM :value: 'cyan' .. py:attribute:: WX :value: 'white' .. py:class:: fileExtensions Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.pyGui1D.fileExtensions :parts: 1 :private-bases: File extensions (end of file name after the dot) used in this module. .. py:attribute:: AINI :value: '.aini' .. py:attribute:: BANKS :value: '.banks' .. py:attribute:: BREADTH :value: '.breadth' .. py:attribute:: CL :value: '.cl' .. py:attribute:: CVG :value: '.cvg' .. py:attribute:: DEPTH :value: '.depth' .. py:attribute:: DIAM :value: '.diam' .. py:attribute:: GTV :value: '.gtv' .. py:attribute:: HELP :value: '.help' .. py:attribute:: HINI :value: '.hini' .. py:attribute:: INF :value: '.inf' .. py:attribute:: INFIL :value: '.infil' .. py:attribute:: LENGHTSVECZ :value: '_lengths.vecz' .. py:attribute:: LENGTHS :value: '.lengths' .. py:attribute:: PARAMETERS :value: '.param' .. py:attribute:: PTV :value: '.ptv' .. py:attribute:: QINI :value: '.qini' .. py:attribute:: ROUGHNESS :value: '.rough' .. py:attribute:: TOP :value: '.top' .. py:attribute:: VECTOR2D :value: '.vec' .. py:attribute:: VECTOR3D :value: '.vecz' .. py:attribute:: WIDTH :value: '' .. py:attribute:: ZINI :value: '.zini' .. py:class:: Page(parent) Bases: :py:obj:`wx.dataview.wx.Panel` .. autoapi-inheritance-diagram:: wolfhece.pyGui1D.Page :parts: 1 :private-bases: A wx.page format used by the different tabs. @ Could be better customized though. It means don't refrain your creativity. .. py:class:: GuiNotebook1D(page_names=[Titles.MAIN.value, Titles.INFILTRATIONS.value, Titles.BC_CONDITIONS.value, Titles.VERBOSITY.value, Titles.PARAMETERS.value], style=wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP, mapviewer=None) Bases: :py:obj:`wx.dataview.wx.Frame` .. autoapi-inheritance-diagram:: wolfhece.pyGui1D.GuiNotebook1D :parts: 1 :private-bases: Notebook frame (GUI in wx) that allow a user to interact with a wolf-1D model. Interaction means: (creation, execution and soon results visualization) of wolf-1D models. .. py:attribute:: array :type: wolfhece.wolf_array.WolfArray .. py:attribute:: cross_section :type: wolfhece.PyCrosssections.crosssections .. py:attribute:: zones :type: wolfhece.PyVertexvectors.Zones .. py:attribute:: page_1 :type: Page .. py:method:: update_cells_name() Update the list of cells name. .. note:: It's basically the list of all cross sections minus the last one. .. py:method:: add_new_page(page: wx.dataview.wx.Panel, name: str, cells_related_page=True) Add a new page to the notebook. :param page: The page panel :type page: wx.Panel :param name: page name to be used across the whole notebook :type name: str :param cells_related_page: The page is visible only when cross sections are sorted, defaults to True :type cells_related_page: bool, optional .. py:method:: update_infiltrations_page() Create or recreate the infiltration page (tab). .. py:method:: update_boundary_conditions_page() Create or recreate the page of boundary conditions. .. py:method:: find_page_number(name: str) -> int Return the page index base on its name. :param name: page name used across the whole notebook. :type name: str :return: the page index :rtype: int .. py:method:: delete_page(name: str) Delete a page based on its name. :param name: page name used across the whole notebook. :type name: str .. py:method:: delete_cells_related_pages() Delete all pages related to the cells name. .. py:method:: reset_cells_related_page_names() Empty the list of pages related to the cells name. .. py:method:: reset_cell_names() Delete the name of cells from the program. .. py:method:: enable_action_select_profile_in_mapviewer() Enable the selection, highlight, and plot of the nearest profile of the user's click (right down) in the mapviewer interface (2D). .. py:method:: enable_action_set_1D_profile_in_mapviewer() Enable the selection, highlight, and plot of a profile in the mapviewer interface if the profile was selected in the notebook. .. py:method:: disable_action_in_mapviewer() Disable every action activated in the mapviewer interface (2D). .. py:method:: setting_active_profile_in_mapviewer() Set the active profile in the notebook as the active profile in the mapviewer. .. py:method:: double_click_methods(event: wx.propgrid.EVT_PG_DOUBLE_CLICK) Select the appropriated method based on its id if the double click event is called in the property grid. :param event: `wx.Event` :type event: pg.EVT_PG_DOUBLE_CLICK .. py:method:: changing_methods(event: wx.propgrid.EVT_PG_CHANGED) Select the appropriated method based on its id if a property has changed event. :param event: `wx.Event` :type event: pg.EVT_PG_CHANGED .. py:method:: tab_changed(event) Bind the right method for locating the selected cell (profile) when the page(tab) has changed. The selection is based on the cell's name displayed on the tree list. :param event: `wx.Event` :type event: `wx.EVT_NOTEBOOK_PAGE_CHANGED` .. py:method:: element_selected_on_infitltration_tree(event: TreeListEvent) Bind the event tree list changed each time the selected cell is changed on the infiltration page. :param event: `EVT_TREELIST_SELECTION_CHANGED` :type event: TreeListEvent .. todo::FIXME Not very clean as method. .. py:method:: element_selected_on_bounds_conditions_tree(event: TreeListEvent) Bind the event tree list changed each time the selected cell is changed on the boundary condition page. :param event: `EVT_TREELIST_SELECTION_CHANGED` :type event: TreeListEvent .. todo:: FIXME Not very clean as method. .. py:method:: get_page_hydrographs() Return the infiltration page (page of hydrographs). :return: infiltration page :rtype: MultigridPage .. py:method:: get_page_boundary_conditions() Return the page of boundary conditions. :return: page of boundary conditions :rtype: Boundary_condition_Page .. py:method:: set_active_profile(profile_name: str) In case the profile_name is in the list of sorted cross sections, that profile is set as the active profile in both the notebook and the mapviewer. Simultaneously, the action `Set 1D profile` in mapviewer is enabled. :param profile_name: name of the chosen profile. :type profile_name: str .. py:method:: add_object(file, id: str) Add the given wolfhece object in both the GUI and mapviewer. :param file: the object to add :type file: every `wolfhece.object` :param id: object name displayed in mapviewer :type id: str :return: a boolean value for checking whether the process succeeded or aborted. :rtype: bool .. py:method:: add_in_WolfMapViewer(file: str, id: str = '') -> int Add a new object in the interface by providing its path. :param file: object's path (computer's path) :type file: str :param id: object name displayed in mapviewer, defaults to '' :type id: str, optional :return: a boolean value for checking whether the process succeeded or aborted. :rtype: int .. py:method:: select_mapviewer_data(data_type: Literal[array, cross_sections, wolfhece.PyVertexvectors.vector]) Return the selected data from the mapviewer. :param data_type: type of the `wolfhece.object` to add but should be among the implemented literals. :type data_type: Literal['array','cross_sections','vector'] :return: _description_ :rtype: `wolfhece.object` .. py:method:: get_object_from_WolfMapViewer(id: str) Get object from the interface (wolf map viewer) based on its id. :param id: object name displayed in mapviewer :type id: str :return: the chosen object :rtype: `wolfhece.object` .. py:method:: add_crossections_from_menu(event: wx.dataview.wx.Event) Add a cross section file using the submenu. :param event: `wx.EVT_MENU :type event: wx.Event .. py:method:: add_bed_and_banks_from_menu(event: wx.dataview.wx.Event) Add bed and banks using the submenu. :param event: `wx.EVT_MENU` :type event: wx.Event .. py:method:: add_bathymetry_from_menu(event: wx.dataview.wx.Event) Add bathymetric array using the submenu. :param event: `wx.EVT_MENU` :type event: wx.Event .. py:method:: add_friction_from_menu(event: wx.dataview.wx.Event) Add friction array using the submenu. :param event: `wx.EVT_MENU` :type event: wx.Event .. py:method:: add_landmark_from_menu(event: wx.dataview.wx.Event) Add land marks from using the submenu. :param event: `wx.EVT_MENU` :type event: wx.Event .. py:method:: add_crossection() Add or change the cross section. .. py:method:: add_bed_and_banks() Add or change the river and bank data. .. py:method:: add_bathymetry() Add or change the bathymetric data. .. py:method:: add_friction() Add or change the friction data. .. py:method:: add_landmark() Add or change the landmarks data. .. py:method:: add_executable() Add the path of the wolf executable which will be used by the GUI. .. py:method:: delete_data(variable_name: str, object_id: str) Delete an object from both the notebook and the interface (mapviewer). :param variable_name: object name used by the notebook :type variable_name: str :param object_id: name displayed in the mapviewer :type object_id: str .. py:method:: remove_from_WolfMapViewer(id: str) Remove an object from the interface (mapviewer) based on its id. :param id: name displayed in the mapviewer :type id: str .. py:method:: delete_crossection(remove_in_mapviewer=True) Delete the cross section from both this GUI and the interface. :param remove_in_mapviewer: remove the object from the mapviewer (this option skips the removal from mapviewer in case of unavailable object in the mapviewer), defaults to True :type remove_in_mapviewer: bool, optional .. py:method:: delete_bed_and_banks(remove_in_mapviewer=True) Delete the bed and banks from both this GUI and the interface. :param remove_in_mapviewer: remove the object from the mapviewer (this option skips the removal from mapviewer in case of unavailable object in the mapviewer), defaults to True :type remove_in_mapviewer: bool, optional .. py:method:: delete_bathymetry(remove_in_mapviewer=True) Delete the bathymetry from both this GUI and the interface. :param remove_in_mapviewer: remove the object from the mapviewer (this option skips the removal from mapviewer in case of unavailable object in the mapviewer), defaults to True :type remove_in_mapviewer: bool, optional .. py:method:: delete_friction(remove_in_mapviewer=True) Delete the friction from both this GUI and the interface. :param remove_in_mapviewer: remove the object from the mapviewer (this option skips the removal from mapviewer in case of unavailable object in the mapviewer), defaults to True :type remove_in_mapviewer: bool, optional .. py:method:: delete_land_mark(remove_in_mapviewer=True) Delete the landmarks from both this GUI and the interface. :param remove_in_mapviewer: remove the object from the mapviewer (this option skips the removal from mapviewer in case of unavailable object in the mapviewer), defaults to True :type remove_in_mapviewer: bool, optional .. py:method:: delete_line_in_txt_file(file_path: str, line_to_delete: str) Delete a specific line (known) in a given text file. :param file_path: computer path to the text file, :type file_path: str :param line_to_delete: line that should be deleted. :type line_to_delete: str .. py:method:: update_data(variable_name: str, new_object_id: str) update (link) to the right data (object) in the interface. :param variable_name: new object's name in this notebook. :type variable_name: str :param new_object_id: new object's name in the mapviewer :type new_object_id: str .. py:method:: correct_parameters(directory='') Correct the content of the parameter files (.param and .param.default created by the fortran executable.) :param directory: computer's path to the directory containing the files, defaults to '' :type directory: str, optional .. py:method:: freeze_commands() Freeze most of the notebook commands to avoid manipulation errors. .. py:method:: freeze_cross_sections_related() Freeze all commands which require the presence of sorted cross sections. .. py:method:: unfreeze_crossections_related() Unfreeze all commands which require the presence of sorted cross sections. .. py:method:: enable_selection_mode_frictions() Enable the selection of a friction mode. .. py:method:: selection_friction_mode_changed() Based on a selected friction mode, enable either the option for agglomeration of friction or for forcing a unique friction value on all profiles. .. py:method:: enable_agglomeration_mode() Enable the agglomeration of frictions from a 2D array. .. py:method:: enable_forced_value() Enable the forcing of a unique friction value on all profiles. .. py:method:: chek_cross_sections() Check the property box of the cross section on the main page. .. py:method:: chek_bed_and_banks() Check the property box of the bed and banks on the main page. .. py:method:: chek_bathymetry() Check the property box of the bathymetry on the main page. .. py:method:: chek_friction() Check the property box of the friction on the main page. .. py:method:: chek_land_mark() Check the property box of the land marks on the main page. .. py:method:: enable_button_parameters() Allow the parameters button usage on the main page. .. py:method:: disable_button_parameters() Block the parameters button usage on the main page .. py:method:: enable_button_save() Allow the button save usage on the main page .. py:method:: disable_button_save() Block the button save usage on the main page .. py:method:: enable_infiltration_preprocess() Allow the choice between continuous hydrographs or a stepwise ones (pre-processed). .. py:method:: enable_initial_discharge() Enable the encoding of the initial disharge value. .. py:method:: disable_infiltration_preprocess() Restrict the choice between continuous hydrographs or a stepwise ones (pre-processed). .. py:method:: lock_executable() Block the manual selection of an executable type. .. py:method:: cross_check_sections() Automatically enable or disable the cross section property check box. .. py:method:: get_boundary_conditions() -> dict Return the dictionnary of boundary conditions. :return: dictionnary of boundary conditions. :rtype: dict .. py:method:: get_hydrographs() -> dict Return the dictionnary of hydrographs. (infiltrations). :return: dictionnary of hydrographs :rtype: dict .. py:method:: get_frictions() Return the friction values. :raises Exception: in case friction values are still missing and wx.exist. :raises Exception: in case friction values are still missing :return: friction values :rtype: `wolfarray` or `int` .. py:method:: get_agglomeration_mode() -> str Return the agglomeration mode of frictions selected on the main page. :return: agglomeration mode of values (mean, median, min, max, etc). :rtype: str .. py:method:: get_roughness_option() -> str Return the selection mode of frictions chosen on the main page. :return: selected mode :rtype: str .. py:method:: get_initial_water_depth() -> float Return the encoded value of the initial water depth. :return: intial water depth :rtype: float .. py:method:: get_initial_discharge() Return the encoded value of the discharge. :return: initial discharge :rtype: `float` or `None` .. py:method:: get_ic_file_format() -> str Return the file format of intial conditions. :return: file format :rtype: str .. py:method:: get_infiltration_preprocess() -> str Return the selected mode in which the infiltrations hydrographs will be preprocessed. :return: preprossing mode (stepwise or continuous) :rtype: str .. py:method:: get_epsilon() -> float Return the margin used to preprocess the infiltrations in case the stepwise option is selected. :return: epsilon (margin) :rtype: float .. py:method:: get_computation_mode() -> str Return the computation mode used by the 1D executable. :return: computation mode (evolutive or fixed) :rtype: _type_ .. py:method:: get_steadiness_mode() -> str Return the steadiness mode which will be used by the executable. :return: steadiness mode (No precomputation, precomputation, and steady) :rtype: str .. py:method:: get_executable() -> str Return the executable type to be used in `.bat` file. :return: excecutable type (currently wolfcli and wolfclid) :rtype: str .. py:method:: get_folder_executable() -> str return the computer path to the folder containing the executable. :return: folder(computer path in full) :rtype: str .. py:method:: get_run_command() -> str Return the status of the run command. whether the simulation should be run or not after its creation. :return: status(yes or no) :rtype: str .. py:method:: get_extrapolation_of_extremities() -> float Return the value encode in the extrapolation of extremities. :return: Value of how far the 2 extremities of each profile should be elevated vertically. :rtype: float .. py:method:: test_required_data() -> bool Test if all the required data are available to create and save a wolf 1D model. :return: True or False :rtype: bool .. py:method:: initialize_param_file() Create the parameters file (`.param ` and `.param.default`) from the wolf executable (`.exe`). This method initialize a `temporary directory` in which it copies the executable and create 2 files `create_simul.txt` and `temporary.bat`. - The create_simul file contains the commands necessary to generate the parameter files from the executable by just passing in the directory; - Whereas, the .bat file contains a command to launch the executable (`.exe`). After running the wolf executable (`.exe`), the param file created, is first corected and then copied in the simulation directory. This file is then read by wolfparam to allow the modification of parameters through the wolfparam window (`wx.notebook`). .. py:method:: initialize_file(directory_path: str, filename: str) -> str Initialize a computer path to a new file. :param directory_path: Path to the folder :type directory_path: str :param filename: filename :type filename: str :return: full computer path to the new file :rtype: str .. py:method:: click_on_parameters(event: wx.dataview.wx.Event) The click on the parameters button launch the process: - to create a simulatin directory (folder) - to initialize the param file - to disable the button parameters while enabling the button save. :param event: wx.EVT_BUTTON :type event: wx.Event .. py:method:: create_simulation_directory() -> str Create and return the simulation directory. :return: computer path to the folder in which the simulation files wil be written. :rtype: str .. py:method:: infiltration_preprocess_changed() Manage the choice of the infiltration preprocessing mode. .. py:method:: close() .. py:method:: quit(event: wx.dataview.wx.Event) Destroy safely this window from the menu. :param event: wx.event :type event: wx.Event .. py:method:: onclose(event: wx.dataview.wx.Event) .. py:method:: get_bathymetry() Return the bathymetry object from the notebook. :return: bathymetry object :rtype: `WolfArray` .. py:method:: button_save_clicked(event: wx.dataview.wx.Event) Gather all the inputs in the notebook and generate a 1D model (simulation). :param event: wx.EVT_BUTTON :type event: wx.Event :raises Exception: In case, the model fails to create the simulation for whatever reasons. .. py:method:: __call_parameters() FIXME outdated no longer used A temporary .param file is created to initialize the panel of parameters. If the panel is closed (destroyed), the information are lost. FIXME wolf_Param should be a panel not a frame. .. py:method:: __click_on_parameters(event: wx.dataview.wx.Event) .. py:method:: __button_save_clicked(event: wx.dataview.wx.Event) Display .. py:method:: __button_save_clicked(event: wx.dataview.wx.Event) Gather all the inputs in the notebook and generate a 1D model (simulation). :param event: wx.EVT_BUTTON :type event: wx.Event :raises Exception: In case, the model fails to create the simulation for whatever reasons. .. py:method:: __add_bed_and_banks(event: wx.propgrid.EVT_PG_DOUBLE_CLICK) Add or change the river and bank data. .. py:method:: __delete_bed_and_banks(event: wx.propgrid.EVT_PG_CHANGED) Delete the bed and banks from both this GUI and the interface. .. py:method:: __add_crossection(event: wx.propgrid.EVT_PG_DOUBLE_CLICK) Add or change the cross section. .. py:method:: __delete_crossection(event: wx.propgrid.EVT_PG_CHANGED) Delete the cross section from both this GUI and the interface. .. py:method:: __create_id(curdict: dict, id: str = None) -> str Dialog box to create the object name - curdict: directory selfmapviewer @ The object name is created at this step and then passed to the wolfpy interface with suffix to clearly distinguish the elements in use. FIXME It would have been nice to have a select ID though. .. py:method:: __add_river_banks(event: wx.propgrid.EVT_PG_SELECTED) .. py:class:: MultigridPage(parent) Bases: :py:obj:`wx.dataview.wx.Panel` .. autoapi-inheritance-diagram:: wolfhece.pyGui1D.MultigridPage :parts: 1 :private-bases: Grid of hydrographs. It's a plug and play panel on a given page. The panel contains a grid which allow the user to encode manually or automatically (upload) the hydrographs (infiltrations) of a 1D model. :param wx: The panel on which the grid is displayed. :type wx: `wx.panel` .. py:method:: tree_profiles(profile_names: list[str], title='Hydrographs', number_of_rows=1, number_of_columns=2) A table containing the daata. :param profile_names: List of profile names :type profile_names: list[str] :param title: The page name that will be displayed to the users, defaults to 'Hydrographs' :type title: str, optional :param number_of_rows: Intializes the numbers of rows (ent), defaults to 1 :type number_of_rows: int, optional :param number_of_columns: the number of columns in the grid (in case of new variables), defaults to 2 :type number_of_columns: int, optional .. todo:: FIXME add a graph plot between the variables and the buttons (to give to the user a visual trend the entries). .. py:method:: get_tree_list_first_item() Set the the first item on the tree list as the curname (current name). .. Note:: FIXME It still does not work properly. .. todo:: FIXME review the whole method. .. py:method:: get_name_of_selected_cell() Get the name of the selected cell. .. Note:: FIXME depreciating. .. py:method:: add_hydrographs_to_dict() Get the users inputs and append them to the page's dictionary as the hydrograph associated to the key of the selected cell. .. py:method:: add_hydrographs_to_dict_wx(event: TreeListEvent) Add the hydrograph to the dictionnary through a wx.Event. :param event: wx.EVT_BUTTON :type event: TreeListEvent .. py:method:: add_row(event: wx.dataview.wx.Event) Adds new row in the table of records (grid) :param event: wx.EVT_BUTTON :type event: wx.Event .. py:method:: load_hydrogaph(event: wx.dataview.wx.Event) Load an hydrograph (list of discharges evolution through time) from a text file on the wolfhece hydrograph format. :param event: wx.EVT_BUTTON :type event: wx.Event .. py:method:: delete_hydrograph_from_dict(event: wx.dataview.wx.Event) Removes the entry saved by the user on the selected cell. :param event: wx.EVT_BUTTON :type event: wx.Event .. py:method:: block_check_item(event: wx.dataview.wx.Event) Controls which item is checked or not based on the mouse operations (events). :param event: EVT_TREELIST_ITEM_CHECKED :type event: wx.Event .. py:method:: on_select_item(event: TreeListEvent) Return the name of the cell selected by the user after, displaying the infiltration informations on the screen. :param event: EVT_TREELIST_SELECTION_CHANGED :type event: TreeListEvent :return: name of the selected item :rtype: str .. py:method:: load_from_Hydrograph(hydrograph: wolfhece.PyHydrographs.Hydrograph) Fills the grid of infiltration from the hydrograph object available from the wolfhece library. :param hydrograph: Hydrrograph on the wolfhece format :type hydrograph: Hydrograph .. py:class:: Boundary_condition_Page(parent) Bases: :py:obj:`wx.dataview.wx.Panel` .. autoapi-inheritance-diagram:: wolfhece.pyGui1D.Boundary_condition_Page :parts: 1 :private-bases: Grid of Boundary conditions. It's a plug and play panel on a given page. The panel contains a grid which allow the user to encode manually or automatically (upload) the boundary conditions of a 1D model. :param wx: _description_ :type wx: _type_ .. note:: FIXME it would have been nice to have unifom format (file) of boundary conditions for all wolf models (1,2 or 3D). In that way, one class can be used to manage all operations regardless of the dimensions (1,2 or 3D). .. py:method:: tree_profiles(profile_names: list[str], title='Boundary conditions', number_of_rows=1, number_of_columns=2) A table containing the data. :param profile_names: List of profile names. :type profile_names: list[str] :param title: The page name that will be displayed to the users, defaults to 'Boundary conditions' :type title: str, optional :param number_of_rows: Intializes the numbers of rows (ent), defaults to 1 :type number_of_rows: int, optional :param number_of_columns: the number of columns in the grid (in case of new variables), defaults to 2 :type number_of_columns: int, optional .. py:method:: get_tree_list_first_item() Set the the first item on the tree list as the curname (current name). .. Note:: FIXME It still does not work properly. .. todo:: FIXME review the whole method. .. py:method:: add_boundary_conditions_to_dict() Get the users inputs and append them to the page's dictionary. In the dictionnary, the boundary conditions are associated to the key of the selected cells. .. py:method:: convert_cell_side_value(value: int) -> str Return the location of the boundary condition on a selected cell (upstream or downstream). :param value: 1 for upstream or 2 for downstream :type value: int :return: `upstream `or `downstream` :rtype: str .. py:method:: convert_type_boundary_condition(value: int) -> str Return the type of boundary condition corresponding to the encoded integer. :param value: _description_ :type value: int :return: _description_ :rtype: str .. py:method:: add_boundary_condition_to_dict_wx(event: TreeListEvent) Add the boundary condition to the dictionnary through a wx.Event. :param event: wx.EVT_BUTTON :type event: TreeListEvent .. py:method:: delete_boundary_condition_from_dict(event: wx.dataview.wx.Event) Removes the entry saved by the user on specified cell. :param event: wx.EVT_BUTTON :type event: wx.Event .. py:method:: block_check_item(event: wx.dataview.wx.Event) Controls which item is checked or not based on the mouse operations (events). :param event: EVT_TREELIST_ITEM_CHECKED :type event: wx.Event .. py:method:: oncheckitem(event: TreeListEvent) Return the name of the cell selected by the user after, displaying the informations regarding the boundary conditions in the grid. :param event: EVT_TREELIST_SELECTION_CHANGED :type event: TreeListEvent :return: name of the selected item :rtype: str .. py:method:: load_from_boundary_conditions(condition: tuple[str, str, float]) Fills the grid of boundary conditions from a tuple containing: - condition[0] : cell side, - condition[1]: type of boundary condition, - condition[2]: Value of boundary condition. :param condition: information about the boundary conditon. :type condition: tuple[str, str, float] .. todo:: - FIXME implement a simple test for protection. .. py:method:: reset_condition() Reset the information displayed in the grid to default values.