wolfhece.insyde_be.INBE_func
Imports et bons paths
Module Contents
- wolfhece.insyde_be.INBE_func.original_sys_path = ['D:\\ProgrammationGitLab\\python3.11\\Scripts\\sphinx-build.exe',...[source]
- class wolfhece.insyde_be.INBE_func.INBE_functions[source]
- tree_name_tif(folder_path, name)[source]
Find all .tiff files starting with ‘vuln’ in the directory and return paths
- select_name_tif(path_baseline: pathlib.Path, folder_path: pathlib.Path, name, filter_type=False) tuple[list[pathlib.Path], list[pathlib.Path]] [source]
Collects all .tiff files starting with name from folder_path and appends them to a list. Checks each file’s data type against the baseline raster and renames files with a mismatched type, (allowing it not to be surimposed as it does not begin by “vuln_” anymore).
- Parameters:
path_baseline (pathlib.Path) – Path to the baseline raster file.
folder_path (pathlib.Path) – Path to the folder containing raster files to check.
name (str) – Prefix name to filter .tiff files in the folder.
- Returns:
A tuple containing two lists: - files: List of paths with matching data type. - unused_files: List of paths renamed due to type mismatch.
- Return type:
tuple[list[pathlib.Path], list[pathlib.Path]]
- translate_vrt2tif(fn_VRT, fn_vuln_s)[source]
Translate vrt from OUTPUT > … > Scenario to tif saved in the same folder, and delete the vrt file
- create_table_wolfsimu_INTERPWD(manager_inbe, simu, operator_wd: str, ZonesX: wolfhece.PyVertexvectors.Zones, Zones_v: wolfhece.PyVertexvectors.Zones = None, percentil: float = None, title: str = 'table_wolfsimu.xlsx')[source]
Creates the minimum inputs needed for INBE based on the simulations. One table per simulations.
- pre_processing_auto(Ti_list, main_dir, Study_area, scenario, multiple, dx, percentil=None, operator_wd='mean', hazard='both')[source]
- computation_combined_damage(pond: dict, manager_inbe) pandas.DataFrame [source]
! Première version assez basique
Compute the weighted sum of damage results across multiple return‑period DataFrames.
- Parameters:
df_results_Ti (dict) – Dictionary mapping return‑period keys (e.g. “T2”, “T5”, …) to pandas DataFrames. Each DataFrame must have a “code” column identifying each building and one or more numeric columns representing damage categories.
pond (dict) – Dictionary mapping the same return‑period keys to their weighting coefficients (e.g. {“T2”: 0.65, “T5”: 0.216667, …}).
- Returns:
A DataFrame with one row per unique building “code” (coordinate of the center of the polygon), containing the column “code” plus each damage category column equal to the weighted sum across all Ti.
- Return type:
pd.DataFrame
- plot_damage(df_results, idx=None, cat=None, sorted_cond=None)[source]
Displays a damage bar chart for a specific index (specific building) or for all entries, and for all damage categories or only one.
- Parameters:
df_results (pd.DataFrame) – DataFrame containing damage computed by INBE.
idx (int, optional) – Index of a specific row to plot. Defaults to None (every building plotted).
cat (str, optional) – Specific damage category to plot if idx is None (global mode). Defaults to None (every category plotted).
- computation_dfesults_forfolder(manager_inbe, type_computation, Ti_list, inflation)[source]
Process Excel files in the folder INPUT>CSVs matching the pattern ‘table_wolfsimu_T<number>.xlsx’, extracts and sorts the T identifiers numerically, computes results (INBE) for each file using computation_dfresults, and returns a dictionary of results keyed by each T identifier.
- Parameters:
manager_inbe (Any) – Object containing the path to the input CSV scenario folder.
type_computation (Any) – Parameter specifying the type of computation to perform.
inflation (Any) – Inflation parameter used in the computation.
- Returns:
Dictionary with keys as T identifiers (e.g., ‘T2’) and values as computation results.
- Return type:
dict