diff --git a/.github/workflows/testing_pull_request.yml b/.github/workflows/testing_pull_request.yml index 1fbef999..b938e219 100644 --- a/.github/workflows/testing_pull_request.yml +++ b/.github/workflows/testing_pull_request.yml @@ -6,7 +6,7 @@ on: branches: [ "alpha" ] paths: - 'geoprob_pipe/**' - - 'test_system.py' + - 'tests/**' workflow_dispatch: @@ -30,5 +30,5 @@ jobs: - name: Run tests with coverage run: | - coverage run --source=geoprob_pipe -m pytest --ignore=_deprecated/tests + coverage run --source=geoprob_pipe -m pytest --durations=10 --ignore=_deprecated/tests coverage report -m diff --git a/geoprob_pipe/calculations/systems/build_and_run.py b/geoprob_pipe/calculations/systems/build_and_run.py index 085970c9..8e9def3b 100644 --- a/geoprob_pipe/calculations/systems/build_and_run.py +++ b/geoprob_pipe/calculations/systems/build_and_run.py @@ -1,7 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING, List, Optional -from geoprob_pipe.calculations.systems.mappers.calculations import ( - CALCULATION_MAPPER) +from geoprob_pipe.calculations.systems.mappers.calculations import CALCULATION_MAPPER from multiprocessing import Pool, cpu_count from io import StringIO import sqlite3 diff --git a/geoprob_pipe/calculations/systems/mappers/calculations.py b/geoprob_pipe/calculations/systems/mappers/calculations.py index 3dc9b3b0..6721847d 100644 --- a/geoprob_pipe/calculations/systems/mappers/calculations.py +++ b/geoprob_pipe/calculations/systems/mappers/calculations.py @@ -3,6 +3,7 @@ from geoprob_pipe.calculations.systems.wbi.system_builder import WBISystemBuilder from geoprob_pipe.calculations.limit_states.piping_lm import limit_state_moria from geoprob_pipe.calculations.systems.model4a.limit_state_functions import limit_state_model4a +from geoprob_pipe.calculations.limit_states.piping_lm import limit_state_wbi # TODO: Dynamisch maken? Forceren dat naamgeving overeenkomt en # we dynamisch importeren? @@ -20,6 +21,9 @@ "wbi": { "label": "WBI", "system_builder": WBISystemBuilder, + "system_return_parameter_keys": [ + "z_u", "z_h", "z_p", "z_combin", "h_exit", "phi_exit", "dphi_c_u", "i_exit", "dh_c", "dh_red"], + "limit_state_function": limit_state_wbi, }, "moria": { "label": "MORIA", diff --git a/geoprob_pipe/calculations/systems/model4a/limit_state_functions.py b/geoprob_pipe/calculations/systems/model4a/limit_state_functions.py index bf0686d3..edc63dac 100644 --- a/geoprob_pipe/calculations/systems/model4a/limit_state_functions.py +++ b/geoprob_pipe/calculations/systems/model4a/limit_state_functions.py @@ -1,5 +1,4 @@ -from geoprob_pipe.calculations.limit_states.piping_lm import ( - limit_state_model4a) +from geoprob_pipe.calculations.limit_states.piping_lm import limit_state_model4a # noinspection PyPep8Naming diff --git a/geoprob_pipe/calculations/systems/moria/system_builder.py b/geoprob_pipe/calculations/systems/moria/system_builder.py index c1fe1161..6797f541 100644 --- a/geoprob_pipe/calculations/systems/moria/system_builder.py +++ b/geoprob_pipe/calculations/systems/moria/system_builder.py @@ -1,17 +1,10 @@ from __future__ import annotations -from geoprob_pipe.calculations.systems.moria.reliability_calculation import \ - MORIACalculation +from geoprob_pipe.calculations.systems.moria.reliability_calculation import MORIACalculation from geoprob_pipe.calculations.systems.base_objects.base_system_build import BaseSystemBuilder -# from typing import TYPE_CHECKING -# if TYPE_CHECKING: -# from geoprob_pipe import GeoProbPipe class MoriaSystemBuilder(BaseSystemBuilder): - def __init__(self, - geopackage_filepath: str, - to_run_vakken_ids: list[int]): - super().__init__(geopackage_filepath=geopackage_filepath, - to_run_vakken_ids=to_run_vakken_ids) + def __init__(self, geopackage_filepath: str, to_run_vakken_ids: list[int]): + super().__init__(geopackage_filepath=geopackage_filepath, to_run_vakken_ids=to_run_vakken_ids) self.system_class = MORIACalculation diff --git a/geoprob_pipe/cmd_app/comparisons/__init__.py b/geoprob_pipe/cmd_app/comparisons/__init__.py index 953904e7..be064c91 100644 --- a/geoprob_pipe/cmd_app/comparisons/__init__.py +++ b/geoprob_pipe/cmd_app/comparisons/__init__.py @@ -1,208 +1 @@ -from __future__ import annotations -import sqlite3 -import os -from datetime import datetime -import pandas as pd -import geopandas as gpd -from plotly.graph_objects import Figure as PlotlyFigure -from geoprob_pipe.cmd_app.comparisons.beta_dumbbell import ( - dumbbell_beta, dumbbell_uplift, dumbbell_heave, dumbbell_piping) -from geoprob_pipe.cmd_app.comparisons.beta_map import ( - map_delta_beta_comparison, map_ratio_beta_comparison) - - -class ComparisonCollector: - def __init__(self, - geopackage_filepath_1: str, - geopackage_filepath_2: str, - export_dir: str - ): - """ Class voor het verzamelen van de gegevens voor het uitvoeren van de vergelijking. - - :param geopackage_filepath_1: Locatie van het eerste pakket. - :param geopackage_filepath_2: Locatie van het tweede pakket. - :param export_dir: Uitvoer map. - """ - self.geopackage_filepath_1 = geopackage_filepath_1 - self.geopackage_filepath_2 = geopackage_filepath_2 - self.name_1 = os.path.basename(self.geopackage_filepath_1).replace(".geoprob_pipe.gpkg", "") - self.name_2 = os.path.basename(self.geopackage_filepath_2).replace(".geoprob_pipe.gpkg", "") - - timestamp = datetime.now().strftime("%Y-%m-%d_%H%M") - self.export_dir = os.path.join( - export_dir, f"comparisons/{self.name_1}_{self.name_2}_{timestamp}" - ) - os.makedirs(export_dir, exist_ok=True) - - # Placeholders - self.df1_beta_scenarios: pd.DataFrame - self.df1_beta_limit_states: pd.DataFrame - self.df1_beta_uittredepunten: pd.DataFrame - - self.df2_beta_scenarios: pd.DataFrame - self.df2_beta_limit_states: pd.DataFrame - self.df2_beta_uittredepunten: pd.DataFrame - - self.gdf1_uittredepunten: gpd.GeoDataFrame - self.gdf2_uittredepunten: gpd.GeoDataFrame - - # logic - self._load_result_data_from_geopackage() - self._load_uittredepunten_gdf() - - def _load_result_data_from_geopackage(self): - """Method om de data te verzamelen uit de opgegeven pakketten. - - Raises: - ValueError: Als de `beta_limit_states` tabellen niet hetzelfde - formaat hebben. - ValueError: Als de `beta_scenario` tabellen niet hetzelfde - formaat hebben. - ValueError: Als de `beta_uitredepunten` tabellen niet hetzelfde - formaat hebben. - """ - conn_1 = sqlite3.connect(self.geopackage_filepath_1) - conn_2 = sqlite3.connect(self.geopackage_filepath_2) - - self.df1_beta_limit_states = pd.read_sql( - "SELECT * FROM beta_limit_states;", conn_1 - ) - self.df2_beta_limit_states = pd.read_sql( - "SELECT * FROM beta_limit_states;", conn_2 - ) - if len(self.df1_beta_limit_states) != len(self.df2_beta_limit_states): - raise ValueError("De beta_limit_states tables hebben niet " - "hetzelfde formaat") - - self.df1_beta_scenarios = pd.read_sql( - "SELECT * FROM beta_scenarios_final;", conn_1 - ) - self.df2_beta_scenarios = pd.read_sql( - "SELECT * FROM beta_scenarios_final;", conn_2 - ) - if len(self.df1_beta_scenarios) != len(self.df2_beta_scenarios): - raise ValueError("De beta_scenario tables hebben niet hetzelfde " - "formaat") - - self.df1_beta_uittredepunten = pd.read_sql( - "SELECT * FROM beta_uittredepunten;", conn_1 - ) - self.df2_beta_uittredepunten = pd.read_sql( - "SELECT * FROM beta_uittredepunten;", conn_2 - ) - if len(self.df1_beta_uittredepunten) != len(self.df2_beta_uittredepunten): - raise ValueError("De beta_uittredepunten tables hebben niet " - "hetzelfde formaat") - - conn_1.close() - conn_2.close() - - def _load_uittredepunten_gdf(self): - """Method om de geolocaties te verzamelen uit de pakketten. - - Raises: - ValueError: Als de `beta_uittredepunten` tabellen niet hetzelfde - formaat hebben. - ValueError: Als de geometry van de punten niet hetzelfde formaat - hebben. - """ - self.gdf1_uittredepunten = gpd.read_file( - self.geopackage_filepath_1, - layer="beta_uittredepunten" - ) - self.gdf2_uittredepunten = gpd.read_file( - self.geopackage_filepath_2, - layer="beta_uittredepunten" - ) - if len(self.gdf1_uittredepunten) != len(self.gdf2_uittredepunten): - raise ValueError("De beta_uittredepunten tables hebben niet " - "hetzelfde formaat") - if set(self.gdf1_uittredepunten.geometry) != set(self.gdf2_uittredepunten.geometry): - raise ValueError("De twee sets uittredepunten hebben afwijkende " - "geometry") - - def dumbbell_beta(self, export: bool = False) -> PlotlyFigure: - """Maak een dumbbell plot van de beta waardes van de twee pakketten om - te kunnen vergelijken. Dit is plot voor de gecombineerde beta voor de - uittredepunten. - - Args: - export: Figuur exporteren. Defaults to False. - - Returns: - PlotlyFigure - """ - return dumbbell_beta(self, export) - - def dumbbell_uplift(self, export: bool = False) -> list[PlotlyFigure]: - """Maak een dumbbell plot van de beta waardes van de twee pakketten om - te kunnen vergelijken. Dit is plot voor de uplift limit state beta voor de - uittredepunten. - - Args: - export: Figuur exporteren. Defaults to False. - - Returns: - PlotlyFigure - """ - return dumbbell_uplift(self, export) - - def dumbbell_heave(self, export: bool = False) -> list[PlotlyFigure]: - """Maak een dumbbell plot van de beta waardes van de twee pakketten om - te kunnen vergelijken. Dit is plot voor de heave limit state beta voor de - uittredepunten. - - Args: - export: Figuur exporteren. Defaults to False. - - Returns: - PlotlyFigure - """ - return dumbbell_heave(self, export) - - def dumbbell_piping(self, export: bool = False) -> list[PlotlyFigure]: - """Maak een dumbbell plot van de beta waardes van de twee pakketten om - te kunnen vergelijken. Dit is plot voor de piping limit state beta voor - de uittredepunten. - - Args: - export: Figuur exporteren. Defaults to False. - - Returns: - PlotlyFigure - """ - return dumbbell_piping(self, export) - - def map_delta_beta_comparison(self, export: bool = False) -> PlotlyFigure: - """Maak een overzichtskaart met het absolute verschil tussen de twee - beta waardes van alle uittredepunten. - - Args: - export: Figuur exporteren. Defaults to False. - - Returns: - PlotlyFigure - """ - return map_delta_beta_comparison(self, export) - - def map_ratio_beta_comparison(self, export: bool = False) -> PlotlyFigure: - """Maak een overzichtskaart met het relative verschil tussen de twee - beta waardes van alle uittredepunten. - - Args: - export: Figuur exporteren. Defaults to False. - - Returns: - PlotlyFigure - """ - return map_ratio_beta_comparison(self, export) - - def create_and_export_figures(self): - """Exporteer alle figuren die gemaakt kunnen worden. - """ - dumbbell_beta(self, export=True) - dumbbell_uplift(self, export=True) - dumbbell_heave(self, export=True) - dumbbell_piping(self, export=True) - map_delta_beta_comparison(self, export=True) - map_ratio_beta_comparison(self, export=True) +from geoprob_pipe.cmd_app.comparisons.collector import ComparisonCollector \ No newline at end of file diff --git a/geoprob_pipe/cmd_app/comparisons/beta_dumbbell.py b/geoprob_pipe/cmd_app/comparisons/beta_dumbbell.py index 9b68e93f..f9173c4c 100644 --- a/geoprob_pipe/cmd_app/comparisons/beta_dumbbell.py +++ b/geoprob_pipe/cmd_app/comparisons/beta_dumbbell.py @@ -98,7 +98,7 @@ def _add_traces(comparison: ComparisonCollector, def _add_vak_id(comparison: ComparisonCollector, fig: go.Figure) -> go.Figure: - """Helper functie om de vakken in de dumbell plot te tekenen. + """Helper functie om de vakken in de dumbbell plot te tekenen. Args: comparison: ComparisonCollecter object. diff --git a/geoprob_pipe/cmd_app/comparisons/collector.py b/geoprob_pipe/cmd_app/comparisons/collector.py new file mode 100644 index 00000000..0773815b --- /dev/null +++ b/geoprob_pipe/cmd_app/comparisons/collector.py @@ -0,0 +1,210 @@ +from __future__ import annotations +import sqlite3 +import os +from datetime import datetime +import pandas as pd +import geopandas as gpd +from plotly.graph_objects import Figure as PlotlyFigure +from geoprob_pipe.cmd_app.comparisons.beta_dumbbell import ( + dumbbell_beta, dumbbell_uplift, dumbbell_heave, dumbbell_piping) +from geoprob_pipe.cmd_app.comparisons.beta_map import ( + map_delta_beta_comparison, map_ratio_beta_comparison) + + +class ComparisonCollector: + + def __init__( + self, + geopackage_filepath_1: str, + geopackage_filepath_2: str, + export_dir: str + ): + """ Class voor het verzamelen van de gegevens voor het uitvoeren van de vergelijking. + + :param geopackage_filepath_1: Locatie van het eerste pakket. + :param geopackage_filepath_2: Locatie van het tweede pakket. + :param export_dir: Uitvoer map. + """ + self.geopackage_filepath_1 = geopackage_filepath_1 + self.geopackage_filepath_2 = geopackage_filepath_2 + self.name_1 = os.path.basename(self.geopackage_filepath_1).replace(".geoprob_pipe.gpkg", "") + self.name_2 = os.path.basename(self.geopackage_filepath_2).replace(".geoprob_pipe.gpkg", "") + + timestamp = datetime.now().strftime("%Y-%m-%d_%H%M") + self.export_dir = os.path.join( + export_dir, f"comparisons/{self.name_1}_{self.name_2}_{timestamp}" + ) + os.makedirs(export_dir, exist_ok=True) + + # Placeholders + self.df1_beta_scenarios: pd.DataFrame + self.df1_beta_limit_states: pd.DataFrame + self.df1_beta_uittredepunten: pd.DataFrame + + self.df2_beta_scenarios: pd.DataFrame + self.df2_beta_limit_states: pd.DataFrame + self.df2_beta_uittredepunten: pd.DataFrame + + self.gdf1_uittredepunten: gpd.GeoDataFrame + self.gdf2_uittredepunten: gpd.GeoDataFrame + + # logic + self._load_result_data_from_geopackage() + self._load_uittredepunten_gdf() + + def _load_result_data_from_geopackage(self): + """Method om de data te verzamelen uit de opgegeven pakketten. + + Raises: + ValueError: Als de `beta_limit_states` tabellen niet hetzelfde + formaat hebben. + ValueError: Als de `beta_scenario` tabellen niet hetzelfde + formaat hebben. + ValueError: Als de `beta_uittredepunten` tabellen niet hetzelfde + formaat hebben. + """ + conn_1 = sqlite3.connect(self.geopackage_filepath_1) + conn_2 = sqlite3.connect(self.geopackage_filepath_2) + + self.df1_beta_limit_states = pd.read_sql( + "SELECT * FROM beta_limit_states;", conn_1 + ) + self.df2_beta_limit_states = pd.read_sql( + "SELECT * FROM beta_limit_states;", conn_2 + ) + if len(self.df1_beta_limit_states) != len(self.df2_beta_limit_states): + raise ValueError("De beta_limit_states tables hebben niet " + "hetzelfde formaat") + + self.df1_beta_scenarios = pd.read_sql( + "SELECT * FROM beta_scenarios_final;", conn_1 + ) + self.df2_beta_scenarios = pd.read_sql( + "SELECT * FROM beta_scenarios_final;", conn_2 + ) + if len(self.df1_beta_scenarios) != len(self.df2_beta_scenarios): + raise ValueError("De beta_scenario tables hebben niet hetzelfde " + "formaat") + + self.df1_beta_uittredepunten = pd.read_sql( + "SELECT * FROM beta_uittredepunten;", conn_1 + ) + self.df2_beta_uittredepunten = pd.read_sql( + "SELECT * FROM beta_uittredepunten;", conn_2 + ) + if len(self.df1_beta_uittredepunten) != len(self.df2_beta_uittredepunten): + raise ValueError("De beta_uittredepunten tables hebben niet " + "hetzelfde formaat") + + conn_1.close() + conn_2.close() + + def _load_uittredepunten_gdf(self): + """Method om de geolocaties te verzamelen uit de pakketten. + + Raises: + ValueError: Als de `beta_uittredepunten` tabellen niet hetzelfde + formaat hebben. + ValueError: Als de geometry van de punten niet hetzelfde formaat + hebben. + """ + self.gdf1_uittredepunten = gpd.read_file( + self.geopackage_filepath_1, + layer="beta_uittredepunten" + ) + self.gdf2_uittredepunten = gpd.read_file( + self.geopackage_filepath_2, + layer="beta_uittredepunten" + ) + if len(self.gdf1_uittredepunten) != len(self.gdf2_uittredepunten): + raise ValueError("De beta_uittredepunten tables hebben niet " + "hetzelfde formaat") + if set(self.gdf1_uittredepunten.geometry) != set(self.gdf2_uittredepunten.geometry): + raise ValueError("De twee sets uittredepunten hebben afwijkende " + "geometry") + + def dumbbell_beta(self, export: bool = False) -> PlotlyFigure: + """Maak een dumbbell plot van de beta waardes van de twee pakketten om + te kunnen vergelijken. Dit is plot voor de gecombineerde beta voor de + uittredepunten. + + Args: + export: Figuur exporteren. Defaults to False. + + Returns: + PlotlyFigure + """ + return dumbbell_beta(self, export) + + def dumbbell_uplift(self, export: bool = False) -> list[PlotlyFigure]: + """Maak een dumbbell plot van de beta waardes van de twee pakketten om + te kunnen vergelijken. Dit is plot voor de uplift limit state beta voor de + uittredepunten. + + Args: + export: Figuur exporteren. Defaults to False. + + Returns: + PlotlyFigure + """ + return dumbbell_uplift(self, export) + + def dumbbell_heave(self, export: bool = False) -> list[PlotlyFigure]: + """Maak een dumbbell plot van de beta waardes van de twee pakketten om + te kunnen vergelijken. Dit is plot voor de heave limit state beta voor de + uittredepunten. + + Args: + export: Figuur exporteren. Defaults to False. + + Returns: + PlotlyFigure + """ + return dumbbell_heave(self, export) + + def dumbbell_piping(self, export: bool = False) -> list[PlotlyFigure]: + """Maak een dumbbell plot van de beta waardes van de twee pakketten om + te kunnen vergelijken. Dit is plot voor de piping limit state beta voor + de uittredepunten. + + Args: + export: Figuur exporteren. Defaults to False. + + Returns: + PlotlyFigure + """ + return dumbbell_piping(self, export) + + def map_delta_beta_comparison(self, export: bool = False) -> PlotlyFigure: + """Maak een overzichtskaart met het absolute verschil tussen de twee + beta waardes van alle uittredepunten. + + Args: + export: Figuur exporteren. Defaults to False. + + Returns: + PlotlyFigure + """ + return map_delta_beta_comparison(self, export) + + def map_ratio_beta_comparison(self, export: bool = False) -> PlotlyFigure: + """Maak een overzichtskaart met het relative verschil tussen de twee + beta waardes van alle uittredepunten. + + Args: + export: Figuur exporteren. Defaults to False. + + Returns: + PlotlyFigure + """ + return map_ratio_beta_comparison(self, export) + + def create_and_export_figures(self): + """Exporteer alle figuren die gemaakt kunnen worden. + """ + dumbbell_beta(self, export=True) + dumbbell_uplift(self, export=True) + dumbbell_heave(self, export=True) + dumbbell_piping(self, export=True) + map_delta_beta_comparison(self, export=True) + map_ratio_beta_comparison(self, export=True) diff --git a/geoprob_pipe/cmd_app/spatial_layers/vakindeling.py b/geoprob_pipe/cmd_app/spatial_layers/vakindeling.py index e50b5172..6816ea40 100644 --- a/geoprob_pipe/cmd_app/spatial_layers/vakindeling.py +++ b/geoprob_pipe/cmd_app/spatial_layers/vakindeling.py @@ -24,127 +24,135 @@ def added_vakindeling(app_settings: ApplicationSettings) -> bool: check_validity_vakindeling(app_settings=app_settings) return True else: - request_vakindeling_filepath(app_settings) + process_import_vakindeling(app_settings) return True -def check_validity_vakindeling(app_settings: ApplicationSettings): - gdf_dijktraject: GeoDataFrame = read_file(app_settings.geopackage_filepath, layer="dijktraject") - gdf_dijktraject_geom = gdf_dijktraject.iloc[0].geometry - if isinstance(gdf_dijktraject_geom, MultiLineString): - assert gdf_dijktraject_geom.geoms.__len__() == 1 - ls_dijktraject: LineString = gdf_dijktraject_geom.geoms[0] - elif isinstance(gdf_dijktraject_geom, LineString): - ls_dijktraject = gdf_dijktraject_geom - else: - raise NotImplementedError(f"Type of '{type(gdf_dijktraject_geom)} is not yet supported. Please contact the " - f"developer.'") - dijktraject_length = round(ls_dijktraject.length, 2) - - gdf_vakindeling: GeoDataFrame = read_file(app_settings.geopackage_filepath, layer="vakindeling") - vakindeling_geometries = gdf_vakindeling.geometry.tolist() - vakindeling_total_length = round(sum([geom.length for geom in vakindeling_geometries]), 2) - - assert dijktraject_length == vakindeling_total_length - print(BColors.OKBLUE, f"✔ Vakindeling al toegevoegd.", BColors.ENDC) - +def process_import_vakindeling(app_settings: ApplicationSettings): + file_path = request_vakindeling_filepath() + gdf = import_geo_dataframe(filepath=file_path) + validate_vakindeling(gdf=gdf) + column_name: str = specify_column_with_vaknaam(gdf=gdf) + kolom_vak_id: Optional[str] = specify_column_with_vak_id(gdf=gdf) + align_vak_shp_to_dijktraject( + app_settings, gdf_vakindeling=gdf, kolom_vak_naam=column_name, kolom_vak_id=kolom_vak_id) -def import_from_geopackage(filepath: str) -> GeoDataFrame: - layer_name: Optional[str] = None - layer_name_is_valid = False - while layer_name_is_valid is False: - layer_name: str = inquirer.text( - message="Specificeer de laag met de vakindeling. " - "Type 'listlayers' om een overzicht te krijgen van de geopackage-layers. ", - ).execute() - - layer_names = fiona.listlayers(filepath) - layer_names.sort() - layers_str = ", ".join(layer_names) - if layer_name == "listlayers": - print(BColors.OKBLUE, f"De volgende layers zijn beschikbaar in de geopackage: {layers_str}", BColors.ENDC) - continue - elif layer_name not in layer_names: - print(BColors.OKBLUE, f"De laag name '{layer_name}' bestaat niet. De volgende layers zijn beschikbaar in " - f"de geopackage: {layers_str}", BColors.ENDC) - continue - - layer_name_is_valid = True - - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", message="Measured \\(M\\) geometry types are not supported.*") - gdf: GeoDataFrame = read_file(filepath, layer=layer_name) - return gdf +def validity_vakindeling_filepath(filepath: str) -> bool: + if not (filepath.endswith(".gpkg") or filepath.endswith(".shp") or filepath.endswith(".gdb")): + print(f"{BColors.WARNING}Het bestand moet of een geopackage, shapefile of geodatabase zijn. Jouw invoer " + f"eindigt op de extensie .{filepath.split(sep='.')[-1]}.{BColors.ENDC}") + return False -def import_from_geodatabase(filepath: str) -> GeoDataFrame: - layer_name: Optional[str] = None - layer_name_is_valid = False - while layer_name_is_valid is False: - layer_name: str = inquirer.text( - message="Specificeer de laag met de vakindeling. " - "Type 'listlayers' om een overzicht te krijgen van de geodatabase-layers. ", - ).execute() - - layer_names = fiona.listlayers(filepath) - layer_names.sort() - layers_str = ", ".join(layer_names) - if layer_name == "listlayers": - print(BColors.OKBLUE, f"De volgende layers zijn beschikbaar in de geodatabase: {layers_str}", BColors.ENDC) - continue - elif layer_name not in layer_names: - print(BColors.OKBLUE, f"De laag name '{layer_name}' bestaat niet. De volgende layers zijn beschikbaar in " - f"de geodatabase: {layers_str}", BColors.ENDC) - continue - - layer_name_is_valid = True + if not os.path.exists(filepath): + print(BColors.WARNING, f"Het opgegeven bestandspad bestaat niet.", BColors.ENDC) + return False - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", message="Measured \\(M\\) geometry types are not supported.*") - gdf: GeoDataFrame = read_file(filepath, layer=layer_name) - return gdf + return True -def request_vakindeling_filepath(app_settings: ApplicationSettings): - filepath: Optional[str] = None - filepath_is_valid = False - while filepath_is_valid is False: +def request_vakindeling_filepath() -> str: + while True: filepath: str = inquirer.text( message="Specificeer het volledige bestandspad naar de geopackage/shapefile/geodatabase waarin de " - "vakindeling van de dijk zit.", - ).execute() - + "vakindeling van de dijk zit.").execute() filepath = filepath.replace('"', '') + if validity_vakindeling_filepath(filepath=filepath) is not None: + return filepath - if not (filepath.endswith(".gpkg") or filepath.endswith(".shp") or filepath.endswith(".gdb")): - print(BColors.WARNING, f"Het bestand moet of een geopackage, shapefile of geodatabase zijn. Jouw invoer " - f"eindigt op de extensie .{filepath.split(sep='.')[-1]}.", BColors.ENDC) - continue - if not os.path.exists(filepath): - print(BColors.WARNING, f"Het opgegeven bestandspad bestaat niet.", BColors.ENDC) - continue - - filepath_is_valid = True +def import_geo_dataframe(filepath: str) -> GeoDataFrame: if filepath.endswith(".shp"): with warnings.catch_warnings(): warnings.filterwarnings("ignore", message="Measured \\(M\\) geometry types are not supported.*") gdf: GeoDataFrame = read_file(filepath) - validate_vakindeling(app_settings, gdf=gdf) elif filepath.endswith(".gpkg"): gdf: GeoDataFrame = import_from_geopackage(filepath=filepath) - validate_vakindeling(app_settings, gdf=gdf) elif filepath.endswith(".gdb"): gdf: GeoDataFrame = import_from_geodatabase(filepath=filepath) - validate_vakindeling(app_settings, gdf=gdf) else: raise NotImplementedError(f"File with extension {filepath.split(sep='.')[-1]} is not yet supported. " f"Please make a request.") + return gdf + + +def validity_layer_name_geopackage(filepath_geopackage: str, layer_name: str) -> False: + + layer_names = fiona.listlayers(filepath_geopackage) + layer_names.sort() + layers_str = ", ".join(layer_names) + + if layer_name == "listlayers": + print(f"{BColors.OKBLUE}De volgende layers zijn beschikbaar in de geopackage: {layers_str}{BColors.ENDC}") + return False + + if layer_name not in layer_names: + print(f"{BColors.OKBLUE}De laag name '{layer_name}' bestaat niet. De volgende layers zijn beschikbaar in " + f"de geopackage: {layers_str}{BColors.ENDC}") + return False + + return True -def validate_vakindeling(app_settings: ApplicationSettings, gdf: GeoDataFrame): - """ Validates the vakindeling shape, with some conversions if they can be - applied safely. """ +def request_layer_name_geopackage(filepath: str) -> str: + while True: + layer_name: str = inquirer.text( + message="Specificeer de laag met de vakindeling. " + "Type 'listlayers' om een overzicht te krijgen van de geopackage-layers. ").execute() + if validity_layer_name_geopackage(filepath_geopackage=filepath, layer_name=layer_name): + return layer_name + + +def import_from_geopackage(filepath: str, unit_test_layer_name: Optional[str] = None) -> GeoDataFrame: + layer_name = unit_test_layer_name + if layer_name is None: + request_layer_name_geopackage(filepath=filepath) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", message="Measured \\(M\\) geometry types are not supported.*") + gdf: GeoDataFrame = read_file(filepath, layer=layer_name) + return gdf + + +def validity_layer_name_geodatabase(filepath: str, layer_name: str): + layer_names = fiona.listlayers(filepath) + layer_names.sort() + layers_str = ", ".join(layer_names) + + if layer_name == "listlayers": + print(f"{BColors.OKBLUE}De volgende layers zijn beschikbaar in de geodatabase: {layers_str}{BColors.ENDC}") + return False + + elif layer_name not in layer_names: + print(f"{BColors.OKBLUE}De laag name '{layer_name}' bestaat niet. De volgende layers zijn beschikbaar in de " + f"geodatabase: {layers_str}{BColors.ENDC}") + return False + + return True + + +def request_layer_name_geodatabase(filepath: str) -> str: + while True: + layer_name: str = inquirer.text( + message="Specificeer de laag met de vakindeling. " + "Type 'listlayers' om een overzicht te krijgen van de geodatabase-layers. ").execute() + if validity_layer_name_geodatabase(filepath=filepath, layer_name=layer_name): + return layer_name + + +def import_from_geodatabase(filepath: str, unit_test_layer_name: Optional[str] = None) -> GeoDataFrame: + layer_name = unit_test_layer_name + if layer_name is None: + request_layer_name_geodatabase(filepath=filepath) + + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", message="Measured \\(M\\) geometry types are not supported.*") + gdf: GeoDataFrame = read_file(filepath, layer=layer_name) + + return gdf + + +def validate_vakindeling(gdf: GeoDataFrame): + """ Validates the vakindeling shape, with some conversions if they can be applied safely. """ # Validate geometry types allowed_types = {"LineString", "MultiLineString"} @@ -167,98 +175,71 @@ def validate_vakindeling(app_settings: ApplicationSettings, gdf: GeoDataFrame): assert valid, (f"De vakindeling is niet valide. Ter controle is een poging gedaan of de vakindeling " f"samenvoegbaar is tot één lijn. Dit blijkt niet het geval. Zitten er gaten tussen de vakken?") - # Continue questioner - specify_column_with_vaknaam(app_settings, gdf=gdf) +def validity_column_vaknaam(column_name: str, gdf: GeoDataFrame): + column_names = gdf.columns + columns_str = ", ".join(column_names) + + if column_name == "listcolumns": + print(f"{BColors.OKBLUE}De volgende kolommen zijn beschikbaar in de spatial layer: {columns_str}{BColors.ENDC}") + return False -def specify_column_with_vaknaam( - app_settings: ApplicationSettings, gdf: GeoDataFrame): - column_name: Optional[str] = None - column_name_is_valid = False - while column_name_is_valid is False: + if column_name not in column_names: + print(f"{BColors.OKBLUE}De kolom naam '{column_name}' bestaat niet. De volgende kolommen zijn beschikbaar in " + f"de spatial layer: {columns_str}{BColors.ENDC}") + return False + + return True + + +def specify_column_with_vaknaam(gdf: GeoDataFrame) -> str: + while True: column_name: str = inquirer.text( - message="Specificeer de kolom waarin de vaknaam staat. Type " - "'listcolumns' om een overzicht te krijgen van de " - "kolommen. ", - ).execute() - - column_names = gdf.columns - columns_str = ", ".join(column_names) - if column_name == "listcolumns": - print(BColors.OKBLUE, - f"De volgende kolommen zijn beschikbaar in de spatial " - f"layer: {columns_str}", BColors.ENDC) - continue - elif column_name not in column_names: - print(BColors.OKBLUE, - f"De kolom naam '{column_name}' bestaat niet. De volgende " - f"kolommen zijn beschikbaar in de spatial layer: " - f"{columns_str}", BColors.ENDC) - continue - - column_name_is_valid = True - - column_name: str - specify_column_with_vak_id( - app_settings, gdf=gdf, kolom_vak_naam=column_name) + message="Specificeer de kolom waarin de vaknaam staat. Type 'listcolumns' om een overzicht te krijgen van " + "de kolommen. ").execute() + if validity_column_vaknaam(column_name=column_name, gdf=gdf): + return column_name -def is_numeric_integer(val): - try: - return float(val) % 1 == 0 - except (ValueError, TypeError): +def validity_column_vak_id(column_name: str, gdf: GeoDataFrame) -> bool: + column_names = gdf.columns + columns_str = ", ".join(column_names) + + if column_name == "listcolumns": + print(BColors.OKBLUE, + f"De volgende kolommen zijn beschikbaar in de spatial "f"layer: {columns_str}", BColors.ENDC) + return False + + if column_name not in column_names: + print(f"{BColors.OKBLUE}De kolom naam '{column_name}' bestaat niet. De volgende kolommen zijn beschikbaar in " + f"de spatial layer: {columns_str}{BColors.ENDC}") + return False + + # Ensure column values are unique + if gdf[column_name].__len__() != gdf[column_name].unique().__len__(): + print(f"{BColors.OKBLUE}De waarden in deze kolom zijn niet uniek. Corrigeer de dubbelingen, of kies een " + f"andere kolom.{BColors.ENDC}") + return False + + # Ensure column values are integers + if not gdf[column_name].apply(is_numeric_integer).all(): + print(f"{BColors.OKBLUE}De waarden in deze kolom zijn niet allen volledige getallen (integers). Corrigeer de " + f"kolom, of kies een andere.{BColors.ENDC}") return False + return True -def specify_column_with_vak_id( - app_settings: ApplicationSettings, gdf: GeoDataFrame, - kolom_vak_naam: str): - kolom_vak_id: Optional[str] = None - column_name_is_valid = False - while column_name_is_valid is False: + +def specify_column_with_vak_id(gdf: GeoDataFrame) -> Optional[str]: + while True: kolom_vak_id: str = inquirer.text( - message="Specificeer de kolom waarin het vak id staat. Indien " - "onnodig, type 'nvt'. Type 'listcolumns' om een overzicht " - "te krijgen van de kolommen. ", - ).execute() + message="Specificeer de kolom waarin het vak id staat. Indien onnodig, type 'nvt'. Type 'listcolumns' om " + "een overzicht te krijgen van de kolommen.").execute() - column_names = gdf.columns - columns_str = ", ".join(column_names) if kolom_vak_id.lower() == "nvt": - align_vak_shp_to_dijktraject( - app_settings, gdf_vakindeling=gdf, - kolom_vak_naam=kolom_vak_naam, kolom_vak_id=None) - return - elif kolom_vak_id == "listcolumns": - print(BColors.OKBLUE, - f"De volgende kolommen zijn beschikbaar in de spatial " - f"layer: {columns_str}", BColors.ENDC) - continue - elif kolom_vak_id not in column_names: - print(f"{BColors.OKBLUE}De kolom naam '{kolom_vak_id}' bestaat " - f"niet. De volgende kolommen zijn beschikbaar in de spatial " - f"layer: {columns_str}{BColors.ENDC}") - continue - - # Ensure column values are unique and integers - if gdf[kolom_vak_id].__len__() != gdf[kolom_vak_id].unique().__len__(): - print(f"{BColors.OKBLUE}De waarden in deze kolom zijn niet uniek. " - f"Corrigeer de dubbelingen, of kies een andere kolom." - f"{BColors.ENDC}") - continue - - elif not gdf[kolom_vak_id].apply(is_numeric_integer).all(): - print(f"{BColors.OKBLUE}De waarden in deze kolom zijn niet allen " - f"volledige getallen (integers). Corrigeer de kolom, of " - f"kies een andere.{BColors.ENDC}") - continue - - column_name_is_valid = True - - kolom_vak_id: str - align_vak_shp_to_dijktraject( - app_settings, gdf_vakindeling=gdf, kolom_vak_naam=kolom_vak_naam, - kolom_vak_id=kolom_vak_id) + return None + if validity_column_vak_id(column_name=kolom_vak_id, gdf=gdf): + return kolom_vak_id def align_vak_shp_to_dijktraject( @@ -317,3 +298,31 @@ def align_vak_shp_to_dijktraject( Path(app_settings.geopackage_filepath), layer="vakindeling", driver="GPKG") print(BColors.OKBLUE, f"✅ Vakindeling toegevoegd.", BColors.ENDC) + + +def check_validity_vakindeling(app_settings: ApplicationSettings): + gdf_dijktraject: GeoDataFrame = read_file(app_settings.geopackage_filepath, layer="dijktraject") + gdf_dijktraject_geom = gdf_dijktraject.iloc[0].geometry + if isinstance(gdf_dijktraject_geom, MultiLineString): + assert gdf_dijktraject_geom.geoms.__len__() == 1 + ls_dijktraject: LineString = gdf_dijktraject_geom.geoms[0] + elif isinstance(gdf_dijktraject_geom, LineString): + ls_dijktraject = gdf_dijktraject_geom + else: + raise NotImplementedError(f"Type of '{type(gdf_dijktraject_geom)} is not yet supported. Please contact the " + f"developer.'") + dijktraject_length = round(ls_dijktraject.length, 2) + + gdf_vakindeling: GeoDataFrame = read_file(app_settings.geopackage_filepath, layer="vakindeling") + vakindeling_geometries = gdf_vakindeling.geometry.tolist() + vakindeling_total_length = round(sum([geom.length for geom in vakindeling_geometries]), 2) + + assert dijktraject_length == vakindeling_total_length + print(BColors.OKBLUE, f"✔ Vakindeling al toegevoegd.", BColors.ENDC) + + +def is_numeric_integer(val): + try: + return float(val) % 1 == 0 + except (ValueError, TypeError): + return False diff --git a/geoprob_pipe/visualizations/graphs/__init__.py b/geoprob_pipe/visualizations/graphs/__init__.py index 50b90198..8caa828f 100644 --- a/geoprob_pipe/visualizations/graphs/__init__.py +++ b/geoprob_pipe/visualizations/graphs/__init__.py @@ -1,7 +1,5 @@ from __future__ import annotations -from geoprob_pipe.visualizations.graphs.betrouwbaarheidsindex import ( - GraphBetaValuesSingleInteractive) - # beta_uittredepunten_graph, beta_scenarios_graph, beta_vakken_graph) +from geoprob_pipe.visualizations.graphs.betrouwbaarheidsindex import GraphBetaValuesSingleInteractive from geoprob_pipe.visualizations.graphs.hfreq import GraphHFreqSingleInteractive from geoprob_pipe.visualizations.graphs.assemblage_icicle import IciclePlot from geoprob_pipe.visualizations.graphs.physical_values_along_levee import physical_values_buitenwaterstand_and_top_zand @@ -46,15 +44,6 @@ def beta_value_in_single_interactive(self, export: bool = False) -> PlotlyFigure graph = GraphBetaValuesSingleInteractive(self.geoprob_pipe, export=export) return graph.fig - # def beta_scenarios(self) -> PlotlyFigure: - # return beta_scenarios_graph(self.geoprob_pipe, export=False) - # - # def beta_uittredepunten(self) -> PlotlyFigure: - # return beta_uittredepunten_graph(self.geoprob_pipe, export=False) - # - # def beta_vakken(self) -> PlotlyFigure: - # return beta_vakken_graph(self.geoprob_pipe, export=False) - def phreatic_waterline(self) -> PlotlyFigure: return phreatic_waterline(self.geoprob_pipe, export=False) diff --git a/geoprob_pipe/visualizations/other/__init__.py b/geoprob_pipe/visualizations/other/__init__.py deleted file mode 100644 index a8ad1c6f..00000000 --- a/geoprob_pipe/visualizations/other/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -from __future__ import annotations -from typing import TYPE_CHECKING -from pandas import DataFrame -from geoprob_pipe.visualizations.other.overview.generate_flow_chart_v2 import generate_overview_flow_chart_with_betas -import os -if TYPE_CHECKING: - from geoprob_pipe import GeoProbPipe - - -class Other: - - def __init__(self, app_obj: GeoProbPipe): - self.geoprob_pipe = app_obj - - @property - def export_dir(self) -> str: - path = os.path.join(self.geoprob_pipe.visualizations.export_dir, "visualizations") - os.makedirs(path, exist_ok=True) - return path - - def export_visualizations(self): - df = self.geoprob_pipe.results.df_beta_scenarios_final - lowest_beta_row: DataFrame = df.loc[df['beta'].idxmin()] - generate_overview_flow_chart_with_betas( - app_obj=self.geoprob_pipe, - export_dir=self.export_dir, - ondergrondscenario_id=lowest_beta_row['ondergrondscenario_id'], - uittredepunt_id=lowest_beta_row['uittredepunt_id'] - ) diff --git a/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags.graphml b/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags.graphml deleted file mode 100644 index 09927c18..00000000 --- a/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags.graphml +++ /dev/null @@ -1,1539 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gecombineerd -vak - - - - - - - - - - - Uplift - - - - - - - - - - - Heave - - - - - - - - - - - Piping - - - - - - - - - - - Gecombineerd -scenario - - - - - - - - - - - Gecombineerd -Uittredepunt - - - - - - - - - - - Gecombineerd -andere scenario's - - - - - - - - - - - Uitredepunt - - - - - - - - - - - Gecombineerd -andere uittredepunten - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gecombineerd -andere vakken - - - - - - - - - - - Gecombineerd -traject - - - - - - - - - - - Vak - - - - - - - - - - - 20 laagst scorende andere uittredepunten - - - - - - - - - - - 20 laagst scorende andere vakken - - - - - - - - - - - Traject - - - - - - - - - - - Uplift - - - - - - - - - - - Heave - - - - - - - - - - - Piping - - - - - - - - - - - FORM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gecombineerd -Scenario 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gecombineerd -Uittredepunt 1 - - - - - - - - - - - Beta volgt uit sommatie van scenario -kansen maal de faalkans - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Importance Sampling o.b.v. -Design Points FORM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gecombineerd -Vak 1 - - - - - - - - - - - Beta volgt uit meest -ongunstige uittredepunt - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gecombineerd -Traject - - - - - - - - - - - Beta volgt uit meest -ongunstige vak - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Bepaling Beta's en Alpha's - - - - - - - - - - - {{ uittredepunt.1.beta }} - - - - - - - - - - - {{ scenario.1.beta }} - - - - - - - - - - - {{ scenario.6.beta }} - - - - - - - - - - - {{ scenario.7.beta }} - - - - - - - - - - - {{ piping.beta }} - - - - - - - - - - - {{ heave.beta }} - - - - - - - - - - - {{ uplift.beta }} - - - - - - - - - - - {{ uittredepunt.2.beta }} - - - - - - - - - - - {{ uittredepunt.3.beta }} - - - - - - - - - - - {{ vak.1.beta }} - - - - - - - - - - - {{ scenario.8.beta }} - - - - - - - - - - - {{ scenario.9.beta }} - - - - - - - - - - - {{ scenario.10.beta }} - - - - - - - - - - - {{ scenario.11.beta }} - - - - - - - - - - - {{ scenario.12.beta }} - - - - - - - - - - - {{ scenario.2.beta }} - - - - - - - - - - - {{ scenario.3.beta }} - - - - - - - - - - - {{ scenario.4.beta }} - - - - - - - - - - - {{ scenario.5.beta }} - - - - - - - - - - - {{ scenario.14.beta }} - - - - - - - - - - - {{ scenario.15.beta }} - - - - - - - - - - - {{ scenario.16.beta }} - - - - - - - - - - - {{ scenario.17.beta }} - - - - - - - - - - - {{ scenario.18.beta }} - - - - - - - - - - - {{ scenario.19.beta }} - - - - - - - - - - - {{ scenario.20.beta }} - - - - - - - - - - - {{ scenario.13.beta }} - - - - - - - - - - - {{ uittredepunt.4.beta }} - - - - - - - - - - - {{ uittredepunt.5.beta }} - - - - - - - - - - - {{ uittredepunt.6.beta }} - - - - - - - - - - - {{ uittredepunt.7.beta }} - - - - - - - - - - - {{ uittredepunt.8.beta }} - - - - - - - - - - - {{ uittredepunt.9.beta }} - - - - - - - - - - - {{ uittredepunt.10.beta }} - - - - - - - - - - - {{ uittredepunt.11.beta }} - - - - - - - - - - - {{ uittredepunt.12.beta }} - - - - - - - - - - - {{ uittredepunt.13.beta }} - - - - - - - - - - - {{ uittredepunt.14.beta }} - - - - - - - - - - - {{ uittredepunt.15.beta }} - - - - - - - - - - - {{ uittredepunt.16.beta }} - - - - - - - - - - - {{ uittredepunt.17.beta }} - - - - - - - - - - - {{ uittredepunt.18.beta }} - - - - - - - - - - - {{ uittredepunt.19.beta }} - - - - - - - - - - - {{ uittredepunt.20.beta }} - - - - - - - - - - - {{ vak.2.beta }} - - - - - - - - - - - {{ vak.3.beta }} - - - - - - - - - - - {{ vak.4.beta }} - - - - - - - - - - - {{ vak.8.beta }} - - - - - - - - - - - {{ vak.9.beta }} - - - - - - - - - - - {{ vak.10.beta }} - - - - - - - - - - - {{ vak.11.beta }} - - - - - - - - - - - {{ vak.12.beta }} - - - - - - - - - - - {{ vak.13.beta }} - - - - - - - - - - - {{ vak.14.beta }} - - - - - - - - - - - {{ vak.15.beta }} - - - - - - - - - - - {{ vak.16.beta }} - - - - - - - - - - - {{ vak.5.beta }} - - - - - - - - - - - {{ vak.6.beta }} - - - - - - - - - - - {{ vak.7.beta }} - - - - - - - - - - - {{ vak.17.beta }} - - - - - - - - - - - {{ vak.18.beta }} - - - - - - - - - - - {{ vak.19.beta }} - - - - - - - - - - - {{ vak.20.beta }} - - - - - - - - - - - {{ vak.21.beta }} - - - - - - - - - - - {{ uittredepunt.21.beta }} - - - - - - - - - - - traject.beta }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags.svg b/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags.svg deleted file mode 100644 index 9270dce8..00000000 --- a/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags.svg +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gecombineerd - Vak 1 - - - - - - - - - Uplift - - - - - - - - - Heave - - - - - - - - - Piping - - - - - - - Gecombineerd - Scenario 1 - - - - - - - Gecombineerd - Uittredepunt 1 - - - - - - - Gecombineerd - Scenario N - Uitredepunt 1 - - - - - - - - - - - - - Gecombineerd - Uittredepunt N - - - - - - - Gecombineerd - Vak 2 - - - - - - - - - - - - - Gecombineerd - Vak N - - - - - - - Gecombineerd - Traject - Vak 1 - Uitredepunt N - Vak 2 - Vak N - Traject - - - - - - - - - Uplift - - - - - - - - - Heave - - - - - - - - - Piping - - - FORM - - - - - - - Gecombineerd - Scenario 1 - - - - - - - Gecombineerd - Uittredepunt 1 - Beta volgt uit sommatie van scenario - kansen maal de faalkans - Alpha's volgen uit meest - ongunstige scenario - Importance Sampling o.b.v. - Design Points FORM - Huidig issue: - Bijbehorende Alpha's zijn - niet gelijk aan 1.00 - - - - - - - Gecombineerd - Vak 1 - Beta volgt uit meest - ongunstige uittredepunt - Alpha's volgen uit meest - ongunstige uittredepunt - - - - - - - Gecombineerd - Traject - Beta volgt uit meest - ongunstige vak - Alpha's volgen uit meest - ongunstige vak - Bepaling Beta's en Alpha's - - - - - - - 6.23 - - - - - - - {{ scenarios.1.beta }} - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - {{ piping.beta }} - - - - - - - {{ heave.beta }} - - - - - - - {{ uplift.beta }} - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - {{COMB.VAK.FOCUS}} - - - - - - - 6.23 - - - - - - - {{ vakken. }} - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - 6.23 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags_v2.svg b/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags_v2.svg deleted file mode 100644 index 0c57d419..00000000 --- a/geoprob_pipe/visualizations/other/overview/Hierarchie_berekeningen_incl_result_tags_v2.svg +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gecombineerd - vak - - - - - - - - - Uplift - - - - - - - - - Heave - - - - - - - - - Piping - - - - - - - Gecombineerd - scenario - - - - - - - Gecombineerd - Uittredepunt - - - - - - - Gecombineerd - andere scenario's - Uitredepunt - - - - - - - Gecombineerd - andere uittredepunten - - - - - - - - - - - - - Gecombineerd - andere vakken - - - - - - - Gecombineerd - traject - Vak - 20 laagst scorende andere uittredepunten - 20 laagst scorende andere vakken - Traject - - - - - - - - - Uplift - - - - - - - - - Heave - - - - - - - - - Piping - - - FORM - - - - - - - Gecombineerd - Scenario 1 - - - - - - - Gecombineerd - Uittredepunt 1 - Beta volgt uit sommatie van scenario - kansen maal de faalkans - Importance Sampling o.b.v. - Design Points FORM - - - - - - - Gecombineerd - Vak 1 - Beta volgt uit meest - ongunstige uittredepunt - - - - - - - Gecombineerd - Traject - Beta volgt uit meest - ongunstige vak - Bepaling Beta's en Alpha's - - - - - - - {{ uittredepunt.1.beta }} - - - - - - - {{ scenario.1.beta }} - - - - - - - {{ scenario.99.beta }} - - - - - - - {{ scenario.7.beta }} - - - - - - - {{ piping.beta }} - - - - - - - {{ heave.beta }} - - - - - - - {{ uplift.beta }} - - - - - - - {{ uittredepunt.2.beta }} - - - - - - - {{ uittredepunt.3.beta }} - - - - - - - {{ vak.1.beta }} - - - - - - - {{ scenario.99.beta }} - - - - - - - {{ scenario.9.beta }} - - - - - - - {{ scenario.99.beta }} - - - - - - - {{ scenario.5.beta }} - - - - - - - {{ scenario.4.beta }} - - - - - - - {{ scenario.99.beta }} - - - - - - - {{ scenario.99.beta }} - - - - - - - {{ scenario.3.beta }} - - - - - - - {{ scenario.2.beta }} - - - - - - - {{ scenario.14.beta }} - - - - - - - {{ scenario.15.beta }} - - - - - - - {{ scenario.16.beta }} - - - - - - - {{ scenario.17.beta }} - - - - - - - {{ scenario.18.beta }} - - - - - - - {{ scenario.19.beta }} - - - - - - - {{ scenario.20.beta }} - - - - - - - {{ scenario.13.beta }} - - - - - - - {{ uittredepunt.4.beta }} - - - - - - - {{ uittredepunt.5.beta }} - - - - - - - {{ uittredepunt.6.beta }} - - - - - - - {{ uittredepunt.7.beta }} - - - - - - - {{ uittredepunt.8.beta }} - - - - - - - {{ uittredepunt.9.beta }} - - - - - - - {{ uittredepunt.10.beta }} - - - - - - - {{ uittredepunt.11.beta }} - - - - - - - {{ uittredepunt.12.beta }} - - - - - - - {{ uittredepunt.13.beta }} - - - - - - - {{ uittredepunt.14.beta }} - - - - - - - {{ uittredepunt.15.beta }} - - - - - - - {{ uittredepunt.16.beta }} - - - - - - - {{ uittredepunt.17.beta }} - - - - - - - {{ uittredepunt.18.beta }} - - - - - - - {{ uittredepunt.19.beta }} - - - - - - - {{ uittredepunt.20.beta }} - - - - - - - {{ vak.2.beta }} - - - - - - - {{ vak.3.beta }} - - - - - - - {{ vak.4.beta }} - - - - - - - {{ vak.8.beta }} - - - - - - - {{ vak.9.beta }} - - - - - - - {{ vak.10.beta }} - - - - - - - {{ vak.11.beta }} - - - - - - - {{ vak.12.beta }} - - - - - - - {{ vak.13.beta }} - - - - - - - {{ vak.14.beta }} - - - - - - - {{ vak.15.beta }} - - - - - - - {{ vak.16.beta }} - - - - - - - {{ vak.5.beta }} - - - - - - - {{ vak.6.beta }} - - - - - - - {{ vak.7.beta }} - - - - - - - {{ vak.17.beta }} - - - - - - - {{ vak.18.beta }} - - - - - - - {{ vak.19.beta }} - - - - - - - {{ vak.20.beta }} - - - - - - - {{ vak.21.beta }} - - - - - - - {{ uittredepunt.21.beta }} - - - - - - - traject.beta }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/geoprob_pipe/visualizations/other/overview/generate_flow_chart.py b/geoprob_pipe/visualizations/other/overview/generate_flow_chart.py deleted file mode 100644 index 499544da..00000000 --- a/geoprob_pipe/visualizations/other/overview/generate_flow_chart.py +++ /dev/null @@ -1,188 +0,0 @@ -# import os -# import random -# from typing import Union, Literal -# import sys -# -# # rgb(153,204,0) -# -# -# # class Tags: -# # -# # def __init__(self, main_tag: str): -# # self.main_tag: str = main_tag -# # -# # @property -# # def beta(self): -# # return -# # -# -# -# -# -# class VisualizeInfo: -# -# def __init__(self, main_tag: str, beta: Union[float, int, str] = "n.b.", visible: bool = False): -# self.main_tag: str = main_tag -# self.beta: Union[float, int, str] = beta -# self.visible: bool = visible -# -# @property -# def svg_color(self) -> str: -# """ Color value formatted for the SVG-file. """ -# if self.beta > 5.00: -# return "rgb(154,205,50)" # Green -# return "rgb(206,32,41)" # Red -# -# @property -# def svg_beta(self) -> str: -# """ Beta value formatted for the SVG-file. """ -# if isinstance(self.beta, float) or isinstance(self.beta, int): -# return f"{round(self.beta, 2):.2f}" -# return str(self.beta) -# -# @property -# def svg_visibility(self): -# """ Visibility value formatted for the SVG-file. """ -# if self.visible: -# return "visible" -# return "hidden" -# -# def svg_tag(self, option: Literal["beta", "color", "visibility"]) -> str: -# return f"{self.main_tag}.{option}" -# -# def svg_tag_incl_brackets(self, option: Literal["beta", "color", "visibility"]) -> str: -# return f"{{{{ {self.svg_tag(option=option)} }}}}" -# -# -# list_visualize_info = [ -# VisualizeInfo(main_tag=, beta=random.random() * 7 + 2, visible=True), -# ] -# -# dict_visualize_info = { -# "uplift": VisualizeInfo(main_tag="uplift", beta=random.random() * 7 + 2, visible=True), -# "heave": VisualizeInfo(main_tag="heave", beta=random.random() * 7 + 2, visible=True), -# "piping": VisualizeInfo(main_tag="piping", beta=random.random() * 7 + 2, visible=True), -# "scenarios.1": VisualizeInfo(main_tag="scenarios.1", beta=random.random() * 7 + 2, visible=True), -# "scenarios.2": VisualizeInfo(main_tag="scenarios.2", beta=random.random() * 7 + 2), -# } -# -# -# -# -# -# def generate_overview_flow_chart_with_betas(scenario, uittredepunt): -# """ Generates a flow chart that provides an overview what the beta values are per step in the calculation process. -# It displays it from the given scenario and uittredepunt, until vak- and traject-level. """ -# -# -# tags = { -# "uplift": VisualInfo(random.random() * 7 + 2, True), -# "heave": VisualInfo(random.random() * 7 + 2, True), -# "piping": VisualInfo(random.random() * 7 + 2, True), -# "scenarios": { -# 1: VisualInfo(random.random() * 7 + 2), -# 2: VisualInfo(random.random() * 7 + 2), -# 3: VisualInfo(random.random() * 7 + 2), -# 4: VisualInfo(random.random() * 7 + 2), -# 5: VisualInfo(random.random() * 7 + 2), -# 6: VisualInfo(random.random() * 7 + 2), -# 7: VisualInfo(random.random() * 7 + 2), -# }, -# "uittredepunten": { -# 1: VisualInfo(random.random() * 7 + 2), -# 2: VisualInfo(random.random() * 7 + 2), -# 3: VisualInfo(random.random() * 7 + 2), -# 4: VisualInfo(random.random() * 7 + 2), -# 5: VisualInfo(random.random() * 7 + 2), -# 6: VisualInfo(random.random() * 7 + 2), -# 7: VisualInfo(random.random() * 7 + 2), -# }, -# "vakken": { -# 1: VisualInfo(random.random() * 7 + 2), -# 2: VisualInfo(random.random() * 7 + 2), -# 3: VisualInfo(random.random() * 7 + 2), -# 4: VisualInfo(random.random() * 7 + 2), -# 5: VisualInfo(random.random() * 7 + 2), -# 6: VisualInfo(random.random() * 7 + 2), -# 7: VisualInfo(random.random() * 7 + 2), -# }, -# "traject": VisualInfo(random.random() * 7 + 2), -# -# } -# -# # Apply visual and value to each circle -# concatenated_tags = [] -# values_to_concatenated_tags = [] -# visibility_to_concatenated_tags = [] -# for key, value in tags.items(): -# -# print(f"{key=}, {value=}") -# -# -# # Determine tag .-string -# if isinstance(value, VisualInfo): -# tag_beta = f"{key}.beta" -# value_beta = value.beta -# tag_color = f"{key}.color" -# value_color = value.color -# -# concatenated_tags.append(tag_beta) -# values_to_concatenated_tags.append(value_beta) -# concatenated_tags.append(tag_color) -# values_to_concatenated_tags.append(value_color) -# -# elif isinstance(value, dict): -# # print(f"{concatenated_tags=}") -# # print(f"{values_to_concatenated_tags=}") -# # sys.exit() -# for key2, value2 in value.items(): -# # print(f"{key2=}, {value2=}") -# value2: VisualInfo -# tag_beta = f"{key}.{key2}.beta" -# # print(f"{value2=}") -# value_beta = value2.beta -# tag_color = f"{key}.{key2}.color" -# value_color = value2.color -# -# concatenated_tags.append(tag_beta) -# values_to_concatenated_tags.append(value_beta) -# concatenated_tags.append(tag_color) -# values_to_concatenated_tags.append(value_color) -# -# else: -# raise ValueError -# -# # Read template -# svg_text = None -# with open(r"C:\Users\CP\git_clones\GeoProb-Pipe\GeoProb-PipeV2\GeoProb-Pipe\geoprob_pipe\graphs\overview\Hierarchie_berekeningen_incl_result_tags.svg", -# "r", encoding="utf-8") as f: -# svg_text = f.read() -# if svg_text is None: -# raise ValueError -# -# # Replace tags -# for tag, value in zip(concatenated_tags, values_to_concatenated_tags): -# -# # Prepare tag to search -# tag_with_brackets = f"{{{{ {tag} }}}}" -# print(f"{tag_with_brackets=}", tag_with_brackets in svg_text) -# -# # Prepare value to add -# if isinstance(value, float) or isinstance(value, int): -# value_prepped = f"{round(value, 2):.2f}" -# else: -# value_prepped = str(value) -# -# # Add value and color -# svg_text = svg_text.replace(tag_with_brackets, value_prepped) -# -# # Save new svg -# print(f"{svg_text=}") -# export_dir = r"C:\Users\CP\git_clones\GeoProb-Pipe\GeoProb-PipeV2\exports" -# with open(os.path.join(export_dir, "updated5.svg"), "w", encoding="utf-8") as f: -# f.write(svg_text) -# -# return concatenated_tags, values_to_concatenated_tags -# -# -# generate_overview_flow_chart_with_betas(1, 2) diff --git a/geoprob_pipe/visualizations/other/overview/generate_flow_chart_v2.py b/geoprob_pipe/visualizations/other/overview/generate_flow_chart_v2.py deleted file mode 100644 index 88b26ded..00000000 --- a/geoprob_pipe/visualizations/other/overview/generate_flow_chart_v2.py +++ /dev/null @@ -1,194 +0,0 @@ -from __future__ import annotations -import os -from typing import Union, Literal -from pandas import DataFrame, Series -from copy import deepcopy -# from geoprob_pipe.utils.other import repository_root_path -from typing import TYPE_CHECKING -if TYPE_CHECKING: - from geoprob_pipe import GeoProbPipe - - - -class VisualizeInfo: - - def __init__(self, main_tag: str, beta: Union[float, int, str] = "n.b.", visible: bool = False): - self.main_tag: str = main_tag - self.beta: Union[float, int, str] = beta - self.visible: bool = visible - - @property - def svg_color(self) -> str: - """ Color value formatted for the SVG-file. """ - if self.beta > 5.00: - return "rgb(154,205,50)" # Green - return "rgb(206,32,41)" # Red - - @property - def svg_beta(self) -> str: - """ Beta value formatted for the SVG-file. """ - if isinstance(self.beta, float) or isinstance(self.beta, int): - if self.beta >= 10.0: - return f"{round(self.beta, 1):.1f}" - return f"{round(self.beta, 2):.2f}" - return str(self.beta) - - @property - def svg_visibility(self): - """ Visibility value formatted for the SVG-file. """ - if self.visible: - return "visible" - return "hidden" - - def svg_tag(self, option: Literal["beta", "color", "visibility"]) -> str: - return f"{self.main_tag}.{option}" - - def svg_tag_incl_brackets(self, option: Literal["beta", "color", "visibility"]) -> str: - return f"{{{{ {self.svg_tag(option=option)} }}}}" - - -DICT_VISUALIZE_INFO = { - "uplift": VisualizeInfo(main_tag="uplift", beta=-1, visible=True), - "heave": VisualizeInfo(main_tag="heave", beta=-1, visible=True), - "piping": VisualizeInfo(main_tag="piping", beta=-1, visible=True), - "scenario.1": VisualizeInfo(main_tag="scenario.1", beta=-1), - "scenario.2": VisualizeInfo(main_tag="scenario.2", beta=-1), - "scenario.3": VisualizeInfo(main_tag="scenario.3", beta=-1), - "scenario.4": VisualizeInfo(main_tag="scenario.4", beta=-1), - "scenario.5": VisualizeInfo(main_tag="scenario.5", beta=-1), - "scenario.6": VisualizeInfo(main_tag="scenario.6", beta=-1), - "scenario.7": VisualizeInfo(main_tag="scenario.7", beta=-1), - "scenario.8": VisualizeInfo(main_tag="scenario.8", beta=-1), - "scenario.9": VisualizeInfo(main_tag="scenario.9", beta=-1), - "scenario.10": VisualizeInfo(main_tag="scenario.10", beta=-1), - "scenario.11": VisualizeInfo(main_tag="scenario.11", beta=-1), - "scenario.12": VisualizeInfo(main_tag="scenario.12", beta=-1), - "scenario.13": VisualizeInfo(main_tag="scenario.13", beta=-1), - "scenario.14": VisualizeInfo(main_tag="scenario.14", beta=-1), - "scenario.15": VisualizeInfo(main_tag="scenario.15", beta=-1), - "scenario.16": VisualizeInfo(main_tag="scenario.16", beta=-1), - "scenario.17": VisualizeInfo(main_tag="scenario.17", beta=-1), - "scenario.18": VisualizeInfo(main_tag="scenario.18", beta=-1), - "scenario.19": VisualizeInfo(main_tag="scenario.19", beta=-1), - "scenario.20": VisualizeInfo(main_tag="scenario.20", beta=-1), - "scenario.99": VisualizeInfo(main_tag="scenario.99", beta=-1), - "uittredepunt.1": VisualizeInfo(main_tag="uittredepunt.1", beta=-1), - "uittredepunt.2": VisualizeInfo(main_tag="uittredepunt.2", beta=-1), - "uittredepunt.3": VisualizeInfo(main_tag="uittredepunt.3", beta=-1), - "uittredepunt.4": VisualizeInfo(main_tag="uittredepunt.4", beta=-1), - "uittredepunt.5": VisualizeInfo(main_tag="uittredepunt.5", beta=-1), - "uittredepunt.6": VisualizeInfo(main_tag="uittredepunt.6", beta=-1), - "uittredepunt.7": VisualizeInfo(main_tag="uittredepunt.7", beta=-1), - "uittredepunt.8": VisualizeInfo(main_tag="uittredepunt.8", beta=-1), - "uittredepunt.9": VisualizeInfo(main_tag="uittredepunt.9", beta=-1), - "uittredepunt.10": VisualizeInfo(main_tag="uittredepunt.10", beta=-1), - "uittredepunt.11": VisualizeInfo(main_tag="uittredepunt.11", beta=-1), - "uittredepunt.12": VisualizeInfo(main_tag="uittredepunt.12", beta=-1), - "uittredepunt.13": VisualizeInfo(main_tag="uittredepunt.13", beta=-1), - "uittredepunt.14": VisualizeInfo(main_tag="uittredepunt.14", beta=-1), - "uittredepunt.15": VisualizeInfo(main_tag="uittredepunt.15", beta=-1), - "uittredepunt.16": VisualizeInfo(main_tag="uittredepunt.16", beta=-1), - "uittredepunt.17": VisualizeInfo(main_tag="uittredepunt.17", beta=-1), - "uittredepunt.18": VisualizeInfo(main_tag="uittredepunt.18", beta=-1), - "uittredepunt.19": VisualizeInfo(main_tag="uittredepunt.19", beta=-1), - "uittredepunt.20": VisualizeInfo(main_tag="uittredepunt.20", beta=-1), - "uittredepunt.21": VisualizeInfo(main_tag="uittredepunt.21", beta=-1), - "uittredepunt.99": VisualizeInfo(main_tag="uittredepunt.99", beta=-1), - "vak.1": VisualizeInfo(main_tag="vak.1", beta=-1), - "vak.2": VisualizeInfo(main_tag="vak.2", beta=-1), - "vak.3": VisualizeInfo(main_tag="vak.3", beta=-1), - "vak.4": VisualizeInfo(main_tag="vak.4", beta=-1), - "vak.5": VisualizeInfo(main_tag="vak.5", beta=-1), - "vak.6": VisualizeInfo(main_tag="vak.6", beta=-1), - "vak.7": VisualizeInfo(main_tag="vak.7", beta=-1), - "vak.8": VisualizeInfo(main_tag="vak.8", beta=-1), - "vak.9": VisualizeInfo(main_tag="vak.9", beta=-1), - "vak.10": VisualizeInfo(main_tag="vak.10", beta=-1), - "vak.11": VisualizeInfo(main_tag="vak.11", beta=-1), - "vak.12": VisualizeInfo(main_tag="vak.12", beta=-1), - "vak.13": VisualizeInfo(main_tag="vak.13", beta=-1), - "vak.14": VisualizeInfo(main_tag="vak.14", beta=-1), - "vak.15": VisualizeInfo(main_tag="vak.15", beta=-1), - "vak.16": VisualizeInfo(main_tag="vak.16", beta=-1), - "vak.17": VisualizeInfo(main_tag="vak.17", beta=-1), - "vak.18": VisualizeInfo(main_tag="vak.18", beta=-1), - "vak.19": VisualizeInfo(main_tag="vak.19", beta=-1), - "vak.20": VisualizeInfo(main_tag="vak.20", beta=-1), - "vak.21": VisualizeInfo(main_tag="vak.21", beta=-1), - "vak.99": VisualizeInfo(main_tag="vak.99", beta=-1), - "traject": VisualizeInfo(main_tag="traject", beta=-1), -} - - -def populate_visualize_dict(uittredepunt_id: int, ondergrondscenario_id: int, app_obj: GeoProbPipe): - - visualize_dict = deepcopy(DICT_VISUALIZE_INFO) - - # Populate uplift, heave and piping for focus scenario - df_filter_limit_states = app_obj.results.df_limit_states.copy(deep=True) - df_filter_limit_states: DataFrame = df_filter_limit_states[ - (df_filter_limit_states["uittredepunt_id"] == uittredepunt_id) & - (df_filter_limit_states["ondergrondscenario_id"] == ondergrondscenario_id) - ] - assert df_filter_limit_states.__len__() == 3 - for row in df_filter_limit_states.itertuples(index=False): - row: Series - visualize_dict[row.model].beta = row.beta - - # Populate scenarios results: other scenarios - df_filter_combined = app_obj.results.df_combined.copy(deep=True) - df_filter_combined: DataFrame = df_filter_combined[ - (df_filter_combined["uittredepunt_id"] == uittredepunt_id) & - (df_filter_combined["ondergrondscenario_id"] != ondergrondscenario_id) - ] - for index, row in enumerate(df_filter_combined.itertuples(index=False)): - row: Series - visualize_dict[f"scenario.{index+2}"].beta = row.beta - visualize_dict[f"scenario.{index+2}"].visible = True - - # Populate scenarios results: focus scenarios - df_filter_combined = app_obj.results.df_combined.copy(deep=True) - df_filter_combined: DataFrame = df_filter_combined[ - (df_filter_combined["uittredepunt_id"] == uittredepunt_id) & - (df_filter_combined["ondergrondscenario_id"] == ondergrondscenario_id) - ] - assert df_filter_combined.__len__() == 1 - for row in df_filter_combined.itertuples(index=False): - row: Series - visualize_dict["scenario.1"].beta = row.beta - visualize_dict["scenario.1"].visible = True - - # Populate vak - - return visualize_dict - - -def generate_overview_flow_chart_with_betas( - uittredepunt_id: int, ondergrondscenario_id: int, app_obj: GeoProbPipe, export_dir: str -): - """ Generates a flow chart that provides an overview what the beta values are per step in the calculation process. - It displays it from the given scenario and uittredepunt, until vak- and traject-level. """ - - dict_to_use = populate_visualize_dict( - uittredepunt_id=uittredepunt_id, ondergrondscenario_id=ondergrondscenario_id, app_obj=app_obj) - - # Read template - svg_text = None - # repo_root = repository_root_path() - path_to_svg = os.path.join( - repo_root, "geoprob_pipe", "graphs", "overview", "Hierarchie_berekeningen_incl_result_tags_v2.svg") - # TODO: Use 'import importlib.resources' for this - with open(path_to_svg, "r", encoding="utf-8") as f: - svg_text = f.read() - if svg_text is None: - raise ValueError - - # Replace tags - for main_tag, info in dict_to_use.items(): - svg_text = svg_text.replace(info.svg_tag_incl_brackets(option="beta"), info.svg_beta) - svg_text = svg_text.replace(info.svg_tag_incl_brackets(option="color"), info.svg_color) - svg_text = svg_text.replace(info.svg_tag_incl_brackets(option="visibility"), info.svg_visibility) - - # Save new svg - with open(os.path.join(export_dir, "results_overview_flow_chart.svg"), "w", encoding="utf-8") as f: - f.write(svg_text) diff --git a/tests/calculations/limit_states/test_piping_lm.py b/tests/calculations/limit_states/test_piping_lm.py index 915cb249..39c0d70a 100644 --- a/tests/calculations/limit_states/test_piping_lm.py +++ b/tests/calculations/limit_states/test_piping_lm.py @@ -134,130 +134,40 @@ def get_data(): # inputs_lm_wbi["d70_m"] = D70_M inputs_lm_wbi_dict = inputs_lm_wbi.to_dict(orient="records") -expected_outputs_lm_wbi = test_data[output_keys_lm_wbi].to_dict( - orient="records") +expected_outputs_lm_wbi = test_data[output_keys_lm_wbi].to_dict(orient="records") -@pytest.mark.parametrize( - "input_data, expected", zip(inputs_lm_wbi_dict, expected_outputs_lm_wbi) -) +@pytest.mark.parametrize("input_data, expected", list(zip(inputs_lm_wbi_dict, expected_outputs_lm_wbi))) def test_limit_state_wbi(input_data, expected): - """Test limit_state_wbi function""" - results = piping_lm.limit_state_wbi( - L_kwelweg=input_data["L_kwelweg"], - buitenwaterstand=input_data["buitenwaterstand"], - polderpeil=input_data["polderpeil"], - mv_exit=input_data["mv_exit"], - top_zand=input_data["top_zand"], - r_exit=input_data["r_exit"], - k_wvp=input_data["k_wvp"], - D_wvp=input_data["D_wvp"], - d70=input_data["d70"], - gamma_sat_deklaag=input_data["gamma_sat_deklaag"], - modelfactor_u=input_data["modelfactor_u"], - modelfactor_h=input_data["modelfactor_h"], - modelfactor_p=input_data["modelfactor_p"], - modelfactor_ff=input_data["modelfactor_ff"], - modelfactor_3d=input_data["modelfactor_3d"], - modelfactor_aniso=input_data["modelfactor_aniso"], - modelfactor_ml=input_data["modelfactor_ml"], - i_c_h=input_data["i_c_h"], - r_c_deklaag=input_data["r_c_deklaag"], - d70_m=input_data["d70_m"], - gamma_korrel=input_data["gamma_korrel"], - v=input_data["v"], - theta=input_data["theta"], - eta=input_data["eta"], - g=input_data["g"], - gamma_water=input_data["gamma_water"], - ) - assert results[0] == pytest.approx(expected["z_u"], rel=1e-3) - assert results[1] == pytest.approx(expected["z_h"], rel=1e-3) - assert results[2] == pytest.approx(expected["z_p"], rel=1e-3) - assert results[3] == pytest.approx(expected["z_combin"], rel=1e-3) - assert results[4] == pytest.approx(expected["h_exit"], rel=1e-3) - assert results[5] == pytest.approx(expected["phi_exit"], rel=1e-3) - assert results[6] == pytest.approx(expected["dphi_c_u"], rel=1e-3) - assert results[7] == pytest.approx(expected["i_exit"], rel=1e-3) - assert results[8] == pytest.approx(expected["dh_c"], rel=1e-3) - assert results[9] == pytest.approx(expected["dh_red"], rel=1e-3) + """ Test limit_state_wbi function. """ + results = piping_lm.limit_state_wbi(**input_data) + result_keys = CALCULATION_MAPPER["wbi"]["system_return_parameter_keys"] + for index, result_key in enumerate(result_keys): + assert results[index] == pytest.approx(expected[result_key], rel=1e-3) # extract inputs and expected outputs for limit state_model4a -inputs_lm_model4a = test_data.loc[:, input_keys_lm_model4a].to_dict( - orient="records") -expected_outputs_lm_model4a = test_data[output_keys_lm_model4a].to_dict( - orient="records" -) +inputs_lm_model4a = test_data.loc[:, input_keys_lm_model4a].to_dict(orient="records") +expected_outputs_lm_model4a = test_data[output_keys_lm_model4a].to_dict(orient="records") -@pytest.mark.parametrize( - "input_data, expected", zip(inputs_lm_model4a, expected_outputs_lm_model4a) -) +@pytest.mark.parametrize("input_data, expected", list(zip(inputs_lm_model4a, expected_outputs_lm_model4a))) def test_limit_state_model4a(input_data, expected): - """Test limit_state_model4a function""" - results = piping_lm.limit_state_model4a( - L_intrede=input_data["L_intrede"], - L_but=input_data["L_but"], - L_bit=input_data["L_bit"], - L_achterland=input_data["L_achterland"], - buitenwaterstand=input_data["buitenwaterstand"], - polderpeil=input_data["polderpeil"], - mv_exit=input_data["mv_exit"], - top_zand=input_data["top_zand"], - kD_wvp=input_data["kD_wvp"], - D_wvp=input_data["D_wvp"], - d70=input_data["d70"], - gamma_sat_deklaag=input_data["gamma_sat_deklaag"], - c_voorland=input_data["c_voorland"], - c_achterland=input_data["c_achterland"], - modelfactor_u=input_data["modelfactor_u"], - modelfactor_h=input_data["modelfactor_h"], - modelfactor_p=input_data["modelfactor_p"], - modelfactor_ff=input_data["modelfactor_ff"], - modelfactor_3d=input_data["modelfactor_3d"], - modelfactor_aniso=input_data["modelfactor_aniso"], - modelfactor_ml=input_data["modelfactor_ml"], - i_c_h=input_data["i_c_h"], - r_c_deklaag=input_data["r_c_deklaag"], - d70_m=input_data["d70_m"], - gamma_korrel=input_data["gamma_korrel"], - v=input_data["v"], - theta=input_data["theta"], - eta=input_data["eta"], - g=input_data["g"], - gamma_water=input_data["gamma_water"], - ) - assert results[0] == pytest.approx(expected["z_u"], rel=1e-3) - assert results[1] == pytest.approx(expected["z_h"], rel=1e-3) - assert results[2] == pytest.approx(expected["z_p"], rel=1e-3) - assert results[3] == pytest.approx(expected["z_combin"], rel=1e-3) - assert results[4] == pytest.approx(expected["h_exit"], rel=1e-3) - assert results[5] == pytest.approx(expected["r_exit"], rel=1) - assert results[6] == pytest.approx(expected["phi_exit"], rel=1e-3) - assert results[7] == pytest.approx(expected["d_deklaag"], rel=1e-3) - assert results[8] == pytest.approx(expected["dphi_c_u"], rel=1e-3) - assert results[9] == pytest.approx(expected["i_exit"], rel=1e-3) - assert results[10] == pytest.approx(expected["L_voorland"], rel=1e-3) - assert results[11] == pytest.approx(expected["lambda_voorland"], rel=1e-3) - assert results[12] == pytest.approx(expected["W_voorland"], rel=1e-3) - assert results[13] == pytest.approx(expected["L_kwelweg"], rel=1e-3) - assert results[14] == pytest.approx(expected["dh_c"], rel=1e-3) - assert results[15] == pytest.approx(expected["dh_red"], rel=1e-3) + """ Test limit_state_model4a function. """ + results = piping_lm.limit_state_model4a(**input_data) + result_keys = CALCULATION_MAPPER["model4a"]["system_return_parameter_keys"] + for index, result_key in enumerate(result_keys): + assert results[index] == pytest.approx(expected[result_key], rel=1e-3) # extract inputs and expected outputs for limit_state_moria -inputs_lm_moria = test_data.loc[:, input_keys_lm_moria].to_dict( - orient="records") -expected_outputs_lm_moria = test_data[output_keys_lm_moria].to_dict( - orient="records") +inputs_lm_moria = test_data.loc[:, input_keys_lm_moria].to_dict(orient="records") +expected_outputs_lm_moria = test_data[output_keys_lm_moria].to_dict(orient="records") -@pytest.mark.parametrize( - "input_data, expected", zip(inputs_lm_moria, expected_outputs_lm_moria) -) +@pytest.mark.parametrize("input_data, expected", list(zip(inputs_lm_moria, expected_outputs_lm_moria))) def test_limit_state_moria(input_data, expected): - """Test limit_state_moria function""" + """ Test limit_state_moria function. """ results = piping_lm.limit_state_moria(**input_data) result_keys = CALCULATION_MAPPER["moria"]["system_return_parameter_keys"] for index, result_key in enumerate(result_keys): diff --git a/tests/calculations/physical_components/test_piping.py b/tests/calculations/physical_components/test_piping.py index 41b231a9..f928d8d6 100644 --- a/tests/calculations/physical_components/test_piping.py +++ b/tests/calculations/physical_components/test_piping.py @@ -168,22 +168,22 @@ def get_data_calc_dh_c(): ) -@pytest.mark.parametrize( - "inputs, expected", zip(inputs_calc_dh_c, expected_outputs_calc_dh_c) -) +@pytest.mark.parametrize("inputs, expected", list(zip(inputs_calc_dh_c, expected_outputs_calc_dh_c))) def test_calc_dh_c(inputs, expected): - """Test calc_dh_c function with multiple test cases from Excel file""" - result = piping.calc_dh_c( - d70=inputs["d70"], - D_wvp=inputs["D_wvp"], - kD_wvp=inputs["kD_wvp"], - L_kwelweg=inputs["L_kwelweg"], - gamma_water=inputs["gamma_water"], - g=G, - v=V, - theta=THETA, - eta=ETA, - d70_m=D70_M, - gamma_korrel=GAMMA_KORREL, - ) + """ Test calc_dh_c function with multiple test cases from Excel file. """ + # result = piping.calc_dh_c(**inputs) + # result = piping.calc_dh_c( + # d70=inputs["d70"], + # D_wvp=inputs["D_wvp"], + # kD_wvp=inputs["kD_wvp"], + # L_kwelweg=inputs["L_kwelweg"], + # gamma_water=inputs["gamma_water"], + # g=G, + # v=V, + # theta=THETA, + # eta=ETA, + # d70_m=D70_M, + # gamma_korrel=GAMMA_KORREL, + # ) + result = piping.calc_dh_c(g=G, v=V, theta=THETA, eta=ETA, d70_m=D70_M, gamma_korrel=GAMMA_KORREL, **inputs) assert result == pytest.approx(expected["dh_c"], 0.01) diff --git a/tests/calculations/systems/test_build_and_run.py b/tests/calculations/systems/test_build_and_run.py index bf851b6c..5f35ba53 100644 --- a/tests/calculations/systems/test_build_and_run.py +++ b/tests/calculations/systems/test_build_and_run.py @@ -9,7 +9,8 @@ def test_worker(): app_settings = ApplicationSettings() repo_root = repository_root_path() - filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", "Traject224_MORIA_WBN_prob.geoprob_pipe.gpkg") + filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", "unit_testset_dt224.geoprob_pipe.gpkg") + assert os.path.exists(filepath) app_settings.workspace_dir = os.path.dirname(filepath) app_settings.geopackage_filename = os.path.basename(filepath) model = app_settings.geohydrologisch_model @@ -17,7 +18,37 @@ def test_worker(): geohydrologisch_model=model, geopackage_filepath=filepath, to_run_vakken_ids=None) - result = _worker(row_unique={'uittredepunt_id': 1, 'ondergrondscenario_naam': 'scenario1', 'vak_id': 4}) + _ = _worker(row_unique={'uittredepunt_id': 1, 'ondergrondscenario_naam': 'scenario1', 'vak_id': 4}) + + ## + + +def test_collect_df_and_worker(): + + ## + + from geoprob_pipe import SystemCalculation + from geoprob_pipe.results.construct_dataframes import collect_df_beta_scenario_final + from geoprob_pipe.calculations.systems.mappers.calculations import CALCULATION_MAPPER + import os + from repo_utils.utils import repository_root_path + from geoprob_pipe.calculations.systems.build_and_run import _worker + + repo_root = repository_root_path() + geopackage_filepath: str = os.path.join( + repo_root, "tests", "systeem_testen", "224", "unit_testset_dt224.geoprob_pipe.gpkg") + builder = CALCULATION_MAPPER["model4a"]["system_builder"]( + geopackage_filepath=geopackage_filepath, to_run_vakken_ids=None) + row_unique = {'uittredepunt_id': 1, 'ondergrondscenario_naam': 'PL', 'vak_id': 0} + calc: SystemCalculation = builder.build_instance(row_unique=row_unique) + calc.run() + _ = collect_df_beta_scenario_final(calc) + + # Worker + _ = _worker(row_unique) + row_unique = {'uittredepunt_id': 1, 'ondergrondscenario_naam': 'HL', 'vak_id': 0} + # Additional run where reliability project is chosen, instead of combine project + _ = _worker(row_unique) ## @@ -32,7 +63,8 @@ def test_build_and_run_system_calculations(): app_settings = ApplicationSettings() repo_root = repository_root_path() - filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", "Traject224_MORIA_WBN_prob.geoprob_pipe.gpkg") + filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", "unit_testset_dt224.geoprob_pipe.gpkg") + assert os.path.exists(filepath) app_settings.workspace_dir = os.path.dirname(filepath) app_settings.geopackage_filename = os.path.basename(filepath) app_settings.to_run = "vakken:4,5" diff --git a/geoprob_pipe/visualizations/other/overview/__init__.py b/tests/cmd_app/comparisons/__init__.py similarity index 100% rename from geoprob_pipe/visualizations/other/overview/__init__.py rename to tests/cmd_app/comparisons/__init__.py diff --git a/tests/cmd_app/comparisons/test_collector.py b/tests/cmd_app/comparisons/test_collector.py new file mode 100644 index 00000000..860f3e33 --- /dev/null +++ b/tests/cmd_app/comparisons/test_collector.py @@ -0,0 +1,21 @@ + + +def test_collector(): + ## + + from geoprob_pipe.cmd_app.comparisons import ComparisonCollector + import os + import shutil + from repo_utils.utils import repository_root_path + + export_dir = os.path.join(os.getcwd(), "tmp_exports", "comparison_collector") + os.makedirs(export_dir, exist_ok=True) + repo_root = repository_root_path() + filepath1 = os.path.join(repo_root, "tests", "systeem_testen", "224", "unit_testset_dt224.geoprob_pipe.gpkg") + filepath2 = os.path.join( + repo_root, "tests", "systeem_testen", "224", "unit_testset_dt224_for_comparison.geoprob_pipe.gpkg") + obj = ComparisonCollector(geopackage_filepath_1=filepath1, geopackage_filepath_2=filepath2, export_dir=export_dir) + obj.create_and_export_figures() + shutil.rmtree(export_dir) + + ## diff --git a/tests/cmd_app/spatial_layers/__init__.py b/tests/cmd_app/spatial_layers/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/cmd_app/spatial_layers/test_vakindeling.py b/tests/cmd_app/spatial_layers/test_vakindeling.py new file mode 100644 index 00000000..6173a130 --- /dev/null +++ b/tests/cmd_app/spatial_layers/test_vakindeling.py @@ -0,0 +1,94 @@ + + +def test_vakindeling(): + + ## + + import geoprob_pipe.cmd_app.spatial_layers.vakindeling as vakindeling_cmd + from geoprob_pipe.cmd_app.cmd import ApplicationSettings + from geopandas import GeoDataFrame, read_file + from repo_utils.utils import repository_root_path + import os + import shutil + + app_settings = ApplicationSettings() + repo_root = repository_root_path() + filepath = os.path.join( + repo_root, "tests", "systeem_testen", "224", "input_steps", "step04_load_hrd.geoprob_pipe.gpkg") + app_settings.workspace_dir = os.path.dirname(filepath) + app_settings.geopackage_filename = os.path.basename(filepath) + root_dir: str = os.path.join(repo_root, "tests", "systeem_testen", "224", "input_steps") + + # Template file + filepath = os.path.join(root_dir, "step03_load_vakindeling.geoprob_pipe.gpkg") + filepath_test = os.path.join(root_dir, "test.geoprob_pipe.gpkg") + shutil.copy2(src=filepath, dst=filepath_test) + + # Load test data + filepath_data = os.path.join(root_dir, "step04_load_hrd.geoprob_pipe.gpkg") + gdf_vakindeling: GeoDataFrame = read_file(filepath_data, layer="vakindeling") + + # Perform test step03 (not loaded yet) + app_settings = ApplicationSettings() + app_settings.workspace_dir = os.path.dirname(filepath_test) + app_settings.geopackage_filename = os.path.basename(filepath_test) + vakindeling_cmd.validate_vakindeling(gdf=gdf_vakindeling) + vakindeling_cmd.align_vak_shp_to_dijktraject( + app_settings=app_settings, gdf_vakindeling=gdf_vakindeling, kolom_vak_naam="naam", kolom_vak_id="id") + + # Remove test file + os.remove(filepath_test) + + ## Vak indeling filepath + + assert vakindeling_cmd.validity_vakindeling_filepath(f"{filepath_data}.shpp") is False # Wrong extension + assert vakindeling_cmd.validity_vakindeling_filepath(f"{filepath_data}.gpkg") is False # Double .gpkg.gpkg + assert vakindeling_cmd.validity_vakindeling_filepath(f"{filepath_data}.gdb") is False # Does not exist + assert vakindeling_cmd.validity_vakindeling_filepath(f"{filepath_data}.shp") is False # Does not exist + assert vakindeling_cmd.validity_vakindeling_filepath(filepath_data) is True + + ## Vak indeling layer name in Geopackage + + assert vakindeling_cmd.validity_layer_name_geopackage(filepath_data, "listlayers") is False + assert vakindeling_cmd.validity_layer_name_geopackage(filepath_data, "non_existent") is False + assert vakindeling_cmd.validity_layer_name_geopackage(filepath_data, "vakindeling") is True + + ## Import from geopackage + + _ = vakindeling_cmd.import_from_geopackage(filepath=filepath_data, unit_test_layer_name="vakindeling") + + ## Vak indeling vaknaam + + assert vakindeling_cmd.validity_column_vaknaam(column_name="listcolumns", gdf=gdf_vakindeling) is False + assert vakindeling_cmd.validity_column_vaknaam(column_name="non_existent", gdf=gdf_vakindeling) is False + assert vakindeling_cmd.validity_column_vaknaam(column_name="naam", gdf=gdf_vakindeling) is True + + ## Vak indeling ID + + # List columns (correct, but for process returns also False) + assert vakindeling_cmd.validity_column_vak_id(column_name="listcolumns", gdf=gdf_vakindeling) is False + + # Non-existent column + assert vakindeling_cmd.validity_column_vak_id(column_name="non_existent", gdf=gdf_vakindeling) is False + + # Not unique + gdf_vakindeling['non_unique'] = "non_unique_value" + assert vakindeling_cmd.validity_column_vak_id(column_name="non_unique", gdf=gdf_vakindeling) is False + + # Not integers + assert vakindeling_cmd.validity_column_vak_id(column_name="naam", gdf=gdf_vakindeling) is False + + # Correct value + assert vakindeling_cmd.validity_column_vak_id(column_name="id", gdf=gdf_vakindeling) is True + + ## + + # Perform test step03 (already loaded) + app_settings = ApplicationSettings() + app_settings.workspace_dir = os.path.dirname(filepath_data) + app_settings.geopackage_filename = os.path.basename(filepath_data) + + # Perform test + vakindeling_cmd.check_validity_vakindeling(app_settings=app_settings) + + ## \ No newline at end of file diff --git a/tests/input_data/test_traject_normering.py b/tests/input_data/test_traject_normering.py index 2620ed3d..7c400159 100644 --- a/tests/input_data/test_traject_normering.py +++ b/tests/input_data/test_traject_normering.py @@ -10,8 +10,8 @@ def test_class_traject_normering(): app_settings = ApplicationSettings() repo_root = repository_root_path() - # filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", "Traject224_MORIA_WBN_prob.geoprob_pipe.gpkg") - filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", "Traject224_v2.2.3.geoprob_pipe.gpkg") + filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", "unit_testset_dt224.geoprob_pipe.gpkg") + assert os.path.exists(filepath) app_settings.workspace_dir = os.path.dirname(filepath) app_settings.geopackage_filename = os.path.basename(filepath) diff --git a/tests/questionnaire/test_pre_processing.py b/tests/questionnaire/test_pre_processing.py index e61ad59b..78f7677f 100644 --- a/tests/questionnaire/test_pre_processing.py +++ b/tests/questionnaire/test_pre_processing.py @@ -14,4 +14,6 @@ def test_questionnaire(): app_settings.workspace_dir = os.path.join(repo_root, "geoprob_pipe", "questionnaire", "test_files") app_settings.geopackage_filename = os.path.basename("Analyse224.geoprob_pipe.gpkg") + # TODO: Deze test is nog niet afgerond. De questionnaire is hier nog niet getest. + ## diff --git a/tests/systeem_testen/224/Traject224_MORIA_WBN_det_corr.geoprob_pipe.gpkg b/tests/systeem_testen/224/_vervallen/Traject224_MORIA_WBN_det_corr.geoprob_pipe.gpkg similarity index 100% rename from tests/systeem_testen/224/Traject224_MORIA_WBN_det_corr.geoprob_pipe.gpkg rename to tests/systeem_testen/224/_vervallen/Traject224_MORIA_WBN_det_corr.geoprob_pipe.gpkg diff --git a/tests/systeem_testen/224/Traject224_MORIA_WBN_det_uncorr.geoprob_pipe.gpkg b/tests/systeem_testen/224/_vervallen/Traject224_MORIA_WBN_det_uncorr.geoprob_pipe.gpkg similarity index 100% rename from tests/systeem_testen/224/Traject224_MORIA_WBN_det_uncorr.geoprob_pipe.gpkg rename to tests/systeem_testen/224/_vervallen/Traject224_MORIA_WBN_det_uncorr.geoprob_pipe.gpkg diff --git a/tests/systeem_testen/224/Traject224_MORIA_WBN_prob.geoprob_pipe.gpkg b/tests/systeem_testen/224/_vervallen/Traject224_MORIA_WBN_prob.geoprob_pipe.gpkg similarity index 100% rename from tests/systeem_testen/224/Traject224_MORIA_WBN_prob.geoprob_pipe.gpkg rename to tests/systeem_testen/224/_vervallen/Traject224_MORIA_WBN_prob.geoprob_pipe.gpkg diff --git a/tests/systeem_testen/224/Traject224_model4a_WBN_prob.geoprob_pipe.gpkg b/tests/systeem_testen/224/_vervallen/Traject224_model4a_WBN_prob.geoprob_pipe.gpkg similarity index 100% rename from tests/systeem_testen/224/Traject224_model4a_WBN_prob.geoprob_pipe.gpkg rename to tests/systeem_testen/224/_vervallen/Traject224_model4a_WBN_prob.geoprob_pipe.gpkg diff --git a/tests/systeem_testen/224/Traject224_v2.2.3.geoprob_pipe.gpkg b/tests/systeem_testen/224/_vervallen/Traject224_v2.2.3.geoprob_pipe.gpkg similarity index 100% rename from tests/systeem_testen/224/Traject224_v2.2.3.geoprob_pipe.gpkg rename to tests/systeem_testen/224/_vervallen/Traject224_v2.2.3.geoprob_pipe.gpkg diff --git a/tests/systeem_testen/224/ahn/ahn.tif b/tests/systeem_testen/224/_vervallen/ahn/ahn.tif similarity index 100% rename from tests/systeem_testen/224/ahn/ahn.tif rename to tests/systeem_testen/224/_vervallen/ahn/ahn.tif diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/delta_beta_map.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/delta_beta_map.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/delta_beta_map.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/delta_beta_map.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/delta_beta_map.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/delta_beta_map.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/delta_beta_map.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/delta_beta_map.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_beta.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_beta.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_beta.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_beta.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_beta.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_beta.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_beta.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_beta.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_heave.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_heave.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_heave.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_heave.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_heave.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_heave.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_heave.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_heave.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_piping.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_piping.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_piping.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_piping.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_piping.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_piping.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_piping.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_piping.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_uplift.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_uplift.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_uplift.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_uplift.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_uplift.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_uplift.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_uplift.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/dumbbell_uplift.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/ratio_beta_map.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/ratio_beta_map.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/ratio_beta_map.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/ratio_beta_map.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/ratio_beta_map.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/ratio_beta_map.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/ratio_beta_map.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1059/ratio_beta_map.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/delta_beta_map.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/delta_beta_map.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/delta_beta_map.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/delta_beta_map.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/delta_beta_map.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/delta_beta_map.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/delta_beta_map.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/delta_beta_map.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_beta.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_beta.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_beta.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_beta.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_beta.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_beta.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_beta.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_beta.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_heave.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_heave.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_heave.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_heave.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_heave.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_heave.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_heave.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_heave.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_piping.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_piping.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_piping.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_piping.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_piping.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_piping.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_piping.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_piping.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_uplift.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_uplift.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_uplift.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_uplift.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_uplift.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_uplift.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_uplift.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/dumbbell_uplift.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/ratio_beta_map.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/ratio_beta_map.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/ratio_beta_map.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/ratio_beta_map.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/ratio_beta_map.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/ratio_beta_map.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/ratio_beta_map.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1105/ratio_beta_map.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/delta_beta_map.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/delta_beta_map.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/delta_beta_map.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/delta_beta_map.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/delta_beta_map.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/delta_beta_map.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/delta_beta_map.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/delta_beta_map.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_beta.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_beta.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_beta.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_beta.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_beta.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_beta.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_beta.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_beta.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_heave.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_heave.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_heave.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_heave.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_heave.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_heave.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_heave.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_heave.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_piping.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_piping.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_piping.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_piping.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_piping.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_piping.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_piping.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_piping.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_uplift.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_uplift.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_uplift.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_uplift.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_uplift.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_uplift.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_uplift.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/dumbbell_uplift.png diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/ratio_beta_map.html b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/ratio_beta_map.html similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/ratio_beta_map.html rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/ratio_beta_map.html diff --git a/tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/ratio_beta_map.png b/tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/ratio_beta_map.png similarity index 100% rename from tests/systeem_testen/224/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/ratio_beta_map.png rename to tests/systeem_testen/224/_vervallen/comparisons/Traject224_model4a_WBN_prob_Traject224_MORIA_WBN_prob_2026-01-07_1109/ratio_beta_map.png diff --git a/tests/systeem_testen/224/frag_csv_files/041-02_0040_9_WA_km0897_hfreq.csv b/tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0040_9_WA_km0897_hfreq.csv similarity index 100% rename from tests/systeem_testen/224/frag_csv_files/041-02_0040_9_WA_km0897_hfreq.csv rename to tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0040_9_WA_km0897_hfreq.csv diff --git a/tests/systeem_testen/224/frag_csv_files/041-02_0041_9_WA_km0897_hfreq.csv b/tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0041_9_WA_km0897_hfreq.csv similarity index 100% rename from tests/systeem_testen/224/frag_csv_files/041-02_0041_9_WA_km0897_hfreq.csv rename to tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0041_9_WA_km0897_hfreq.csv diff --git a/tests/systeem_testen/224/frag_csv_files/041-02_0042_9_WA_km0897_hfreq.csv b/tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0042_9_WA_km0897_hfreq.csv similarity index 100% rename from tests/systeem_testen/224/frag_csv_files/041-02_0042_9_WA_km0897_hfreq.csv rename to tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0042_9_WA_km0897_hfreq.csv diff --git a/tests/systeem_testen/224/frag_csv_files/041-02_0043_9_WA_km0897_hfreq.csv b/tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0043_9_WA_km0897_hfreq.csv similarity index 100% rename from tests/systeem_testen/224/frag_csv_files/041-02_0043_9_WA_km0897_hfreq.csv rename to tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0043_9_WA_km0897_hfreq.csv diff --git a/tests/systeem_testen/224/frag_csv_files/041-02_0044_9_WA_km0897_hfreq.csv b/tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0044_9_WA_km0897_hfreq.csv similarity index 100% rename from tests/systeem_testen/224/frag_csv_files/041-02_0044_9_WA_km0897_hfreq.csv rename to tests/systeem_testen/224/_vervallen/frag_csv_files/041-02_0044_9_WA_km0897_hfreq.csv diff --git a/tests/systeem_testen/224/hrd_files/WBI2017_Bovenrijn_224_v04.config.sqlite b/tests/systeem_testen/224/hrd_files/WBI2017_Bovenrijn_224_v04.config.sqlite deleted file mode 100644 index 73f3e89d..00000000 Binary files a/tests/systeem_testen/224/hrd_files/WBI2017_Bovenrijn_224_v04.config.sqlite and /dev/null differ diff --git a/tests/systeem_testen/224/hrd_files/WBI2017_Bovenrijn_224_v04.sqlite b/tests/systeem_testen/224/hrd_files/WBI2017_Bovenrijn_224_v04.sqlite deleted file mode 100644 index a57dfd7d..00000000 Binary files a/tests/systeem_testen/224/hrd_files/WBI2017_Bovenrijn_224_v04.sqlite and /dev/null differ diff --git a/tests/systeem_testen/224/hrd_files/hlcd.sqlite b/tests/systeem_testen/224/hrd_files/hlcd.sqlite deleted file mode 100644 index 1bf2956e..00000000 Binary files a/tests/systeem_testen/224/hrd_files/hlcd.sqlite and /dev/null differ diff --git a/tests/systeem_testen/224/input_steps/step01_select_geohydrological_model.geoprob_pipe.gpkg b/tests/systeem_testen/224/input_steps/step01_select_geohydrological_model.geoprob_pipe.gpkg new file mode 100644 index 00000000..34798607 Binary files /dev/null and b/tests/systeem_testen/224/input_steps/step01_select_geohydrological_model.geoprob_pipe.gpkg differ diff --git a/tests/systeem_testen/224/input_steps/step02_load_ref_line.geoprob_pipe.gpkg b/tests/systeem_testen/224/input_steps/step02_load_ref_line.geoprob_pipe.gpkg new file mode 100644 index 00000000..bc56cd84 Binary files /dev/null and b/tests/systeem_testen/224/input_steps/step02_load_ref_line.geoprob_pipe.gpkg differ diff --git a/tests/systeem_testen/224/input_steps/step03_load_vakindeling.geoprob_pipe.gpkg b/tests/systeem_testen/224/input_steps/step03_load_vakindeling.geoprob_pipe.gpkg new file mode 100644 index 00000000..45b322eb Binary files /dev/null and b/tests/systeem_testen/224/input_steps/step03_load_vakindeling.geoprob_pipe.gpkg differ diff --git a/tests/systeem_testen/224/input_steps/step04_load_hrd.geoprob_pipe.gpkg b/tests/systeem_testen/224/input_steps/step04_load_hrd.geoprob_pipe.gpkg new file mode 100644 index 00000000..c0c2be9b Binary files /dev/null and b/tests/systeem_testen/224/input_steps/step04_load_hrd.geoprob_pipe.gpkg differ diff --git a/tests/systeem_testen/224/input_steps/stepN.geoprob_pipe.gpkg b/tests/systeem_testen/224/input_steps/stepN.geoprob_pipe.gpkg new file mode 100644 index 00000000..c0c2be9b Binary files /dev/null and b/tests/systeem_testen/224/input_steps/stepN.geoprob_pipe.gpkg differ diff --git a/tests/systeem_testen/224/unit_testset_dt224.geoprob_pipe.gpkg b/tests/systeem_testen/224/unit_testset_dt224.geoprob_pipe.gpkg new file mode 100644 index 00000000..8d29d7cf Binary files /dev/null and b/tests/systeem_testen/224/unit_testset_dt224.geoprob_pipe.gpkg differ diff --git a/tests/systeem_testen/224/unit_testset_dt224_for_comparison.geoprob_pipe.gpkg b/tests/systeem_testen/224/unit_testset_dt224_for_comparison.geoprob_pipe.gpkg new file mode 100644 index 00000000..4267aa71 Binary files /dev/null and b/tests/systeem_testen/224/unit_testset_dt224_for_comparison.geoprob_pipe.gpkg differ diff --git a/tests/test_system.py b/tests/test_system.py index 70e8c0cd..61a55700 100644 --- a/tests/test_system.py +++ b/tests/test_system.py @@ -2,28 +2,22 @@ def test_system(): ## - if __name__ == "__main__": - from repo_utils.utils import repository_root_path - from geoprob_pipe import GeoProbPipe - import os - repo_root = repository_root_path() - from geoprob_pipe.cmd_app.cmd import ApplicationSettings - file_names = [ - # "Traject224_MORIA_WBN_det_corr.geoprob_pipe.gpkg", - # "Traject224_MORIA_WBN_det_uncorr.geoprob_pipe.gpkg", - "Traject224_MORIA_WBN_prob.geoprob_pipe.gpkg", - # "Traject224_model4a_WBN_prob.geoprob_pipe.gpkg", - # "Traject224_WBI_WBN_prob.geoprob_pipe.gpkg", # TODO - ] + from repo_utils.utils import repository_root_path + from geoprob_pipe import GeoProbPipe + import os + repo_root = repository_root_path() + from geoprob_pipe.cmd_app.cmd import ApplicationSettings - for file_name in file_names: - print(f"\nNow running {file_name}") - app_settings = ApplicationSettings() - filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", file_name) - app_settings.workspace_dir = os.path.dirname(filepath) - app_settings.geopackage_filename = os.path.basename(filepath) - geoprob_pipe = GeoProbPipe(app_settings) - geoprob_pipe.export_archive() + file_names = ["unit_testset_dt224.geoprob_pipe.gpkg"] + + for file_name in file_names: + print(f"\nNow running {file_name}") + app_settings = ApplicationSettings() + filepath = os.path.join(repo_root, "tests", "systeem_testen", "224", file_name) + app_settings.workspace_dir = os.path.dirname(filepath) + app_settings.geopackage_filename = os.path.basename(filepath) + geoprob_pipe = GeoProbPipe(app_settings) + geoprob_pipe.export_archive() ##