ryan-tools 26.10.18.9__py3-none-any.whl
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.
- culvert_results/__init__.py +1 -0
- culvert_results/combine_culvert_maximums.py +106 -0
- culvert_results/combine_culvert_timeseries.py +105 -0
- culvert_results/create_mean_culvert_peak_report.py +111 -0
- culvert_results/create_median_culvert_peak_report.py +111 -0
- gis_processing/__init__.py +1 -0
- gis_processing/apply_qgis_styles_to_results.py +85 -0
- gis_processing/rename_geopackage_layer_to_filename.py +174 -0
- gis_processing/split_network_layers_by_culvert_id.py +157 -0
- log_processing/__init__.py +1 -0
- log_processing/append_log_summary_to_master_workbook.py +119 -0
- log_processing/create_log_summary_report.py +104 -0
- model_management/__init__.py +1 -0
- model_management/collect_result_and_check_files.py +300 -0
- model_management/delete_duplicate_check_files.py +1037 -0
- model_management/run_tuflow_simulations.py +1584 -0
- model_management/verify_converted_tuflow_rasters.py +639 -0
- po_and_timeseries/__init__.py +1 -0
- po_and_timeseries/calculate_po_closure_durations.py +94 -0
- po_and_timeseries/check_po_timeseries_peaks.py +139 -0
- po_and_timeseries/check_timeseries_stability.py +151 -0
- po_and_timeseries/combine_po_results.py +126 -0
- po_and_timeseries/combine_pomm_results.py +127 -0
- po_and_timeseries/create_pomm_mean_peak_report.py +132 -0
- po_and_timeseries/create_pomm_median_peak_report.py +133 -0
- po_and_timeseries/generate_2d_po_label_list.py +202 -0
- po_and_timeseries/plot_po_scenario_timeseries.py +329 -0
- po_and_timeseries/plot_water_level_profiles.py +241 -0
- raster_processing/__init__.py +1 -0
- raster_processing/calculate_raster_differences.py +237 -0
- raster_processing/mask_velocity_by_depth.py +212 -0
- raster_processing/run_asc_to_asc_maximum_searches.py +120 -0
- raster_processing/run_asc_to_asc_mean_then_maximum.py +172 -0
- raster_processing/run_asc_to_asc_median_then_maximum.py +151 -0
- raster_processing/run_grouped_asc_to_asc_statistics.py +274 -0
- raster_processing/run_python_raster_calculations.py +183 -0
- ryan-scripts/12D-python/generate_culvert_lines.py +123 -0
- ryan-scripts/12D-python/generate_culvert_polygons.py +261 -0
- ryan-scripts/12D-python/thin-raster-terrain-for-12D_v5.py +315 -0
- ryan-scripts/12D-python/tif-to-LAS-valid-only_v6.py +139 -0
- ryan-scripts/12D-python/tif-to-csv-valid-only_v6.py +104 -0
- ryan-scripts/12D-python/tif-to-csv-valid-only_v6a.py +105 -0
- ryan-scripts/AutoCAD-python/dwg-polygons-txt-to-csv.py +164 -0
- ryan-scripts/AutoCAD-python/dwg-to-points.py +360 -0
- ryan-scripts/AutoCAD-python/group-by-entity-colour-and-dissolve-to-hatch.py +177 -0
- ryan-scripts/AutoCAD-python/group-by-entity-colour-and-dissolve-to-hatch_dask3.py +230 -0
- ryan-scripts/AutoCAD-python/group-by-entity-colour-and-dissolve.py +146 -0
- ryan-scripts/AutoCAD-python/group-by-entity-colour-and-dissolve3.py +184 -0
- ryan-scripts/AutoCAD-python/group-by-entity-colour.py +76 -0
- ryan-scripts/GlobalMapper/DXF-to-float_v1.gms +18 -0
- ryan-scripts/README.md +107 -0
- ryan-scripts/RORB-python/RORB-find-closure-durations.py +143 -0
- ryan-scripts/RORB-python/extract_rainfall-to-TUFLOW.py +278 -0
- ryan-scripts/RORB-python/hydrograph_extract_rorb_csv.py +352 -0
- ryan-scripts/RORB-python/plot_ensemble_results.py +125 -0
- ryan-scripts/RORB-python/rorb-peaks_v2.py +220 -0
- ryan-scripts/TUFLOW-bat/asc2asc_max_by_search.bat +5 -0
- ryan-scripts/TUFLOW-bat/asc_to_asc-DIFF.bat +36 -0
- ryan-scripts/TUFLOW-bat/asc_to_asc-MAX.bat +23 -0
- ryan-scripts/TUFLOW-python/README.md +242 -0
- ryan-scripts/TUFLOW-python/culvert_results/__init__.py +1 -0
- ryan-scripts/TUFLOW-python/culvert_results/combine_culvert_maximums.py +106 -0
- ryan-scripts/TUFLOW-python/culvert_results/combine_culvert_timeseries.py +105 -0
- ryan-scripts/TUFLOW-python/culvert_results/create_mean_culvert_peak_report.py +111 -0
- ryan-scripts/TUFLOW-python/culvert_results/create_median_culvert_peak_report.py +111 -0
- ryan-scripts/TUFLOW-python/gis_processing/__init__.py +1 -0
- ryan-scripts/TUFLOW-python/gis_processing/apply_qgis_styles_to_results.py +85 -0
- ryan-scripts/TUFLOW-python/gis_processing/rename_geopackage_layer_to_filename.py +174 -0
- ryan-scripts/TUFLOW-python/gis_processing/split_network_layers_by_culvert_id.py +157 -0
- ryan-scripts/TUFLOW-python/log_processing/__init__.py +1 -0
- ryan-scripts/TUFLOW-python/log_processing/append_log_summary_to_master_workbook.py +119 -0
- ryan-scripts/TUFLOW-python/log_processing/create_log_summary_report.py +104 -0
- ryan-scripts/TUFLOW-python/model_management/__init__.py +1 -0
- ryan-scripts/TUFLOW-python/model_management/collect_result_and_check_files.py +300 -0
- ryan-scripts/TUFLOW-python/model_management/delete_duplicate_check_files.py +1037 -0
- ryan-scripts/TUFLOW-python/model_management/run_tuflow_simulations.py +1584 -0
- ryan-scripts/TUFLOW-python/model_management/verify_converted_tuflow_rasters.py +639 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/__init__.py +1 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/calculate_po_closure_durations.py +94 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/check_po_timeseries_peaks.py +139 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/check_timeseries_stability.py +151 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/combine_po_results.py +126 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/combine_pomm_results.py +127 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/create_pomm_mean_peak_report.py +132 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/create_pomm_median_peak_report.py +133 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/generate_2d_po_label_list.py +202 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/plot_po_scenario_timeseries.py +329 -0
- ryan-scripts/TUFLOW-python/po_and_timeseries/plot_water_level_profiles.py +241 -0
- ryan-scripts/TUFLOW-python/raster_processing/__init__.py +1 -0
- ryan-scripts/TUFLOW-python/raster_processing/calculate_raster_differences.py +237 -0
- ryan-scripts/TUFLOW-python/raster_processing/mask_velocity_by_depth.py +212 -0
- ryan-scripts/TUFLOW-python/raster_processing/run_asc_to_asc_maximum_searches.py +120 -0
- ryan-scripts/TUFLOW-python/raster_processing/run_asc_to_asc_mean_then_maximum.py +172 -0
- ryan-scripts/TUFLOW-python/raster_processing/run_asc_to_asc_median_then_maximum.py +151 -0
- ryan-scripts/TUFLOW-python/raster_processing/run_grouped_asc_to_asc_statistics.py +274 -0
- ryan-scripts/TUFLOW-python/raster_processing/run_python_raster_calculations.py +183 -0
- ryan-scripts/WRAPPER_STANDARD.md +195 -0
- ryan-scripts/cad-python/dtm_str_converter_to_gpkg.py +1001 -0
- ryan-scripts/cad-python/extract_dxf_polyface.py +322 -0
- ryan-scripts/cad-python/polyface_parquet_to_gpkg.py +405 -0
- ryan-scripts/cad-python/process_arch_d.py +237 -0
- ryan-scripts/culvert.py +522 -0
- ryan-scripts/docx-python/word_style_audit.py +483 -0
- ryan-scripts/file-management-python/archive_compress_folder.py +245 -0
- ryan-scripts/file-management-python/archive_compress_individual.py +182 -0
- ryan-scripts/file-management-python/archive_extract.py +139 -0
- ryan-scripts/file-management-python/copy_file.py +73 -0
- ryan-scripts/file-management-python/copy_folder.py +326 -0
- ryan-scripts/file-management-python/list_files_recursive.py +97 -0
- ryan-scripts/file-management-python/rename-msg-files-argparse-folder.py +300 -0
- ryan-scripts/fix-chatgpt-type-hints.py +78 -0
- ryan-scripts/floodway.py +275 -0
- ryan-scripts/gdal-bat/LAZ-to-LAS.bat +47 -0
- ryan-scripts/gdal-bat/README.md +28 -0
- ryan-scripts/gdal-bat/gdal_edit_Set_nodata.bat +109 -0
- ryan-scripts/gdal-bat/gdal_flood_extent_sieve.bat +220 -0
- ryan-scripts/gdal-bat/gdal_merge.bat +66 -0
- ryan-scripts/gdal-bat/gdal_merge_CLI.bat +305 -0
- ryan-scripts/gdal-bat/gdal_merge_xyz_extent.bat +242 -0
- ryan-scripts/gdal-bat/gdal_raster_footprint.bat +127 -0
- ryan-scripts/gdal-python/README.md +169 -0
- ryan-scripts/gdal-python/audit_CRS.py +260 -0
- ryan-scripts/gdal-python/batch_vector_clip.py +219 -0
- ryan-scripts/gdal-python/build_VRT.py +131 -0
- ryan-scripts/gdal-python/check_flt_tif.py +158 -0
- ryan-scripts/gdal-python/convert_gdb_to_gpkg.py +168 -0
- ryan-scripts/gdal-python/gdal_flood_extent.py +184 -0
- ryan-scripts/gdal-python/gdal_merge.py +152 -0
- ryan-scripts/gdal-python/gdal_merge_by_extent.py +155 -0
- ryan-scripts/gdal-python/gdal_raster_footprint.py +123 -0
- ryan-scripts/gdal-python/gdal_raster_to_xyz.py +180 -0
- ryan-scripts/gdal-python/gdal_retile_wrapper.py +122 -0
- ryan-scripts/gdal-python/gdal_set_nodata.py +116 -0
- ryan-scripts/gdal-python/gdal_stage_storage.py +171 -0
- ryan-scripts/gdal-python/gdal_translate_TIF_ovr.py +176 -0
- ryan-scripts/gdal-python/gdal_unset_nodata.py +112 -0
- ryan-scripts/gdal-python/gdal_vector_translate.py +69 -0
- ryan-scripts/gdal-python/gdaladdo_tif_pyramids.py +135 -0
- ryan-scripts/gdal-python/gdalwarp_clip_to_polygon.py +201 -0
- ryan-scripts/gdal-python/laz_to_las.py +118 -0
- ryan-scripts/gdal-python/recompress_geotiffs.py +130 -0
- ryan-scripts/gdal-python/split_vector_by_attribute.py +203 -0
- ryan-scripts/gdal-python/vacuum_geopackages.py +110 -0
- ryan-scripts/hydrology-python/ARF-calcs.py +390 -0
- ryan-scripts/hydrology-python/EAS.py +359 -0
- ryan-scripts/hydrology-python/RFFE_Only_v6.py +301 -0
- ryan-scripts/hydrology-python/RFFE_Only_v6_standalone.py +269 -0
- ryan-scripts/hydrology-python/aep_ari_conversions.py +29 -0
- ryan-scripts/hydrology-python/combine_ifds_v2.py +331 -0
- ryan-scripts/misc-python/heic_to_jpeg.py +216 -0
- ryan-scripts/misc-python/remove_excel_protection.py +169 -0
- ryan-scripts/other/PDFXChangeEditorSettings_250206.xces +0 -0
- ryan-scripts/other/audit_qgis_projects.py +149 -0
- ryan-scripts/other/shapefile-explorer-types.ps1 +74 -0
- ryan-scripts/pdf-python/break_pdf_signatures.py +193 -0
- ryan-scripts/pdf-python/ocg_clean_file.py +579 -0
- ryan-scripts/pdf-python/ocg_clean_file_alternative.py +850 -0
- ryan-scripts/pdf-python/pypdf_decrypt.py +68 -0
- ryan-scripts/pdf-python/remove_pdf_restrictions.py +197 -0
- ryan-scripts/point-cloud-python/clean_xyz.py +262 -0
- ryan-scripts/point-cloud-python/clip_las_to_polygon.py +227 -0
- ryan-scripts/point-cloud-python/parallel-reorder-xyz-updated.py +97 -0
- ryan-scripts/powershell/date_to_front_of_msg_v3.ps1 +49 -0
- ryan-scripts/powershell/self-signing.ps1 +151 -0
- ryan-scripts/python-not-polished/hydrograph_extract_rorb_csv-opt2_132.py +360 -0
- ryan-scripts/raster-python/square_raster_cells.py +99 -0
- ryan-scripts/raster-python/tif_to_xyz_drop_na_v1.py +121 -0
- ryan-scripts/raster-python/tif_to_xyz_drop_na_v2.py +172 -0
- ryan-scripts/repair-folder-permissions.ps1 +175 -0
- ryan-scripts/tuflow/PROJECT_SETUP.md +112 -0
- ryan-scripts/tuflow/find_missing_tlf_runs.py +123 -0
- ryan-scripts/tuflow/init_tuflow_project.py +151 -0
- ryan-scripts/tuflow/tuflow_culvert_from_1d_nwk.py +612 -0
- ryan-scripts/tuflow/tuflow_culvert_from_maximums.py +511 -0
- ryan-scripts/tuflow/tuflow_to_hy8.py +134 -0
- ryan-scripts/unsorted-bat/VACUUM.BAT +74 -0
- ryan-scripts/unsorted-bat/del_xf.bat +38 -0
- ryan-scripts/unsorted-bat/dir.bat +14 -0
- ryan-scripts/unsorted-bat/dir_recursive.bat +14 -0
- ryan-scripts/unsorted-bat/shutdown-a.bat +8 -0
- ryan-scripts/unsorted-python/export_water_level_profile_tables_50m.py +697 -0
- ryan-scripts/unsorted-python/plot_water_level_profiles.py +387 -0
- ryan_library/__init__.py +5 -0
- ryan_library/classes/__init__.py +0 -0
- ryan_library/classes/column_definitions.json +833 -0
- ryan_library/classes/column_definitions.py +192 -0
- ryan_library/classes/culvert/__init__.py +64 -0
- ryan_library/classes/culvert/alternative.py +25 -0
- ryan_library/classes/culvert/candidate.py +20 -0
- ryan_library/classes/culvert/criteria.py +95 -0
- ryan_library/classes/culvert/crossing.py +232 -0
- ryan_library/classes/culvert/event.py +51 -0
- ryan_library/classes/culvert/project.py +66 -0
- ryan_library/classes/culvert/results.py +144 -0
- ryan_library/classes/culvert/scenario.py +83 -0
- ryan_library/classes/culvert/uncertainty.py +142 -0
- ryan_library/classes/culvert/uncertainty_results.py +78 -0
- ryan_library/classes/floodway/__init__.py +48 -0
- ryan_library/classes/floodway/envelope.py +90 -0
- ryan_library/classes/floodway/models.py +250 -0
- ryan_library/classes/floodway/protection.py +130 -0
- ryan_library/classes/floodway/results.py +243 -0
- ryan_library/classes/path_mappings.json +3 -0
- ryan_library/classes/suffixes_and_dtypes.py +463 -0
- ryan_library/classes/tuflow_results_validation_and_datatypes.json +388 -0
- ryan_library/classes/tuflow_string_classes.py +362 -0
- ryan_library/functions/RORB/__init__.py +0 -0
- ryan_library/functions/RORB/ensemble_analysis.py +112 -0
- ryan_library/functions/RORB/ensemble_plotting.py +162 -0
- ryan_library/functions/RORB/read_rorb_files.py +232 -0
- ryan_library/functions/__init__.py +0 -0
- ryan_library/functions/archive_utils.py +116 -0
- ryan_library/functions/culvert/__init__.py +120 -0
- ryan_library/functions/culvert/adapter.py +117 -0
- ryan_library/functions/culvert/assessment.py +109 -0
- ryan_library/functions/culvert/candidate_generation.py +72 -0
- ryan_library/functions/culvert/config.py +730 -0
- ryan_library/functions/culvert/event_import.py +66 -0
- ryan_library/functions/culvert/export.py +413 -0
- ryan_library/functions/culvert/plotting.py +105 -0
- ryan_library/functions/culvert/tuflow_attributes.py +269 -0
- ryan_library/functions/culvert/tuflow_configuration.py +176 -0
- ryan_library/functions/culvert/tuflow_engines.py +602 -0
- ryan_library/functions/culvert/uncertainty.py +78 -0
- ryan_library/functions/culvert/uncertainty_evaluation.py +125 -0
- ryan_library/functions/culvert/uncertainty_export.py +260 -0
- ryan_library/functions/culvert/uncertainty_statistics.py +118 -0
- ryan_library/functions/dashboard_workflow.py +265 -0
- ryan_library/functions/dataframe_helpers.py +144 -0
- ryan_library/functions/excel_export.py +666 -0
- ryan_library/functions/file_utils.py +303 -0
- ryan_library/functions/file_verification.py +62 -0
- ryan_library/functions/floodway/__init__.py +131 -0
- ryan_library/functions/floodway/adapter.py +48 -0
- ryan_library/functions/floodway/assessment.py +194 -0
- ryan_library/functions/floodway/config.py +215 -0
- ryan_library/functions/floodway/envelope.py +67 -0
- ryan_library/functions/floodway/export.py +316 -0
- ryan_library/functions/floodway/hec23.py +234 -0
- ryan_library/functions/floodway/hydraulics.py +237 -0
- ryan_library/functions/floodway/mrwa_protection.py +106 -0
- ryan_library/functions/gdal/__init__.py +0 -0
- ryan_library/functions/gdal/profiling.py +255 -0
- ryan_library/functions/gdal/raster_processing.py +752 -0
- ryan_library/functions/gdal/raster_recompression.py +482 -0
- ryan_library/functions/gdal/stage_storage.py +157 -0
- ryan_library/functions/gdal/vector_conversion.py +187 -0
- ryan_library/functions/hy8/__init__.py +18 -0
- ryan_library/functions/hy8/run_hy8_bridge.py +451 -0
- ryan_library/functions/lidar_processing.py +74 -0
- ryan_library/functions/live_dashboard.py +393 -0
- ryan_library/functions/loguru_helpers.py +405 -0
- ryan_library/functions/misc_functions.py +39 -0
- ryan_library/functions/multiprocessing_helpers.py +22 -0
- ryan_library/functions/pandas/__init__.py +0 -0
- ryan_library/functions/pandas/median_calc.py +150 -0
- ryan_library/functions/parse_tlf.py +526 -0
- ryan_library/functions/path_stuff.py +151 -0
- ryan_library/functions/process_12D_culverts.py +487 -0
- ryan_library/functions/rock_protection.py +157 -0
- ryan_library/functions/string_helpers.py +39 -0
- ryan_library/functions/terrain_processing.py +210 -0
- ryan_library/functions/tlf_missing_runs.py +274 -0
- ryan_library/functions/tuflow/__init__.py +0 -0
- ryan_library/functions/tuflow/asc_to_asc_raster_operations.py +567 -0
- ryan_library/functions/tuflow/asc_to_asc_runner.py +148 -0
- ryan_library/functions/tuflow/closure_durations_functions.py +176 -0
- ryan_library/functions/tuflow/logsummary_excel_append.py +340 -0
- ryan_library/functions/tuflow/notebook_helpers.py +810 -0
- ryan_library/functions/tuflow/po_timeseries_checks.py +807 -0
- ryan_library/functions/tuflow/pomm_utils.py +783 -0
- ryan_library/functions/tuflow/tuflow_common.py +276 -0
- ryan_library/functions/tuflow/tuflow_result_naming.py +78 -0
- ryan_library/functions/tuflow/wrapper_helpers.py +42 -0
- ryan_library/functions/versioning.py +12 -0
- ryan_library/functions/wrapper_utils.py +236 -0
- ryan_library/mcp/__init__.py +1 -0
- ryan_library/mcp/models.py +167 -0
- ryan_library/mcp/registry.py +412 -0
- ryan_library/mcp/server.py +480 -0
- ryan_library/orchestrators/__init__.py +2 -0
- ryan_library/orchestrators/culvert/__init__.py +24 -0
- ryan_library/orchestrators/culvert/analyse.py +22 -0
- ryan_library/orchestrators/culvert/design.py +85 -0
- ryan_library/orchestrators/culvert/events.py +50 -0
- ryan_library/orchestrators/culvert/rating.py +23 -0
- ryan_library/orchestrators/culvert/report.py +82 -0
- ryan_library/orchestrators/culvert/solve.py +34 -0
- ryan_library/orchestrators/culvert/uncertainty.py +78 -0
- ryan_library/orchestrators/culvert/uncertainty_report.py +72 -0
- ryan_library/orchestrators/floodway/__init__.py +33 -0
- ryan_library/orchestrators/floodway/assess.py +509 -0
- ryan_library/orchestrators/floodway/report.py +237 -0
- ryan_library/orchestrators/floodway/sweep.py +281 -0
- ryan_library/orchestrators/gdal/__init__.py +2 -0
- ryan_library/orchestrators/gdal/file_geodatabase_export.py +205 -0
- ryan_library/orchestrators/gdal/gdal_flood_extent.py +193 -0
- ryan_library/orchestrators/gdal/raster_maintenance.py +84 -0
- ryan_library/orchestrators/gdal/raster_merge.py +153 -0
- ryan_library/orchestrators/gdal/raster_mosaic.py +135 -0
- ryan_library/orchestrators/gdal/raster_recompression.py +202 -0
- ryan_library/orchestrators/gdal/raster_workflows.py +182 -0
- ryan_library/orchestrators/rorb/__init__.py +2 -0
- ryan_library/orchestrators/rorb/closure_durations.py +214 -0
- ryan_library/orchestrators/rorb/ensemble_plotting.py +107 -0
- ryan_library/orchestrators/tuflow/__init__.py +2 -0
- ryan_library/orchestrators/tuflow/_combination_workflow.py +147 -0
- ryan_library/orchestrators/tuflow/asc2asc_max_by_search.py +157 -0
- ryan_library/orchestrators/tuflow/asc2asc_mean_then_max_by_search.py +134 -0
- ryan_library/orchestrators/tuflow/asc2asc_stat_then_max_by_search.py +461 -0
- ryan_library/orchestrators/tuflow/asc_to_asc_batch.py +114 -0
- ryan_library/orchestrators/tuflow/closure_durations.py +141 -0
- ryan_library/orchestrators/tuflow/peak_check_po_csvs.py +146 -0
- ryan_library/orchestrators/tuflow/po_combine.py +74 -0
- ryan_library/orchestrators/tuflow/pomm_combine.py +100 -0
- ryan_library/orchestrators/tuflow/pomm_max_items.py +222 -0
- ryan_library/orchestrators/tuflow/project_setup.py +467 -0
- ryan_library/orchestrators/tuflow/tlf_missing_runs.py +43 -0
- ryan_library/orchestrators/tuflow/tuflow_culverts_mean.py +458 -0
- ryan_library/orchestrators/tuflow/tuflow_culverts_merge.py +124 -0
- ryan_library/orchestrators/tuflow/tuflow_culverts_timeseries.py +114 -0
- ryan_library/orchestrators/tuflow/tuflow_logsummary.py +391 -0
- ryan_library/orchestrators/tuflow/tuflow_logsummary_append.py +93 -0
- ryan_library/orchestrators/tuflow/tuflow_results_styling.py +257 -0
- ryan_library/orchestrators/tuflow/tuflow_timeseries_stability.py +187 -0
- ryan_library/orchestrators/tuflow/water_level_profiles.py +739 -0
- ryan_library/processors/__init__.py +0 -0
- ryan_library/processors/tuflow/__init__.py +56 -0
- ryan_library/processors/tuflow/base_processor.py +736 -0
- ryan_library/processors/tuflow/max_data_processor.py +52 -0
- ryan_library/processors/tuflow/maximums_1d/CmxProcessor.py +111 -0
- ryan_library/processors/tuflow/maximums_1d/NmxProcessor.py +98 -0
- ryan_library/processors/tuflow/maximums_1d/__init__.py +8 -0
- ryan_library/processors/tuflow/maximums_1d/ccAProcessor.py +290 -0
- ryan_library/processors/tuflow/other_processors/ChanProcessor.py +73 -0
- ryan_library/processors/tuflow/other_processors/EOFProcessor.py +150 -0
- ryan_library/processors/tuflow/other_processors/POMMProcessor.py +126 -0
- ryan_library/processors/tuflow/other_processors/POProcessor.py +149 -0
- ryan_library/processors/tuflow/other_processors/RLLQmxProcessor.py +60 -0
- ryan_library/processors/tuflow/other_processors/TLFProcessor.py +96 -0
- ryan_library/processors/tuflow/other_processors/__init__.py +18 -0
- ryan_library/processors/tuflow/processor_collection.py +999 -0
- ryan_library/processors/tuflow/timeseries_1d/CFProcessor.py +40 -0
- ryan_library/processors/tuflow/timeseries_1d/HProcessor.py +70 -0
- ryan_library/processors/tuflow/timeseries_1d/QProcessor.py +30 -0
- ryan_library/processors/tuflow/timeseries_1d/VProcessor.py +19 -0
- ryan_library/processors/tuflow/timeseries_1d/__init__.py +9 -0
- ryan_library/processors/tuflow/timeseries_helpers.py +73 -0
- ryan_library/processors/tuflow/timeseries_processor.py +352 -0
- ryan_library/py.typed +0 -0
- ryan_library/resources/__init__.py +2 -0
- ryan_library/resources/mcp/__init__.py +1 -0
- ryan_library/resources/mcp/gdal_cli_tools.json +236 -0
- ryan_library/resources/mcp/workflows.json +486 -0
- ryan_library/resources/qgis/__init__.py +2 -0
- ryan_library/resources/qgis/tuflow/1d_nwk barrels.qml +208 -0
- ryan_library/resources/qgis/tuflow/2d_loc_qa_check.qml +1369 -0
- ryan_library/resources/qgis/tuflow/Depth Diff GOOOD.qml +69 -0
- ryan_library/resources/qgis/tuflow/_1d_ccA_L.qml +1194 -0
- ryan_library/resources/qgis/tuflow/__init__.py +2 -0
- ryan_library/resources/qgis/tuflow/depth_for_legend_max2m.qml +179 -0
- ryan_library/resources/qgis/tuflow/hillshade.qml +180 -0
- ryan_library/resources/qgis/tuflow/hmax.qml +330 -0
- ryan_library/resources/qgis/tuflow/velocities scour protection mrwa.qml +91 -0
- ryan_library/resources/qgis/tuflow/velocity_vectors.qml +474 -0
- ryan_library/resources/tuflow_templates/.gitignore +28 -0
- ryan_library/resources/tuflow_templates/__init__.py +2 -0
- ryan_library/resources/tuflow_templates/model/BOUND_01.tbc +10 -0
- ryan_library/resources/tuflow_templates/model/EVENTS_01.tef +215 -0
- ryan_library/resources/tuflow_templates/model/GEOM_01.tgc +29 -0
- ryan_library/resources/tuflow_templates/model/Materials_01.csv +13 -0
- ryan_library/resources/tuflow_templates/model/Soil_01.tsoilf +4 -0
- ryan_library/resources/tuflow_templates/runs/Create_Empties.tcf +3 -0
- ryan_library/resources/tuflow_templates/runs/__project___01_~s2~_~s1~_~e1~_~e2~_~e4~_~e3~_~s4~.tcf +89 -0
- ryan_library/resources/tuflow_templates/runs/empties.bat +4 -0
- ryan_library/resources/tuflow_templates/runs/model_cell_sizes_01.trd +32 -0
- ryan_library/resources/tuflow_templates/runs/run_times_01.trd +46 -0
- ryan_tools-26.10.18.9.dist-info/METADATA +350 -0
- ryan_tools-26.10.18.9.dist-info/RECORD +385 -0
- ryan_tools-26.10.18.9.dist-info/WHEEL +5 -0
- ryan_tools-26.10.18.9.dist-info/entry_points.txt +2 -0
- ryan_tools-26.10.18.9.dist-info/licenses/LICENSE +73 -0
- ryan_tools-26.10.18.9.dist-info/top_level.txt +8 -0
- vendor/PyHMA/__init__.py +624 -0
- vendor/__init__.py +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Maintained TUFLOW culvert-result wrappers bundled with ryan-tools."""
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# ryan-scripts\TUFLOW-python\culvert_results\combine_culvert_maximums.py
|
|
2
|
+
"""Wrapper Script: Merge TUFLOW Culvert Maximums.
|
|
3
|
+
|
|
4
|
+
This script acts as a mutable wrapper for `tuflow_culverts_merge.main_processing`.
|
|
5
|
+
It combines culvert maximums (and raw data) from multiple CSV files.
|
|
6
|
+
Users can edit the hard-coded constants in this file to control include data types and export format,
|
|
7
|
+
or use command-line arguments to override these settings.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Literal
|
|
12
|
+
|
|
13
|
+
WRAPPER_VERSION = "2026-08-02.1"
|
|
14
|
+
|
|
15
|
+
CONSOLE_LOG_LEVEL = "INFO" # or "DEBUG"
|
|
16
|
+
INCLUDE_DATA_TYPES: tuple[str, ...] = ("Nmx", "Cmx", "Chan", "ccA", "RLL_Qmx", "EOF")
|
|
17
|
+
EXPORT_MODE: Literal["excel", "parquet", "both"] = "excel"
|
|
18
|
+
WORKING_DIR: Path = Path(__file__).absolute().parent
|
|
19
|
+
# Optional explicit folder roots to scan. If left empty, the wrapper scans WORKING_DIR recursively.
|
|
20
|
+
PATHS_TO_PROCESS: tuple[Path, ...] = ()
|
|
21
|
+
# WORKING_DIR: Path = Path(r"E:\path\to\custom\directory")
|
|
22
|
+
|
|
23
|
+
import argparse
|
|
24
|
+
|
|
25
|
+
from ryan_library.functions.wrapper_utils import (
|
|
26
|
+
CommonWrapperOptions,
|
|
27
|
+
add_common_cli_arguments,
|
|
28
|
+
change_working_directory,
|
|
29
|
+
parse_common_cli_arguments,
|
|
30
|
+
pause_console,
|
|
31
|
+
print_wrapper_banner,
|
|
32
|
+
)
|
|
33
|
+
from ryan_library.orchestrators.tuflow.tuflow_culverts_merge import main_processing
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def main(
|
|
37
|
+
*,
|
|
38
|
+
console_log_level: str | None = None,
|
|
39
|
+
include_data_types: tuple[str, ...] | None = None,
|
|
40
|
+
locations_to_include: tuple[str, ...] | None = None,
|
|
41
|
+
paths_to_process: tuple[Path, ...] | None = None,
|
|
42
|
+
working_directory: Path | None = None,
|
|
43
|
+
) -> int:
|
|
44
|
+
"""Main entry point to merge culvert maximums; double-clickable.
|
|
45
|
+
|
|
46
|
+
This function sets up the environment and calls 'main_processing'.
|
|
47
|
+
It allows users to default settings via constants while retaining CLI capabilities.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
console_log_level: Overrides the CONSOLE_LOG_LEVEL constant.
|
|
51
|
+
include_data_types: Overrides the INCLUDE_DATA_TYPES constant.
|
|
52
|
+
locations_to_include: Overrides the locations filter.
|
|
53
|
+
paths_to_process: Explicit folder roots to scan for result files.
|
|
54
|
+
working_directory: Overrides the default WORKING_DIR.
|
|
55
|
+
"""
|
|
56
|
+
print_wrapper_banner(wrapper_file=Path(__file__), wrapper_version=WRAPPER_VERSION)
|
|
57
|
+
|
|
58
|
+
script_dir: Path = working_directory or WORKING_DIR
|
|
59
|
+
if not change_working_directory(target_dir=script_dir):
|
|
60
|
+
return 1
|
|
61
|
+
|
|
62
|
+
effective_console_log_level: str = console_log_level or CONSOLE_LOG_LEVEL
|
|
63
|
+
effective_data_types: list[str] = list(include_data_types or INCLUDE_DATA_TYPES)
|
|
64
|
+
effective_export_mode: Literal["excel", "parquet", "both"] = EXPORT_MODE
|
|
65
|
+
effective_paths_to_process: list[Path] = list(paths_to_process or PATHS_TO_PROCESS or (script_dir,))
|
|
66
|
+
|
|
67
|
+
main_processing(
|
|
68
|
+
paths_to_process=effective_paths_to_process,
|
|
69
|
+
include_data_types=effective_data_types,
|
|
70
|
+
console_log_level=effective_console_log_level,
|
|
71
|
+
locations_to_include=locations_to_include,
|
|
72
|
+
export_mode=effective_export_mode,
|
|
73
|
+
)
|
|
74
|
+
return 0
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _parse_cli_arguments() -> CommonWrapperOptions:
|
|
78
|
+
"""Parse command-line arguments to override script defaults.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
CommonWrapperOptions: Parsed and processed common arguments.
|
|
82
|
+
"""
|
|
83
|
+
parser = argparse.ArgumentParser(
|
|
84
|
+
description="Merge TUFLOW culvert maximums. Command-line options override the script defaults."
|
|
85
|
+
)
|
|
86
|
+
add_common_cli_arguments(parser=parser)
|
|
87
|
+
args: argparse.Namespace = parser.parse_args()
|
|
88
|
+
return parse_common_cli_arguments(args=args)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
if __name__ == "__main__":
|
|
92
|
+
common_options: CommonWrapperOptions = _parse_cli_arguments()
|
|
93
|
+
result: int = main(
|
|
94
|
+
console_log_level=common_options.console_log_level,
|
|
95
|
+
include_data_types=common_options.data_types,
|
|
96
|
+
locations_to_include=common_options.locations_to_include,
|
|
97
|
+
working_directory=common_options.working_directory,
|
|
98
|
+
)
|
|
99
|
+
print_wrapper_banner(
|
|
100
|
+
wrapper_file=Path(__file__),
|
|
101
|
+
wrapper_version=WRAPPER_VERSION,
|
|
102
|
+
leading_blank_line=True,
|
|
103
|
+
)
|
|
104
|
+
if not common_options.no_pause:
|
|
105
|
+
pause_console()
|
|
106
|
+
raise SystemExit(result)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# ryan-scripts\TUFLOW-python\culvert_results\combine_culvert_timeseries.py
|
|
2
|
+
"""Wrapper Script: Combine TUFLOW Culvert Timeseries.
|
|
3
|
+
|
|
4
|
+
This script acts as a mutable wrapper for `tuflow_culverts_timeseries.main_processing`.
|
|
5
|
+
It combines culvert timeseries data (e.g., flow vs time) from multiple CSV files.
|
|
6
|
+
Users can edit the hard-coded constants in this file to control data types and export format,
|
|
7
|
+
or use command-line arguments to override these settings.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Literal
|
|
12
|
+
|
|
13
|
+
WRAPPER_VERSION = "2026-08-02.1"
|
|
14
|
+
|
|
15
|
+
CONSOLE_LOG_LEVEL = "INFO"
|
|
16
|
+
INCLUDE_DATA_TYPES: tuple[str, ...] = ("Q", "V", "H", "CF", "Chan", "EOF")
|
|
17
|
+
EXPORT_MODE: Literal["excel", "parquet", "both"] = "excel"
|
|
18
|
+
WORKING_DIR: Path = Path(__file__).absolute().parent
|
|
19
|
+
# Optional explicit folder roots to scan. If left empty, the wrapper scans WORKING_DIR recursively.
|
|
20
|
+
PATHS_TO_PROCESS: tuple[Path, ...] = ()
|
|
21
|
+
# WORKING_DIR: Path = Path(r"E:\path\to\custom\directory")
|
|
22
|
+
|
|
23
|
+
import argparse
|
|
24
|
+
|
|
25
|
+
from ryan_library.functions.wrapper_utils import (
|
|
26
|
+
CommonWrapperOptions,
|
|
27
|
+
add_common_cli_arguments,
|
|
28
|
+
change_working_directory,
|
|
29
|
+
parse_common_cli_arguments,
|
|
30
|
+
pause_console,
|
|
31
|
+
print_wrapper_banner,
|
|
32
|
+
)
|
|
33
|
+
from ryan_library.orchestrators.tuflow.tuflow_culverts_timeseries import main_processing
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def main(
|
|
37
|
+
*,
|
|
38
|
+
console_log_level: str | None = None,
|
|
39
|
+
include_data_types: tuple[str, ...] | None = None,
|
|
40
|
+
locations_to_include: tuple[str, ...] | None = None,
|
|
41
|
+
paths_to_process: tuple[Path, ...] | None = None,
|
|
42
|
+
working_directory: Path | None = None,
|
|
43
|
+
) -> int:
|
|
44
|
+
"""Main entry point to combine culvert timeseries; double-clickable.
|
|
45
|
+
|
|
46
|
+
This function initializes the environment and calls `main_processing`.
|
|
47
|
+
It uses constants defined in this file (e.g., INCLUDE_DATA_TYPES) as default values.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
console_log_level: Overrides the CONSOLE_LOG_LEVEL constant.
|
|
51
|
+
include_data_types: Overrides the INCLUDE_DATA_TYPES constant.
|
|
52
|
+
locations_to_include: Overrides the locations filter.
|
|
53
|
+
paths_to_process: Explicit folder roots to scan for result files.
|
|
54
|
+
working_directory: Overrides the default WORKING_DIR.
|
|
55
|
+
"""
|
|
56
|
+
print_wrapper_banner(wrapper_file=Path(__file__), wrapper_version=WRAPPER_VERSION)
|
|
57
|
+
|
|
58
|
+
script_dir: Path = working_directory or WORKING_DIR
|
|
59
|
+
if not change_working_directory(target_dir=script_dir):
|
|
60
|
+
return 1
|
|
61
|
+
|
|
62
|
+
effective_console_log_level: str = console_log_level or CONSOLE_LOG_LEVEL
|
|
63
|
+
effective_data_types: list[str] = list(include_data_types or INCLUDE_DATA_TYPES)
|
|
64
|
+
effective_export_mode: Literal["excel", "parquet", "both"] = EXPORT_MODE
|
|
65
|
+
effective_paths_to_process: list[Path] = list(paths_to_process or PATHS_TO_PROCESS or (script_dir,))
|
|
66
|
+
main_processing(
|
|
67
|
+
paths_to_process=effective_paths_to_process,
|
|
68
|
+
include_data_types=effective_data_types,
|
|
69
|
+
console_log_level=effective_console_log_level,
|
|
70
|
+
locations_to_include=locations_to_include,
|
|
71
|
+
export_mode=effective_export_mode,
|
|
72
|
+
)
|
|
73
|
+
return 0
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _parse_cli_arguments() -> CommonWrapperOptions:
|
|
77
|
+
"""Parse command-line arguments to override script defaults.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
CommonWrapperOptions: Parsed and processed common arguments.
|
|
81
|
+
"""
|
|
82
|
+
parser = argparse.ArgumentParser(
|
|
83
|
+
description="Combine culvert timeseries exports. Command-line options override the script defaults."
|
|
84
|
+
)
|
|
85
|
+
add_common_cli_arguments(parser=parser)
|
|
86
|
+
args: argparse.Namespace = parser.parse_args()
|
|
87
|
+
return parse_common_cli_arguments(args=args)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
if __name__ == "__main__":
|
|
91
|
+
common_options: CommonWrapperOptions = _parse_cli_arguments()
|
|
92
|
+
result: int = main(
|
|
93
|
+
console_log_level=common_options.console_log_level,
|
|
94
|
+
include_data_types=common_options.data_types,
|
|
95
|
+
locations_to_include=common_options.locations_to_include,
|
|
96
|
+
working_directory=common_options.working_directory,
|
|
97
|
+
)
|
|
98
|
+
print_wrapper_banner(
|
|
99
|
+
wrapper_file=Path(__file__),
|
|
100
|
+
wrapper_version=WRAPPER_VERSION,
|
|
101
|
+
leading_blank_line=True,
|
|
102
|
+
)
|
|
103
|
+
if not common_options.no_pause:
|
|
104
|
+
pause_console()
|
|
105
|
+
raise SystemExit(result)
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# ryan-scripts\TUFLOW-python\culvert_results\create_mean_culvert_peak_report.py
|
|
2
|
+
"""Wrapper Script: Culvert Mean Peak Reports.
|
|
3
|
+
|
|
4
|
+
This script acts as a mutable wrapper for `run_culvert_mean_report`.
|
|
5
|
+
It generates a summary report calculating MEAN peak values across multiple durations for culverts.
|
|
6
|
+
Users can edit the hard-coded constants in this file to control data types and raw output,
|
|
7
|
+
or use command-line arguments to override these settings.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
WRAPPER_VERSION = "2026-08-02.1"
|
|
13
|
+
|
|
14
|
+
CONSOLE_LOG_LEVEL = "INFO" # or "DEBUG"
|
|
15
|
+
# Toggle the specific culvert data types to collect. Leave empty to accept the library defaults.
|
|
16
|
+
INCLUDED_DATA_TYPES: tuple[str, ...] = ("Nmx", "Cmx", "Chan", "ccA", "RLL_Qmx", "EOF")
|
|
17
|
+
# Toggle the export of the raw culvert-maximums sheet (may be extremely large).
|
|
18
|
+
EXPORT_RAW_MAXIMUMS: bool = False
|
|
19
|
+
# Change the working directory
|
|
20
|
+
WORKING_DIR: Path = Path(__file__).absolute().parent
|
|
21
|
+
# Optional explicit folder roots to scan. If left empty, the wrapper scans WORKING_DIR recursively.
|
|
22
|
+
PATHS_TO_PROCESS: tuple[Path, ...] = ()
|
|
23
|
+
# WORKING_DIR: Path = Path(r"E:\path\to\custom\directory")
|
|
24
|
+
|
|
25
|
+
import argparse
|
|
26
|
+
|
|
27
|
+
from ryan_library.functions.wrapper_utils import (
|
|
28
|
+
CommonWrapperOptions,
|
|
29
|
+
add_common_cli_arguments,
|
|
30
|
+
change_working_directory,
|
|
31
|
+
parse_common_cli_arguments,
|
|
32
|
+
pause_console,
|
|
33
|
+
print_wrapper_banner,
|
|
34
|
+
)
|
|
35
|
+
from ryan_library.orchestrators.tuflow.tuflow_culverts_mean import run_culvert_mean_report
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def main(
|
|
39
|
+
*,
|
|
40
|
+
console_log_level: str | None = None,
|
|
41
|
+
include_data_types: tuple[str, ...] | None = None,
|
|
42
|
+
locations_to_include: tuple[str, ...] | None = None,
|
|
43
|
+
paths_to_process: tuple[Path, ...] | None = None,
|
|
44
|
+
working_directory: Path | None = None,
|
|
45
|
+
) -> int:
|
|
46
|
+
"""Main entry point for culvert mean peak reporting.
|
|
47
|
+
|
|
48
|
+
This function initializes the environment and calls `run_culvert_mean_report`.
|
|
49
|
+
It resolves configuration by prioritizing CLI arguments, then falling back to the
|
|
50
|
+
hard-coded constants in this script.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
console_log_level: Overrides the CONSOLE_LOG_LEVEL constant.
|
|
54
|
+
include_data_types: Overrides the INCLUDED_DATA_TYPES constant.
|
|
55
|
+
locations_to_include: Overrides the LOCATIONS_TO_INCLUDE (implicit) settings.
|
|
56
|
+
paths_to_process: Explicit folder roots to scan for result files.
|
|
57
|
+
working_directory: Overrides the default WORKING_DIR.
|
|
58
|
+
"""
|
|
59
|
+
print_wrapper_banner(wrapper_file=Path(__file__), wrapper_version=WRAPPER_VERSION)
|
|
60
|
+
script_directory: Path = working_directory or WORKING_DIR
|
|
61
|
+
|
|
62
|
+
if not change_working_directory(target_dir=script_directory):
|
|
63
|
+
return 1
|
|
64
|
+
|
|
65
|
+
to_include_data_types: tuple[str, ...] | None = include_data_types or INCLUDED_DATA_TYPES or None
|
|
66
|
+
effective_console_log_level: str = console_log_level or CONSOLE_LOG_LEVEL
|
|
67
|
+
effective_locations: tuple[str, ...] | None = locations_to_include
|
|
68
|
+
effective_paths_to_process: tuple[Path, ...] | None = paths_to_process or PATHS_TO_PROCESS or None
|
|
69
|
+
|
|
70
|
+
run_culvert_mean_report(
|
|
71
|
+
script_directory=script_directory,
|
|
72
|
+
paths_to_process=effective_paths_to_process,
|
|
73
|
+
log_level=effective_console_log_level,
|
|
74
|
+
include_data_types=to_include_data_types,
|
|
75
|
+
locations_to_include=effective_locations,
|
|
76
|
+
export_raw=EXPORT_RAW_MAXIMUMS,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
return 0
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _parse_cli_arguments() -> CommonWrapperOptions:
|
|
83
|
+
"""Parse command-line arguments to override script defaults.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
CommonWrapperOptions: Parsed and processed common arguments.
|
|
87
|
+
"""
|
|
88
|
+
parser = argparse.ArgumentParser(
|
|
89
|
+
description="Create culvert mean peak reports. Command-line options override the script defaults."
|
|
90
|
+
)
|
|
91
|
+
add_common_cli_arguments(parser=parser)
|
|
92
|
+
args: argparse.Namespace = parser.parse_args()
|
|
93
|
+
return parse_common_cli_arguments(args=args)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
if __name__ == "__main__":
|
|
97
|
+
common_options: CommonWrapperOptions = _parse_cli_arguments()
|
|
98
|
+
result: int = main(
|
|
99
|
+
console_log_level=common_options.console_log_level,
|
|
100
|
+
include_data_types=common_options.data_types,
|
|
101
|
+
locations_to_include=common_options.locations_to_include,
|
|
102
|
+
working_directory=common_options.working_directory,
|
|
103
|
+
)
|
|
104
|
+
print_wrapper_banner(
|
|
105
|
+
wrapper_file=Path(__file__),
|
|
106
|
+
wrapper_version=WRAPPER_VERSION,
|
|
107
|
+
leading_blank_line=True,
|
|
108
|
+
)
|
|
109
|
+
if not common_options.no_pause:
|
|
110
|
+
pause_console()
|
|
111
|
+
raise SystemExit(result)
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# ryan-scripts\TUFLOW-python\culvert_results\create_median_culvert_peak_report.py
|
|
2
|
+
"""Wrapper Script: Culvert Median Peak Reports.
|
|
3
|
+
|
|
4
|
+
This script acts as a mutable wrapper for `run_culvert_median_report`.
|
|
5
|
+
It generates a summary report calculating MEDIAN peak values across multiple durations for culverts.
|
|
6
|
+
Users can edit the hard-coded constants in this file to control data types and raw output,
|
|
7
|
+
or use command-line arguments to override these settings.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
WRAPPER_VERSION = "2026-08-02.1"
|
|
13
|
+
|
|
14
|
+
CONSOLE_LOG_LEVEL = "INFO" # or "DEBUG"
|
|
15
|
+
# Toggle the specific culvert data types to collect. Leave empty to accept the library defaults.
|
|
16
|
+
INCLUDED_DATA_TYPES: tuple[str, ...] = ("Nmx", "Cmx", "Chan", "ccA", "RLL_Qmx", "EOF")
|
|
17
|
+
# Toggle the export of the raw culvert-maximums sheet (may be extremely large).
|
|
18
|
+
EXPORT_RAW_MAXIMUMS: bool = False
|
|
19
|
+
# Change the working directory
|
|
20
|
+
WORKING_DIR: Path = Path(__file__).absolute().parent
|
|
21
|
+
# Optional explicit folder roots to scan. If left empty, the wrapper scans WORKING_DIR recursively.
|
|
22
|
+
PATHS_TO_PROCESS: tuple[Path, ...] = ()
|
|
23
|
+
# WORKING_DIR: Path = Path(r"E:\path\to\custom\directory")
|
|
24
|
+
|
|
25
|
+
import argparse
|
|
26
|
+
|
|
27
|
+
from ryan_library.functions.wrapper_utils import (
|
|
28
|
+
CommonWrapperOptions,
|
|
29
|
+
add_common_cli_arguments,
|
|
30
|
+
change_working_directory,
|
|
31
|
+
parse_common_cli_arguments,
|
|
32
|
+
pause_console,
|
|
33
|
+
print_wrapper_banner,
|
|
34
|
+
)
|
|
35
|
+
from ryan_library.orchestrators.tuflow.tuflow_culverts_mean import run_culvert_median_report
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def main(
|
|
39
|
+
*,
|
|
40
|
+
console_log_level: str | None = None,
|
|
41
|
+
include_data_types: tuple[str, ...] | None = None,
|
|
42
|
+
locations_to_include: tuple[str, ...] | None = None,
|
|
43
|
+
paths_to_process: tuple[Path, ...] | None = None,
|
|
44
|
+
working_directory: Path | None = None,
|
|
45
|
+
) -> int:
|
|
46
|
+
"""Main entry point for culvert median peak reporting.
|
|
47
|
+
|
|
48
|
+
This function initializes the environment and calls `run_culvert_median_report`.
|
|
49
|
+
It resolves configuration by prioritizing CLI arguments, then falling back to the
|
|
50
|
+
hard-coded constants in this script.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
console_log_level: Overrides the CONSOLE_LOG_LEVEL constant.
|
|
54
|
+
include_data_types: Overrides the INCLUDED_DATA_TYPES constant.
|
|
55
|
+
locations_to_include: Overrides the LOCATIONS_TO_INCLUDE (implicit) settings.
|
|
56
|
+
paths_to_process: Explicit folder roots to scan for result files.
|
|
57
|
+
working_directory: Overrides the default WORKING_DIR.
|
|
58
|
+
"""
|
|
59
|
+
print_wrapper_banner(wrapper_file=Path(__file__), wrapper_version=WRAPPER_VERSION)
|
|
60
|
+
script_directory: Path = working_directory or WORKING_DIR
|
|
61
|
+
|
|
62
|
+
if not change_working_directory(target_dir=script_directory):
|
|
63
|
+
return 1
|
|
64
|
+
|
|
65
|
+
to_include_data_types: tuple[str, ...] | None = include_data_types or INCLUDED_DATA_TYPES or None
|
|
66
|
+
effective_console_log_level: str = console_log_level or CONSOLE_LOG_LEVEL
|
|
67
|
+
effective_locations: tuple[str, ...] | None = locations_to_include
|
|
68
|
+
effective_paths_to_process: tuple[Path, ...] | None = paths_to_process or PATHS_TO_PROCESS or None
|
|
69
|
+
|
|
70
|
+
run_culvert_median_report(
|
|
71
|
+
script_directory=script_directory,
|
|
72
|
+
paths_to_process=effective_paths_to_process,
|
|
73
|
+
log_level=effective_console_log_level,
|
|
74
|
+
include_data_types=to_include_data_types,
|
|
75
|
+
locations_to_include=effective_locations,
|
|
76
|
+
export_raw=EXPORT_RAW_MAXIMUMS,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
return 0
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _parse_cli_arguments() -> CommonWrapperOptions:
|
|
83
|
+
"""Parse command-line arguments to override script defaults.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
CommonWrapperOptions: Parsed and processed common arguments.
|
|
87
|
+
"""
|
|
88
|
+
parser = argparse.ArgumentParser(
|
|
89
|
+
description="Create culvert median peak reports. Command-line options override the script defaults."
|
|
90
|
+
)
|
|
91
|
+
add_common_cli_arguments(parser=parser)
|
|
92
|
+
args: argparse.Namespace = parser.parse_args()
|
|
93
|
+
return parse_common_cli_arguments(args=args)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
if __name__ == "__main__":
|
|
97
|
+
common_options: CommonWrapperOptions = _parse_cli_arguments()
|
|
98
|
+
result: int = main(
|
|
99
|
+
console_log_level=common_options.console_log_level,
|
|
100
|
+
include_data_types=common_options.data_types,
|
|
101
|
+
locations_to_include=common_options.locations_to_include,
|
|
102
|
+
working_directory=common_options.working_directory,
|
|
103
|
+
)
|
|
104
|
+
print_wrapper_banner(
|
|
105
|
+
wrapper_file=Path(__file__),
|
|
106
|
+
wrapper_version=WRAPPER_VERSION,
|
|
107
|
+
leading_blank_line=True,
|
|
108
|
+
)
|
|
109
|
+
if not common_options.no_pause:
|
|
110
|
+
pause_console()
|
|
111
|
+
raise SystemExit(result)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Maintained TUFLOW GIS-processing wrappers bundled with ryan-tools."""
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# ryan-scripts\TUFLOW-python\gis_processing\apply_qgis_styles_to_results.py
|
|
2
|
+
"""Wrapper Script: TUFLOW Results Styling.
|
|
3
|
+
|
|
4
|
+
This script acts as a mutable wrapper for `ryan_library.orchestrators.tuflow.tuflow_results_styling`.
|
|
5
|
+
It applies QGIS styles (.qml) to TUFLOW results (rasters/vectors) found in the target directory.
|
|
6
|
+
Users can define custom QML overrides in the `user_qml_overrides` dictionary within this file.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
WRAPPER_VERSION = "2026-10-16.1"
|
|
12
|
+
|
|
13
|
+
CONSOLE_LOG_LEVEL = "INFO"
|
|
14
|
+
WORKING_DIR: Path = Path(__file__).absolute().parent
|
|
15
|
+
|
|
16
|
+
# User Overrides: Define your custom QML paths here
|
|
17
|
+
user_qml_overrides: dict[str, str] = {
|
|
18
|
+
# "d_Max": "/path/to/custom/depth_for_legend_max2m.qml",
|
|
19
|
+
# "h_Max": "/path/to/custom/hmax.qml",
|
|
20
|
+
# Add other overrides as needed
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
import argparse
|
|
24
|
+
|
|
25
|
+
from loguru import logger
|
|
26
|
+
|
|
27
|
+
from ryan_library.functions.loguru_helpers import setup_logger
|
|
28
|
+
from ryan_library.functions.wrapper_utils import (
|
|
29
|
+
CommonWrapperOptions,
|
|
30
|
+
add_execution_cli_arguments,
|
|
31
|
+
change_working_directory,
|
|
32
|
+
parse_common_cli_arguments,
|
|
33
|
+
pause_console,
|
|
34
|
+
print_wrapper_banner,
|
|
35
|
+
)
|
|
36
|
+
from ryan_library.orchestrators.tuflow.tuflow_results_styling import TUFLOWResultsStyler
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def main(*, console_log_level: str | None = None, working_directory: Path | None = None) -> int:
|
|
40
|
+
"""Main entry point for the TUFLOW Results Styling script.
|
|
41
|
+
|
|
42
|
+
This function sets the working directory to the script's location (or CWD),
|
|
43
|
+
initializes the logger, and applies the configured styles using `TUFLOWResultsStyler`.
|
|
44
|
+
It handles basic error logging and keeps the console window open upon completion/error.
|
|
45
|
+
"""
|
|
46
|
+
print_wrapper_banner(wrapper_file=Path(__file__), wrapper_version=WRAPPER_VERSION)
|
|
47
|
+
try:
|
|
48
|
+
with setup_logger(console_log_level=console_log_level or CONSOLE_LOG_LEVEL):
|
|
49
|
+
script_location: Path = working_directory or WORKING_DIR
|
|
50
|
+
if not change_working_directory(target_dir=script_location):
|
|
51
|
+
return 1
|
|
52
|
+
|
|
53
|
+
# The orchestrator locates packaged styles, with a source-checkout fallback.
|
|
54
|
+
styler = TUFLOWResultsStyler(user_qml_overrides=user_qml_overrides)
|
|
55
|
+
styler.apply_styles()
|
|
56
|
+
|
|
57
|
+
logger.info("Styles were sourced from: {}", styler.default_styles_path)
|
|
58
|
+
return 0
|
|
59
|
+
|
|
60
|
+
except Exception:
|
|
61
|
+
logger.exception("TUFLOW result styling failed.")
|
|
62
|
+
return 1
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _parse_cli_arguments() -> CommonWrapperOptions:
|
|
66
|
+
"""Parse common execution overrides for the styling wrapper."""
|
|
67
|
+
parser = argparse.ArgumentParser(description="Apply configured QGIS styles to TUFLOW result files.")
|
|
68
|
+
add_execution_cli_arguments(parser=parser)
|
|
69
|
+
return parse_common_cli_arguments(args=parser.parse_args())
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
if __name__ == "__main__":
|
|
73
|
+
common_options: CommonWrapperOptions = _parse_cli_arguments()
|
|
74
|
+
result: int = main(
|
|
75
|
+
console_log_level=common_options.console_log_level,
|
|
76
|
+
working_directory=common_options.working_directory,
|
|
77
|
+
)
|
|
78
|
+
print_wrapper_banner(
|
|
79
|
+
wrapper_file=Path(__file__),
|
|
80
|
+
wrapper_version=WRAPPER_VERSION,
|
|
81
|
+
leading_blank_line=True,
|
|
82
|
+
)
|
|
83
|
+
if not common_options.no_pause:
|
|
84
|
+
pause_console()
|
|
85
|
+
raise SystemExit(result)
|