koswat 0.16.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- koswat-0.16.2/.gitignore +32 -0
- koswat-0.16.2/LICENSE +18 -0
- koswat-0.16.2/PKG-INFO +71 -0
- koswat-0.16.2/README.md +40 -0
- koswat-0.16.2/koswat/README.md +13 -0
- koswat-0.16.2/koswat/__init__.py +1 -0
- koswat-0.16.2/koswat/__main__.py +55 -0
- koswat-0.16.2/koswat/configuration/README.md +13 -0
- koswat-0.16.2/koswat/configuration/__init__.py +0 -0
- koswat-0.16.2/koswat/configuration/io/README.md +7 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/__init__.py +27 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/analysis_section_fom.py +62 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/cofferdam_reinforcement_section_fom.py +74 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/config_section_fom_protocol.py +45 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/config_section_helper.py +155 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/dike_profile_section_fom.py +94 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/infrastructure_section_fom.py +75 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/piping_wall_reinforcement_section_fom.py +81 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/soil_reinforcement_section_fom.py +74 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/stability_wall_reinforcement_section_fom.py +84 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/surroundings_section_fom.py +66 -0
- koswat-0.16.2/koswat/configuration/io/config_sections/vps_reinforcement_section_fom.py +73 -0
- koswat-0.16.2/koswat/configuration/io/csv/__init__.py +0 -0
- koswat-0.16.2/koswat/configuration/io/csv/koswat_simple_surroundings_csv_reader.py +75 -0
- koswat-0.16.2/koswat/configuration/io/csv/koswat_surroundings_csv_fom.py +58 -0
- koswat-0.16.2/koswat/configuration/io/csv/koswat_surroundings_csv_reader.py +105 -0
- koswat-0.16.2/koswat/configuration/io/csv/koswat_traject_surroundings_csv_fom.py +58 -0
- koswat-0.16.2/koswat/configuration/io/json/__init__.py +0 -0
- koswat-0.16.2/koswat/configuration/io/json/koswat_costs_json_fom.py +267 -0
- koswat-0.16.2/koswat/configuration/io/json/koswat_dike_section_input_json_fom.py +54 -0
- koswat-0.16.2/koswat/configuration/io/json/koswat_dike_section_input_json_reader.py +77 -0
- koswat-0.16.2/koswat/configuration/io/json/koswat_general_json_fom.py +99 -0
- koswat-0.16.2/koswat/configuration/io/json/koswat_scenario_list_json_dir_reader.py +57 -0
- koswat-0.16.2/koswat/configuration/io/json/koswat_section_scenario_json_fom.py +75 -0
- koswat-0.16.2/koswat/configuration/io/koswat_costs_importer.py +206 -0
- koswat-0.16.2/koswat/configuration/io/koswat_dike_section_input_list_importer.py +56 -0
- koswat-0.16.2/koswat/configuration/io/koswat_run_settings_importer.py +377 -0
- koswat-0.16.2/koswat/configuration/io/shp/__init__.py +6 -0
- koswat-0.16.2/koswat/configuration/io/shp/koswat_dike_locations_shp_fom.py +65 -0
- koswat-0.16.2/koswat/configuration/io/shp/koswat_dike_locations_shp_reader.py +91 -0
- koswat-0.16.2/koswat/configuration/io/surroundings_wrapper_collection_importer.py +163 -0
- koswat-0.16.2/koswat/configuration/io/txt/koswat_dike_selection_txt_fom.py +36 -0
- koswat-0.16.2/koswat/configuration/koswat_config_protocol.py +36 -0
- koswat-0.16.2/koswat/configuration/settings/README.md +7 -0
- koswat-0.16.2/koswat/configuration/settings/__init__.py +4 -0
- koswat-0.16.2/koswat/configuration/settings/costs/__init__.py +0 -0
- koswat-0.16.2/koswat/configuration/settings/costs/construction_costs_settings.py +84 -0
- koswat-0.16.2/koswat/configuration/settings/costs/dike_profile_costs_settings.py +46 -0
- koswat-0.16.2/koswat/configuration/settings/costs/infastructure_costs_settings.py +46 -0
- koswat-0.16.2/koswat/configuration/settings/costs/koswat_costs_settings.py +55 -0
- koswat-0.16.2/koswat/configuration/settings/costs/surtax_costs_settings.py +80 -0
- koswat-0.16.2/koswat/configuration/settings/koswat_general_settings.py +45 -0
- koswat-0.16.2/koswat/configuration/settings/koswat_run_scenario_settings.py +56 -0
- koswat-0.16.2/koswat/configuration/settings/koswat_run_settings.py +37 -0
- koswat-0.16.2/koswat/configuration/settings/koswat_scenario.py +45 -0
- koswat-0.16.2/koswat/configuration/settings/reinforcements/__init__.py +0 -0
- koswat-0.16.2/koswat/configuration/settings/reinforcements/koswat_cofferdam_settings.py +83 -0
- koswat-0.16.2/koswat/configuration/settings/reinforcements/koswat_piping_wall_settings.py +93 -0
- koswat-0.16.2/koswat/configuration/settings/reinforcements/koswat_reinforcement_settings.py +61 -0
- koswat-0.16.2/koswat/configuration/settings/reinforcements/koswat_soil_settings.py +81 -0
- koswat-0.16.2/koswat/configuration/settings/reinforcements/koswat_stability_wall_settings.py +97 -0
- koswat-0.16.2/koswat/configuration/settings/reinforcements/koswat_vps_settings.py +79 -0
- koswat-0.16.2/koswat/core/README.md +3 -0
- koswat-0.16.2/koswat/core/__init__.py +0 -0
- koswat-0.16.2/koswat/core/geometries/__init__.py +0 -0
- koswat-0.16.2/koswat/core/geometries/calc_library.py +263 -0
- koswat-0.16.2/koswat/core/io/README.md +43 -0
- koswat-0.16.2/koswat/core/io/__init__.py +0 -0
- koswat-0.16.2/koswat/core/io/csv/__init__.py +1 -0
- koswat-0.16.2/koswat/core/io/csv/koswat_csv_fom.py +38 -0
- koswat-0.16.2/koswat/core/io/csv/koswat_csv_fom_protocol.py +39 -0
- koswat-0.16.2/koswat/core/io/csv/koswat_csv_multi_header_fom.py +38 -0
- koswat-0.16.2/koswat/core/io/csv/koswat_csv_reader.py +44 -0
- koswat-0.16.2/koswat/core/io/csv/koswat_csv_writer.py +50 -0
- koswat-0.16.2/koswat/core/io/file_object_model_protocol.py +34 -0
- koswat-0.16.2/koswat/core/io/json/__init__.py +0 -0
- koswat-0.16.2/koswat/core/io/json/koswat_json_fom.py +39 -0
- koswat-0.16.2/koswat/core/io/json/koswat_json_fom_protocol.py +39 -0
- koswat-0.16.2/koswat/core/io/json/koswat_json_reader.py +52 -0
- koswat-0.16.2/koswat/core/io/koswat_exporter_protocol.py +31 -0
- koswat-0.16.2/koswat/core/io/koswat_importer_protocol.py +42 -0
- koswat-0.16.2/koswat/core/io/koswat_reader_protocol.py +54 -0
- koswat-0.16.2/koswat/core/io/koswat_writer_protocol.py +38 -0
- koswat-0.16.2/koswat/core/io/txt/README.md +4 -0
- koswat-0.16.2/koswat/core/io/txt/__init__.py +0 -0
- koswat-0.16.2/koswat/core/io/txt/koswat_txt_fom_protocol.py +41 -0
- koswat-0.16.2/koswat/core/io/txt/koswat_txt_reader.py +47 -0
- koswat-0.16.2/koswat/core/koswat_logger.py +78 -0
- koswat-0.16.2/koswat/core/protocols/__init__.py +1 -0
- koswat-0.16.2/koswat/core/protocols/builder_protocol.py +34 -0
- koswat-0.16.2/koswat/core/protocols/data_object_model_protocol.py +30 -0
- koswat-0.16.2/koswat/cost_report/README.md +14 -0
- koswat-0.16.2/koswat/cost_report/__init__.py +0 -0
- koswat-0.16.2/koswat/cost_report/cost_report_protocol.py +32 -0
- koswat-0.16.2/koswat/cost_report/infrastructure/README.md +3 -0
- koswat-0.16.2/koswat/cost_report/infrastructure/__init__.py +0 -0
- koswat-0.16.2/koswat/cost_report/infrastructure/infrastructure_location_costs.py +56 -0
- koswat-0.16.2/koswat/cost_report/infrastructure/infrastructure_location_profile_cost_report.py +59 -0
- koswat-0.16.2/koswat/cost_report/infrastructure/infrastructure_profile_costs_calculator.py +92 -0
- koswat-0.16.2/koswat/cost_report/infrastructure/multi_infrastructure_profile_costs_calculator.py +85 -0
- koswat-0.16.2/koswat/cost_report/infrastructure/multi_infrastructure_profile_costs_calculator_builder.py +158 -0
- koswat-0.16.2/koswat/cost_report/infrastructure/profile_zone_calculator.py +82 -0
- koswat-0.16.2/koswat/cost_report/io/__init__.py +0 -0
- koswat-0.16.2/koswat/cost_report/io/plots/multi_location_profile_comparison_plot_exporter.py +55 -0
- koswat-0.16.2/koswat/cost_report/io/summary/__init__.py +0 -0
- koswat-0.16.2/koswat/cost_report/io/summary/koswat_summary_exporter.py +60 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_costs/__init__.py +0 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_costs/summary_costs_csv_exporter.py +51 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_costs/summary_costs_csv_fom_builder.py +290 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_infrastructure_costs/__init__.py +0 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_infrastructure_costs/summary_infrastructure_costs_csv_exporter.py +53 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_infrastructure_costs/summary_infrastructure_costs_csv_fom_builder.py +256 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_locations/__init__.py +0 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_locations/cluster_collection_shp_fom.py +144 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_locations/cluster_geodataframe_output_fom.py +60 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_locations/cluster_shp_fom.py +120 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_locations/summary_locations_csv_exporter.py +52 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_locations/summary_locations_csv_fom_builder.py +115 -0
- koswat-0.16.2/koswat/cost_report/io/summary/summary_locations/summary_locations_shp_exporter.py +63 -0
- koswat-0.16.2/koswat/cost_report/multi_location_profile/__init__.py +6 -0
- koswat-0.16.2/koswat/cost_report/multi_location_profile/multi_location_profile_cost_builder.py +80 -0
- koswat-0.16.2/koswat/cost_report/multi_location_profile/multi_location_profile_cost_report.py +116 -0
- koswat-0.16.2/koswat/cost_report/profile/__init__.py +0 -0
- koswat-0.16.2/koswat/cost_report/profile/layer_cost_report.py +46 -0
- koswat-0.16.2/koswat/cost_report/profile/profile_cost_report.py +58 -0
- koswat-0.16.2/koswat/cost_report/profile/profile_cost_report_builder.py +70 -0
- koswat-0.16.2/koswat/cost_report/profile/quantity_cost_parameters.py +153 -0
- koswat-0.16.2/koswat/cost_report/profile/quantity_cost_parameters_builder.py +194 -0
- koswat-0.16.2/koswat/cost_report/profile/quantity_cost_parameters_calculator.py +60 -0
- koswat-0.16.2/koswat/cost_report/summary/__init__.py +2 -0
- koswat-0.16.2/koswat/cost_report/summary/koswat_summary.py +103 -0
- koswat-0.16.2/koswat/cost_report/summary/koswat_summary_builder.py +158 -0
- koswat-0.16.2/koswat/cost_report/summary/koswat_summary_location_matrix_builder.py +183 -0
- koswat-0.16.2/koswat/dike/README.md +19 -0
- koswat-0.16.2/koswat/dike/__init__.py +0 -0
- koswat-0.16.2/koswat/dike/characteristic_points/characteristic_points.py +91 -0
- koswat-0.16.2/koswat/dike/characteristic_points/characteristic_points_builder.py +91 -0
- koswat-0.16.2/koswat/dike/koswat_input_profile_protocol.py +50 -0
- koswat-0.16.2/koswat/dike/koswat_profile_protocol.py +40 -0
- koswat-0.16.2/koswat/dike/layers/__init__.py +2 -0
- koswat-0.16.2/koswat/dike/layers/base_layer/__init__.py +4 -0
- koswat-0.16.2/koswat/dike/layers/base_layer/koswat_base_layer.py +48 -0
- koswat-0.16.2/koswat/dike/layers/base_layer/koswat_base_layer_builder.py +50 -0
- koswat-0.16.2/koswat/dike/layers/coating_layer/__init__.py +4 -0
- koswat-0.16.2/koswat/dike/layers/coating_layer/koswat_coating_layer.py +65 -0
- koswat-0.16.2/koswat/dike/layers/coating_layer/koswat_coating_layer_builder.py +98 -0
- koswat-0.16.2/koswat/dike/layers/koswat_layer_builder_protocol.py +42 -0
- koswat-0.16.2/koswat/dike/layers/koswat_layer_protocol.py +43 -0
- koswat-0.16.2/koswat/dike/layers/layers_wrapper/__init__.py +10 -0
- koswat-0.16.2/koswat/dike/layers/layers_wrapper/koswat_layers_wrapper.py +60 -0
- koswat-0.16.2/koswat/dike/layers/layers_wrapper/koswat_layers_wrapper_builder.py +81 -0
- koswat-0.16.2/koswat/dike/layers/layers_wrapper/koswat_layers_wrapper_builder_protocol.py +45 -0
- koswat-0.16.2/koswat/dike/layers/layers_wrapper/koswat_layers_wrapper_protocol.py +41 -0
- koswat-0.16.2/koswat/dike/material/koswat_material_type.py +32 -0
- koswat-0.16.2/koswat/dike/profile/__init__.py +2 -0
- koswat-0.16.2/koswat/dike/profile/koswat_input_profile_base.py +126 -0
- koswat-0.16.2/koswat/dike/profile/koswat_profile.py +96 -0
- koswat-0.16.2/koswat/dike/profile/koswat_profile_builder.py +92 -0
- koswat-0.16.2/koswat/dike/surroundings/README.md +16 -0
- koswat-0.16.2/koswat/dike/surroundings/__init__.py +0 -0
- koswat-0.16.2/koswat/dike/surroundings/koswat_surroundings_protocol.py +33 -0
- koswat-0.16.2/koswat/dike/surroundings/point/__init__.py +0 -0
- koswat-0.16.2/koswat/dike/surroundings/point/point_obstacle_surroundings.py +70 -0
- koswat-0.16.2/koswat/dike/surroundings/point/point_surroundings.py +135 -0
- koswat-0.16.2/koswat/dike/surroundings/point/point_surroundings_list_polderside_builder.py +71 -0
- koswat-0.16.2/koswat/dike/surroundings/surroundings_enum.py +84 -0
- koswat-0.16.2/koswat/dike/surroundings/surroundings_infrastructure.py +43 -0
- koswat-0.16.2/koswat/dike/surroundings/surroundings_obstacle.py +38 -0
- koswat-0.16.2/koswat/dike/surroundings/wrapper/__init__.py +0 -0
- koswat-0.16.2/koswat/dike/surroundings/wrapper/base_surroundings_wrapper.py +42 -0
- koswat-0.16.2/koswat/dike/surroundings/wrapper/infrastructure_surroundings_wrapper.py +80 -0
- koswat-0.16.2/koswat/dike/surroundings/wrapper/obstacle_surroundings_wrapper.py +104 -0
- koswat-0.16.2/koswat/dike/surroundings/wrapper/surroundings_wrapper.py +60 -0
- koswat-0.16.2/koswat/dike/surroundings/wrapper/surroundings_wrapper_builder.py +153 -0
- koswat-0.16.2/koswat/dike_reinforcements/README.md +24 -0
- koswat-0.16.2/koswat/dike_reinforcements/__init__.py +6 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/__init__.py +20 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/cofferdam/__init__.py +6 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/cofferdam/cofferdam_input_profile.py +46 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/cofferdam/cofferdam_input_profile_calculation.py +162 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/input_profile_enum.py +35 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/piping_wall/__init__.py +6 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/piping_wall/piping_wall_input_profile.py +46 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/piping_wall/piping_wall_input_profile_calculation.py +155 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/reinforcement_input_profile_calculation_base.py +129 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/reinforcement_input_profile_calculation_protocol.py +48 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/reinforcement_input_profile_protocol.py +49 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/soil/__init__.py +6 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/soil/soil_input_profile.py +49 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/soil/soil_input_profile_calculation.py +96 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/stability_wall/__init__.py +6 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/stability_wall/stability_wall_input_profile.py +50 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/stability_wall/stability_wall_input_profile_calculation.py +184 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/vertical_piping_solution/__init__.py +6 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/vertical_piping_solution/vps_input_profile.py +49 -0
- koswat-0.16.2/koswat/dike_reinforcements/input_profile/vertical_piping_solution/vps_input_profile_calculation.py +102 -0
- koswat-0.16.2/koswat/dike_reinforcements/io/reinforced_profile_comparison_plot_exporter.py +57 -0
- koswat-0.16.2/koswat/dike_reinforcements/io/reinforced_profile_plot_exporter.py +89 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_layers/__init__.py +0 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_layers/outside_slope_reinforcement_layers_wrapper_builder.py +163 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_layers/reinforcement_base_layer.py +65 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_layers/reinforcement_coating_layer.py +91 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_layers/reinforcement_layer_protocol.py +33 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_layers/reinforcement_layers_wrapper.py +76 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_layers/standard_reinforcement_layers_wrapper_builder.py +185 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/__init__.py +9 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/__init__.py +18 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/berm_calculated_factors.py +141 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/berm_calculator_base.py +108 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/berm_calculator_factory.py +209 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/berm_calculator_protocol.py +55 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/berm_calculator_result.py +33 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/default_berm_calculator.py +56 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/keep_berm_calculator.py +87 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/no_berm_calculator.py +61 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/piping_berm_calculator.py +76 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/berm_calculator/stability_berm_calculator.py +61 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/outside_slope/__init__.py +3 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/outside_slope/cofferdam_reinforcement_profile.py +39 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/outside_slope/outside_slope_reinforcement_profile.py +28 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/outside_slope/outside_slope_reinforcement_profile_builder.py +81 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/reinforcement_profile.py +46 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/reinforcement_profile_builder_base.py +101 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/reinforcement_profile_builder_factory.py +138 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/reinforcement_profile_builder_protocol.py +49 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/reinforcement_profile_protocol.py +43 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/standard/__init__.py +12 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/standard/piping_wall_reinforcement_profile.py +39 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/standard/soil_reinforcement_profile.py +39 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/standard/stability_wall_reinforcement_profile.py +39 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/standard/standard_reinforcement_profile.py +28 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/standard/standard_reinforcement_profile_builder.py +121 -0
- koswat-0.16.2/koswat/dike_reinforcements/reinforcement_profile/standard/vps_reinforcement_profile.py +39 -0
- koswat-0.16.2/koswat/koswat_handler.py +144 -0
- koswat-0.16.2/koswat/plots/README.md +11 -0
- koswat-0.16.2/koswat/plots/__init__.py +1 -0
- koswat-0.16.2/koswat/plots/dike/__init__.py +3 -0
- koswat-0.16.2/koswat/plots/dike/koswat_layer_plot.py +89 -0
- koswat-0.16.2/koswat/plots/dike/koswat_layers_wrapper_plot.py +68 -0
- koswat-0.16.2/koswat/plots/dike/koswat_profile_plot.py +39 -0
- koswat-0.16.2/koswat/plots/dike/list_koswat_profile_plot.py +42 -0
- koswat-0.16.2/koswat/plots/geometries/__init__.py +1 -0
- koswat-0.16.2/koswat/plots/geometries/highlight_geometry_plot.py +47 -0
- koswat-0.16.2/koswat/plots/koswat_figure_context_handler.py +65 -0
- koswat-0.16.2/koswat/plots/koswat_plot_protocol.py +39 -0
- koswat-0.16.2/koswat/plots/plot_exporter_protocol.py +36 -0
- koswat-0.16.2/koswat/plots/utils.py +32 -0
- koswat-0.16.2/koswat/strategies/README.md +42 -0
- koswat-0.16.2/koswat/strategies/__init__.py +0 -0
- koswat-0.16.2/koswat/strategies/infra_priority_strategy/__init__.py +0 -0
- koswat-0.16.2/koswat/strategies/infra_priority_strategy/infra_cluster.py +100 -0
- koswat-0.16.2/koswat/strategies/infra_priority_strategy/infra_cluster_option.py +91 -0
- koswat-0.16.2/koswat/strategies/infra_priority_strategy/infra_priority_strategy.py +222 -0
- koswat-0.16.2/koswat/strategies/order_strategy/__init__.py +0 -0
- koswat-0.16.2/koswat/strategies/order_strategy/order_cluster.py +144 -0
- koswat-0.16.2/koswat/strategies/order_strategy/order_strategy.py +193 -0
- koswat-0.16.2/koswat/strategies/order_strategy/order_strategy_base.py +51 -0
- koswat-0.16.2/koswat/strategies/order_strategy/order_strategy_buffering.py +95 -0
- koswat-0.16.2/koswat/strategies/order_strategy/order_strategy_clustering.py +103 -0
- koswat-0.16.2/koswat/strategies/strategy_input.py +54 -0
- koswat-0.16.2/koswat/strategies/strategy_location_input.py +112 -0
- koswat-0.16.2/koswat/strategies/strategy_location_reinforcement.py +183 -0
- koswat-0.16.2/koswat/strategies/strategy_output.py +43 -0
- koswat-0.16.2/koswat/strategies/strategy_protocol.py +43 -0
- koswat-0.16.2/koswat/strategies/strategy_reinforcement_input.py +34 -0
- koswat-0.16.2/koswat/strategies/strategy_reinforcement_type_costs.py +46 -0
- koswat-0.16.2/koswat/strategies/strategy_step/__init__.py +0 -0
- koswat-0.16.2/koswat/strategies/strategy_step/strategy_step_assignment.py +32 -0
- koswat-0.16.2/koswat/strategies/strategy_step/strategy_step_enum.py +28 -0
- koswat-0.16.2/pyproject.toml +154 -0
koswat-0.16.2/.gitignore
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
# Environments
|
|
3
|
+
.env
|
|
4
|
+
.venv
|
|
5
|
+
env/
|
|
6
|
+
venv/
|
|
7
|
+
ENV/
|
|
8
|
+
env.bak/
|
|
9
|
+
venv.bak/
|
|
10
|
+
.vscode/
|
|
11
|
+
|
|
12
|
+
# IDEs
|
|
13
|
+
.vscode
|
|
14
|
+
|
|
15
|
+
# Coverages
|
|
16
|
+
.scannerwork/
|
|
17
|
+
*-reports/**
|
|
18
|
+
.coverage
|
|
19
|
+
coverage.xml
|
|
20
|
+
|
|
21
|
+
# Koswat ignore
|
|
22
|
+
tests/test_results/
|
|
23
|
+
tests/test_data/issues/
|
|
24
|
+
site/
|
|
25
|
+
*.log
|
|
26
|
+
|
|
27
|
+
# Local configurations files covered in pyproject.toml
|
|
28
|
+
pytest.ini
|
|
29
|
+
|
|
30
|
+
# pixi environments
|
|
31
|
+
.pixi/*
|
|
32
|
+
!.pixi/config.toml
|
koswat-0.16.2/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
KOSWAT, from the dutch combination of words `Kosts-Wat` (what are the costs)
|
|
5
|
+
Copyright (C) 2025 Stichting Deltares
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
koswat-0.16.2/PKG-INFO
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: koswat
|
|
3
|
+
Version: 0.16.2
|
|
4
|
+
Summary: Koswat, from the dutch combination of words `Kosts-Wat` (what are the costs). Analyzes all the possible dikes reinforcements based on a provided traject, with surrounding constructions, and what their related costs will be.
|
|
5
|
+
Project-URL: homepage, https://github.com/Deltares/koswat
|
|
6
|
+
Project-URL: documentation, https://deltares.github.io/Koswat/
|
|
7
|
+
Project-URL: repository, https://github.com/Deltares/koswat
|
|
8
|
+
Project-URL: issues, https://github.com/Deltares/koswat/issues
|
|
9
|
+
Author-email: Peter de Grave <peter.degrave@deltares.nl>
|
|
10
|
+
Maintainer-email: "Carles S. Soriano Pérez" <carles.sorianoperez@deltares.nl>, Ardt Klapwijk <ardt.klapwijk@deltares.nl>
|
|
11
|
+
License-Expression: GPL-3.0-or-later
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: civil-engineering,deltares,dikes,flood-defence
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: <3.15,>=3.11
|
|
24
|
+
Requires-Dist: click
|
|
25
|
+
Requires-Dist: geopandas
|
|
26
|
+
Requires-Dist: matplotlib
|
|
27
|
+
Requires-Dist: more-itertools
|
|
28
|
+
Requires-Dist: pyshp
|
|
29
|
+
Requires-Dist: shapely
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# KOSWAT
|
|
33
|
+
|
|
34
|
+
[](https://www.python.org/downloads/release/python-31110/)
|
|
35
|
+
[](https://www.python.org/downloads/release/python-31212/)
|
|
36
|
+
[](https://www.python.org/downloads/release/python-31311/)
|
|
37
|
+
[](https://www.python.org/downloads/release/python-3143/)
|
|
38
|
+
|
|
39
|
+
[](https://github.com/psf/black)
|
|
40
|
+
[](https://github.com/Deltares/Koswat/actions/workflows/ci_installation.yml)
|
|
41
|
+

|
|
42
|
+
[](https://sonarcloud.io/summary/new_code?id=Deltares_Koswat)
|
|
43
|
+
[](https://github.com/Deltares/koswat/actions/workflows/deploy_docs.yml)
|
|
44
|
+
[](https://mybinder.org/v2/gh/Deltares/koswat/jupyter-binder)
|
|
45
|
+
<!-- 
|
|
46
|
+
 -->
|
|
47
|
+
<!-- [](https://codespaces.new/Deltares/Koswat?quickstart=1) -->
|
|
48
|
+
|
|
49
|
+
Quick documentation reference:
|
|
50
|
+
- [Contributing wiki page](https://github.com/Deltares/Koswat/wiki/Contributing)
|
|
51
|
+
- [Installation](https://deltares.github.io/Koswat/installation.html)
|
|
52
|
+
- [User manual](https://deltares.github.io/Koswat/user_manual.html)
|
|
53
|
+
- [Examples](https://deltares.github.io/Koswat/examples.html)
|
|
54
|
+
- [Docker](https://deltares.github.io/Koswat/docker.html)
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
- Dike profile generation based on data from the koswat `json` file.
|
|
59
|
+
- Calculation of all possible reinforcement profiles.
|
|
60
|
+
- Filtering of reinforcement profiles based on their surroundings.
|
|
61
|
+
- Cost calculation for added and removed material per layer per reinforcement.
|
|
62
|
+
- Plotting of reinforcements and layer cross section.
|
|
63
|
+
- Export of results to `csv`.
|
|
64
|
+
- Logging of analysis.
|
|
65
|
+
|
|
66
|
+
## Intended audience
|
|
67
|
+
Koswat targets two types of users:
|
|
68
|
+
- Sandbox users. This target group are users acquianted with `Python` scripting. For them we envision two main interests when using the tool as a sandbox:
|
|
69
|
+
- Extending its functionality, or _correcting_ the existing one via pull-requests. This requires them to adhere to our __Development Guidelines__ (not yet present) and to use the Koswat repository in [Development mode](#development-mode).
|
|
70
|
+
- Creating their own scripts. It is possible to use the full extent of Koswat features on custom scripts, of course under your own responsibility. In this case the user only requires to install the most convinient version of the package as a [sandbox / endpoint](https://deltares.github.io/Koswat/user_manual.html#as-a-sandbox).
|
|
71
|
+
- Single endpoint users. These users are only interested in running the tool via command line or other User Interfaces. For them, it is advised to install the tool as a [sandbox / endpoint](https://deltares.github.io/Koswat/user_manual.html#as-a-sandbox) and to check the tool's [endpoint usage](https://deltares.github.io/Koswat/user_manual.html#as-a-command-line-tool).
|
koswat-0.16.2/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# KOSWAT
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/downloads/release/python-31110/)
|
|
4
|
+
[](https://www.python.org/downloads/release/python-31212/)
|
|
5
|
+
[](https://www.python.org/downloads/release/python-31311/)
|
|
6
|
+
[](https://www.python.org/downloads/release/python-3143/)
|
|
7
|
+
|
|
8
|
+
[](https://github.com/psf/black)
|
|
9
|
+
[](https://github.com/Deltares/Koswat/actions/workflows/ci_installation.yml)
|
|
10
|
+

|
|
11
|
+
[](https://sonarcloud.io/summary/new_code?id=Deltares_Koswat)
|
|
12
|
+
[](https://github.com/Deltares/koswat/actions/workflows/deploy_docs.yml)
|
|
13
|
+
[](https://mybinder.org/v2/gh/Deltares/koswat/jupyter-binder)
|
|
14
|
+
<!-- 
|
|
15
|
+
 -->
|
|
16
|
+
<!-- [](https://codespaces.new/Deltares/Koswat?quickstart=1) -->
|
|
17
|
+
|
|
18
|
+
Quick documentation reference:
|
|
19
|
+
- [Contributing wiki page](https://github.com/Deltares/Koswat/wiki/Contributing)
|
|
20
|
+
- [Installation](https://deltares.github.io/Koswat/installation.html)
|
|
21
|
+
- [User manual](https://deltares.github.io/Koswat/user_manual.html)
|
|
22
|
+
- [Examples](https://deltares.github.io/Koswat/examples.html)
|
|
23
|
+
- [Docker](https://deltares.github.io/Koswat/docker.html)
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- Dike profile generation based on data from the koswat `json` file.
|
|
28
|
+
- Calculation of all possible reinforcement profiles.
|
|
29
|
+
- Filtering of reinforcement profiles based on their surroundings.
|
|
30
|
+
- Cost calculation for added and removed material per layer per reinforcement.
|
|
31
|
+
- Plotting of reinforcements and layer cross section.
|
|
32
|
+
- Export of results to `csv`.
|
|
33
|
+
- Logging of analysis.
|
|
34
|
+
|
|
35
|
+
## Intended audience
|
|
36
|
+
Koswat targets two types of users:
|
|
37
|
+
- Sandbox users. This target group are users acquianted with `Python` scripting. For them we envision two main interests when using the tool as a sandbox:
|
|
38
|
+
- Extending its functionality, or _correcting_ the existing one via pull-requests. This requires them to adhere to our __Development Guidelines__ (not yet present) and to use the Koswat repository in [Development mode](#development-mode).
|
|
39
|
+
- Creating their own scripts. It is possible to use the full extent of Koswat features on custom scripts, of course under your own responsibility. In this case the user only requires to install the most convinient version of the package as a [sandbox / endpoint](https://deltares.github.io/Koswat/user_manual.html#as-a-sandbox).
|
|
40
|
+
- Single endpoint users. These users are only interested in running the tool via command line or other User Interfaces. For them, it is advised to install the tool as a [sandbox / endpoint](https://deltares.github.io/Koswat/user_manual.html#as-a-sandbox) and to check the tool's [endpoint usage](https://deltares.github.io/Koswat/user_manual.html#as-a-command-line-tool).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Koswat
|
|
2
|
+
|
|
3
|
+
Koswat module is divided in submodules, each focusing on a specific set of tasks. On the root you will find the fundamental __init__.py and __main__.py as well as a the `KoswatHandler` class in the file koswat_handler.py.
|
|
4
|
+
|
|
5
|
+
Available modules as for the time of writing of this file:
|
|
6
|
+
|
|
7
|
+
- [configuration](./configuration/README.md) Module related to the settings and setup of a Koswat analysis.
|
|
8
|
+
- [core](./core/README.md) Module containing the core functionality (mostly protocols and generic functionality).
|
|
9
|
+
- [cost_report](./cost_report/README.md) Module containing the analysis of KOSWAT. Here we trigger the generation of reinforcement profiles that will be applied to the analysis when and if suitable for the given koswat environment.
|
|
10
|
+
- [dike](./dike/README.md) Module containing the representation of a Dike in Koswat and its related types and properties.
|
|
11
|
+
- [dike_reinforcements](./dike_reinforcements//README.md) Module related to the definition and calculation of reinforcement profiles.
|
|
12
|
+
- [strategies](./strategies/README.md) Module containing the different selection criteria of reinforcement profile for a location.
|
|
13
|
+
- [plots](./plots/README.md) Module containing plotting export functionality.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.16.2"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""
|
|
2
|
+
GNU GENERAL PUBLIC LICENSE
|
|
3
|
+
Version 3, 29 June 2007
|
|
4
|
+
|
|
5
|
+
KOSWAT, from the dutch combination of words `Kosts-Wat` (what are the costs)
|
|
6
|
+
Copyright (C) 2025 Stichting Deltares
|
|
7
|
+
|
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
(at your option) any later version.
|
|
12
|
+
|
|
13
|
+
This program is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
import logging
|
|
23
|
+
|
|
24
|
+
import click
|
|
25
|
+
|
|
26
|
+
from koswat import __version__
|
|
27
|
+
from koswat.koswat_handler import KoswatHandler
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Below is the documentation for the commandline interface, see the CLICK-package.
|
|
31
|
+
|
|
32
|
+
@click.command()
|
|
33
|
+
@click.option("--input_file", default=None, help="Full path to the config input file.")
|
|
34
|
+
@click.option(
|
|
35
|
+
"--log_output",
|
|
36
|
+
default=None,
|
|
37
|
+
help="Directory location where to generate the Koswat log file.",
|
|
38
|
+
)
|
|
39
|
+
@click.version_option(__version__)
|
|
40
|
+
def run_analysis(input_file: str, log_output: str):
|
|
41
|
+
"""
|
|
42
|
+
CLI call to execute a Koswat analysis given a settings files (`input_file`). The log is generated by default in the execute path, unless otherwise specified in the `log_output` argument.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
input_file (str): Location of the `*.json` file containing the execution settings for Koswat.
|
|
46
|
+
log_output (str): Optional argument to specify where will be created the `koswat.log` file.
|
|
47
|
+
"""
|
|
48
|
+
with KoswatHandler(log_output) as _handler:
|
|
49
|
+
_handler.run_analysis(input_file)
|
|
50
|
+
|
|
51
|
+
if __name__ == "__main__":
|
|
52
|
+
try:
|
|
53
|
+
run_analysis()
|
|
54
|
+
except Exception as e_info:
|
|
55
|
+
logging.error(str(e_info))
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
Represents all settings related to the data required by `Koswat` to generate a `KoswatSummary`, this includes the definition of an initial `KoswatProfile`, the `KoswatScenario`s etc.
|
|
4
|
+
|
|
5
|
+
A `KoswatConfigurationProtocol` is a concrete definition of a `DataObjectModelProtocol`.
|
|
6
|
+
|
|
7
|
+
## Design decisions.
|
|
8
|
+
Because not all files can be imported 1:1 it is important to remind of how Koswat import functionality is thought:
|
|
9
|
+
- A __file__ is __read__ into a __FOM__ and __built__ into a __DOM__
|
|
10
|
+
- `File` -> `KoswatReaderProtocol` -> `FileObjectModelProtocol` -> `BuilderProtocol` -> `DataObjectModelProtocol`
|
|
11
|
+
- `File` -> `KoswatImporterProtocol` -> `DOM`
|
|
12
|
+
|
|
13
|
+
This implies that a `KoswatImporterProtocol` will be responsible of providing a `DataObjectModelProtocol`. Inside the instance of the `KoswatImporterProtocol` other importers can also take place. Either way, an importer will ensure that the correct `FileReaderProtocol` is selected to get the `FileObjectModel` from a `File` and together with any other related data transformed into said `DOM` by using an instance of a `BuilderProtocol`.
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Koswat configuration Input / Output
|
|
2
|
+
|
|
3
|
+
This module is responsible to define all _FOMs_, _readers_ and _importers_ needed directly or indirectly by a `KoswatRunSettings` instance.
|
|
4
|
+
|
|
5
|
+
Each module represents a file type and contains the associated instances of `FileObjectModelProtocol` and their related `KoswatReaderProtocol`.
|
|
6
|
+
|
|
7
|
+
On the root level we find (for now) the importers transforming all the `FileObjectModelProtocol` instances into `KoswatConfigProtocol` ones.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from koswat.configuration.io.config_sections.analysis_section_fom import (
|
|
2
|
+
AnalysisSectionFom,
|
|
3
|
+
)
|
|
4
|
+
from koswat.configuration.io.config_sections.cofferdam_reinforcement_section_fom import (
|
|
5
|
+
CofferdamReinforcementSectionFom,
|
|
6
|
+
)
|
|
7
|
+
from koswat.configuration.io.config_sections.dike_profile_section_fom import (
|
|
8
|
+
DikeProfileSectionFom,
|
|
9
|
+
)
|
|
10
|
+
from koswat.configuration.io.config_sections.infrastructure_section_fom import (
|
|
11
|
+
InfrastructureSectionFom,
|
|
12
|
+
)
|
|
13
|
+
from koswat.configuration.io.config_sections.piping_wall_reinforcement_section_fom import (
|
|
14
|
+
PipingWallReinforcementSectionFom,
|
|
15
|
+
)
|
|
16
|
+
from koswat.configuration.io.config_sections.soil_reinforcement_section_fom import (
|
|
17
|
+
SoilReinforcementSectionFom,
|
|
18
|
+
)
|
|
19
|
+
from koswat.configuration.io.config_sections.stability_wall_reinforcement_section_fom import (
|
|
20
|
+
StabilitywallReinforcementSectionFom,
|
|
21
|
+
)
|
|
22
|
+
from koswat.configuration.io.config_sections.surroundings_section_fom import (
|
|
23
|
+
SurroundingsSectionFom,
|
|
24
|
+
)
|
|
25
|
+
from koswat.configuration.io.config_sections.vps_reinforcement_section_fom import (
|
|
26
|
+
VPSReinforcementSectionFom,
|
|
27
|
+
)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""
|
|
2
|
+
GNU GENERAL PUBLIC LICENSE
|
|
3
|
+
Version 3, 29 June 2007
|
|
4
|
+
|
|
5
|
+
KOSWAT, from the dutch combination of words `Kosts-Wat` (what are the costs)
|
|
6
|
+
Copyright (C) 2025 Stichting Deltares
|
|
7
|
+
|
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
(at your option) any later version.
|
|
12
|
+
|
|
13
|
+
This program is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from dataclasses import dataclass
|
|
23
|
+
from pathlib import Path, PurePosixPath, PureWindowsPath
|
|
24
|
+
from typing import Any
|
|
25
|
+
|
|
26
|
+
from koswat.configuration.io.config_sections.config_section_helper import (
|
|
27
|
+
SectionConfigHelper,
|
|
28
|
+
)
|
|
29
|
+
from koswat.core.io.json.koswat_json_fom_protocol import KoswatJsonFomProtocol
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass
|
|
33
|
+
class AnalysisSectionFom(KoswatJsonFomProtocol):
|
|
34
|
+
dike_section_location_shp_file: Path
|
|
35
|
+
dike_selection_txt_file: Path
|
|
36
|
+
input_profiles_json_dir: Path
|
|
37
|
+
scenarios_json_dir: Path
|
|
38
|
+
costs_json_file: Path
|
|
39
|
+
surroundings_database_dir: Path
|
|
40
|
+
analysis_output_dir: Path
|
|
41
|
+
include_taxes: bool
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_config(cls, input_config: dict[str, Any], parent_path: Path) -> "AnalysisSectionFom":
|
|
45
|
+
# We build the paths relative to the parent path of the main config file.
|
|
46
|
+
# UNLESS they are already absolute paths.
|
|
47
|
+
def resolve_path(input_path: str) -> Path:
|
|
48
|
+
if PureWindowsPath(input_path).is_absolute() or PurePosixPath(input_path).is_absolute():
|
|
49
|
+
return Path(input_path)
|
|
50
|
+
|
|
51
|
+
return parent_path.joinpath(input_path)
|
|
52
|
+
|
|
53
|
+
return cls(
|
|
54
|
+
dike_section_location_shp_file=resolve_path(input_config["dijksectie_ligging"]),
|
|
55
|
+
dike_selection_txt_file=resolve_path(input_config["dijksecties_selectie"]),
|
|
56
|
+
input_profiles_json_dir=resolve_path(input_config["dijksectie_invoer"]),
|
|
57
|
+
scenarios_json_dir=resolve_path(input_config["scenario_invoer"]),
|
|
58
|
+
costs_json_file=resolve_path(input_config["eenheidsprijzen"]),
|
|
59
|
+
surroundings_database_dir=resolve_path(input_config["omgevingsdatabases"]),
|
|
60
|
+
analysis_output_dir=resolve_path(input_config["uitvoerfolder"]),
|
|
61
|
+
include_taxes=SectionConfigHelper.get_bool(input_config["btw"]),
|
|
62
|
+
)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
GNU GENERAL PUBLIC LICENSE
|
|
3
|
+
Version 3, 29 June 2007
|
|
4
|
+
|
|
5
|
+
KOSWAT, from the dutch combination of words `Kosts-Wat` (what are the costs)
|
|
6
|
+
Copyright (C) 2025 Stichting Deltares
|
|
7
|
+
|
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
(at your option) any later version.
|
|
12
|
+
|
|
13
|
+
This program is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from typing import Any, Optional
|
|
23
|
+
|
|
24
|
+
from koswat.configuration.io.config_sections.config_section_fom_protocol import (
|
|
25
|
+
ConfigSectionFomProtocol,
|
|
26
|
+
)
|
|
27
|
+
from koswat.configuration.io.config_sections.config_section_helper import (
|
|
28
|
+
SectionConfigHelper,
|
|
29
|
+
)
|
|
30
|
+
from koswat.configuration.settings.koswat_general_settings import SurtaxFactorEnum
|
|
31
|
+
from koswat.configuration.settings.reinforcements.koswat_cofferdam_settings import (
|
|
32
|
+
KoswatCofferdamSettings,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class CofferdamReinforcementSectionFom(
|
|
37
|
+
ConfigSectionFomProtocol, KoswatCofferdamSettings
|
|
38
|
+
):
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_config(
|
|
41
|
+
cls, input_dict: dict[str, Any], set_defaults: bool
|
|
42
|
+
) -> "CofferdamReinforcementSectionFom":
|
|
43
|
+
_section = cls()
|
|
44
|
+
|
|
45
|
+
_active = input_dict.get("actief", None)
|
|
46
|
+
if set_defaults:
|
|
47
|
+
_section.active = SectionConfigHelper.get_bool(_active)
|
|
48
|
+
else:
|
|
49
|
+
_section.active = SectionConfigHelper.get_bool_without_default(_active)
|
|
50
|
+
|
|
51
|
+
def _get_enum(input_val: Optional[str]) -> SurtaxFactorEnum:
|
|
52
|
+
if set_defaults:
|
|
53
|
+
return SectionConfigHelper.get_enum(input_val)
|
|
54
|
+
return SectionConfigHelper.get_enum_without_default(input_val)
|
|
55
|
+
|
|
56
|
+
_section.soil_surtax_factor = _get_enum(
|
|
57
|
+
input_dict.get("opslagfactor_grond", None)
|
|
58
|
+
)
|
|
59
|
+
_section.constructive_surtax_factor = _get_enum(
|
|
60
|
+
input_dict.get("opslagfactor_constructief", None)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
def _get_float(input_val: Optional[str]) -> float:
|
|
64
|
+
if set_defaults:
|
|
65
|
+
return SectionConfigHelper.get_float(input_val)
|
|
66
|
+
return SectionConfigHelper.get_float_without_default(input_val)
|
|
67
|
+
|
|
68
|
+
_section.min_length_cofferdam = _get_float(
|
|
69
|
+
input_dict.get("min_lengte_kistdam", None)
|
|
70
|
+
)
|
|
71
|
+
_section.max_length_cofferdam = _get_float(
|
|
72
|
+
input_dict.get("max_lengte_kistdam", None)
|
|
73
|
+
)
|
|
74
|
+
return _section
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""
|
|
2
|
+
GNU GENERAL PUBLIC LICENSE
|
|
3
|
+
Version 3, 29 June 2007
|
|
4
|
+
|
|
5
|
+
KOSWAT, from the dutch combination of words `Kosts-Wat` (what are the costs)
|
|
6
|
+
Copyright (C) 2025 Stichting Deltares
|
|
7
|
+
|
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
(at your option) any later version.
|
|
12
|
+
|
|
13
|
+
This program is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from typing import Any, Protocol, runtime_checkable
|
|
23
|
+
|
|
24
|
+
from koswat.core.io.file_object_model_protocol import FileObjectModelProtocol
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@runtime_checkable
|
|
28
|
+
class ConfigSectionFomProtocol(FileObjectModelProtocol, Protocol):
|
|
29
|
+
"""
|
|
30
|
+
Protocol for configuration section file object models.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_config(
|
|
35
|
+
cls, input_dict: dict[str, Any], set_defaults: bool
|
|
36
|
+
) -> "ConfigSectionFomProtocol":
|
|
37
|
+
"""
|
|
38
|
+
Create an instance of the class from a dictionary, not setting defaults.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
input_dict (dict): Dictionary containing the configuration.
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
FileObjectModelProtocol: The created instance.
|
|
45
|
+
"""
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"""
|
|
2
|
+
GNU GENERAL PUBLIC LICENSE
|
|
3
|
+
Version 3, 29 June 2007
|
|
4
|
+
|
|
5
|
+
KOSWAT, from the dutch combination of words `Kosts-Wat` (what are the costs)
|
|
6
|
+
Copyright (C) 2025 Stichting Deltares
|
|
7
|
+
|
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
(at your option) any later version.
|
|
12
|
+
|
|
13
|
+
This program is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
import math
|
|
23
|
+
from typing import Optional
|
|
24
|
+
|
|
25
|
+
from koswat.configuration.settings.koswat_general_settings import SurtaxFactorEnum
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class SectionConfigHelper:
|
|
29
|
+
"""
|
|
30
|
+
Class with helper methods for configuration sections.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
@staticmethod
|
|
34
|
+
def get_string_without_default(input_val: Optional[str]) -> Optional[str]:
|
|
35
|
+
"""
|
|
36
|
+
Returns the input string or None.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
input_val (Optional[str]): Input string.
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
Optional[str]: Input string or None.
|
|
43
|
+
"""
|
|
44
|
+
if input_val is not None:
|
|
45
|
+
return input_val
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
@staticmethod
|
|
49
|
+
def get_string(input_val: Optional[str]) -> str:
|
|
50
|
+
"""
|
|
51
|
+
Returns the input string or a default value.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
input_val (Optional[str]): Input string.
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
str: Input string. Default is an empty string.
|
|
58
|
+
"""
|
|
59
|
+
_val = SectionConfigHelper.get_string_without_default(input_val)
|
|
60
|
+
return _val if _val is not None else ""
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
def get_enum_without_default(
|
|
64
|
+
input_val: Optional[str],
|
|
65
|
+
) -> Optional[SurtaxFactorEnum]:
|
|
66
|
+
"""
|
|
67
|
+
Converts a string to an enum value or None.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
input_val (Optional[str]): Input string.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Optional[SurtaxFactorEnum]: Corresponding enum value or None.
|
|
74
|
+
"""
|
|
75
|
+
if input_val:
|
|
76
|
+
return SurtaxFactorEnum[input_val.upper()]
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
@staticmethod
|
|
80
|
+
def get_enum(input_val: Optional[str]) -> SurtaxFactorEnum:
|
|
81
|
+
"""
|
|
82
|
+
Converts a string to an enum value.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
input_val (Optional[str]): Input string.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
SurtaxFactorEnum: Corresponding enum value. Default is SurtaxFactorEnum.NORMAAL.
|
|
89
|
+
"""
|
|
90
|
+
_val = SectionConfigHelper.get_enum_without_default(input_val)
|
|
91
|
+
return _val if _val is not None else SurtaxFactorEnum.NORMAAL
|
|
92
|
+
|
|
93
|
+
@staticmethod
|
|
94
|
+
def get_float_without_default(
|
|
95
|
+
input_val: Optional[str | float],
|
|
96
|
+
) -> Optional[float]:
|
|
97
|
+
"""
|
|
98
|
+
Converts a string to a float value or None.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
input_val (Optional[str | float]): Input string or float.
|
|
102
|
+
|
|
103
|
+
Returns:
|
|
104
|
+
Optional[float]: Corresponding float value or None.
|
|
105
|
+
"""
|
|
106
|
+
if input_val is not None:
|
|
107
|
+
return float(input_val)
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
@staticmethod
|
|
111
|
+
def get_float(input_val: Optional[str | float]) -> float:
|
|
112
|
+
"""
|
|
113
|
+
Converts a string to a float value.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
input_val (Optional[str | float]): Input string or float.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
float: Corresponding float value. Default is math.nan.
|
|
120
|
+
"""
|
|
121
|
+
_val = SectionConfigHelper.get_float_without_default(input_val)
|
|
122
|
+
return _val if _val is not None else math.nan
|
|
123
|
+
|
|
124
|
+
@staticmethod
|
|
125
|
+
def get_bool_without_default(
|
|
126
|
+
input_val: Optional[str | bool],
|
|
127
|
+
) -> Optional[bool]:
|
|
128
|
+
"""
|
|
129
|
+
Converts a string to a boolean value or None.
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
input_val (Optional[str | bool]): Input string or boolean.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
Optional[bool]: Corresponding boolean value or None.
|
|
136
|
+
"""
|
|
137
|
+
if input_val is not None:
|
|
138
|
+
if isinstance(input_val, bool):
|
|
139
|
+
return input_val
|
|
140
|
+
return input_val.lower() == "true"
|
|
141
|
+
return None
|
|
142
|
+
|
|
143
|
+
@staticmethod
|
|
144
|
+
def get_bool(input_val: Optional[str | bool]) -> bool:
|
|
145
|
+
"""
|
|
146
|
+
Converts a string to a boolean value.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
input_val (Optional[str | bool]): Input string or boolean.
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
bool: Corresponding boolean value. Default is False.
|
|
153
|
+
"""
|
|
154
|
+
_val = SectionConfigHelper.get_bool_without_default(input_val)
|
|
155
|
+
return _val if _val is not None else False
|