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.
Files changed (385) hide show
  1. culvert_results/__init__.py +1 -0
  2. culvert_results/combine_culvert_maximums.py +106 -0
  3. culvert_results/combine_culvert_timeseries.py +105 -0
  4. culvert_results/create_mean_culvert_peak_report.py +111 -0
  5. culvert_results/create_median_culvert_peak_report.py +111 -0
  6. gis_processing/__init__.py +1 -0
  7. gis_processing/apply_qgis_styles_to_results.py +85 -0
  8. gis_processing/rename_geopackage_layer_to_filename.py +174 -0
  9. gis_processing/split_network_layers_by_culvert_id.py +157 -0
  10. log_processing/__init__.py +1 -0
  11. log_processing/append_log_summary_to_master_workbook.py +119 -0
  12. log_processing/create_log_summary_report.py +104 -0
  13. model_management/__init__.py +1 -0
  14. model_management/collect_result_and_check_files.py +300 -0
  15. model_management/delete_duplicate_check_files.py +1037 -0
  16. model_management/run_tuflow_simulations.py +1584 -0
  17. model_management/verify_converted_tuflow_rasters.py +639 -0
  18. po_and_timeseries/__init__.py +1 -0
  19. po_and_timeseries/calculate_po_closure_durations.py +94 -0
  20. po_and_timeseries/check_po_timeseries_peaks.py +139 -0
  21. po_and_timeseries/check_timeseries_stability.py +151 -0
  22. po_and_timeseries/combine_po_results.py +126 -0
  23. po_and_timeseries/combine_pomm_results.py +127 -0
  24. po_and_timeseries/create_pomm_mean_peak_report.py +132 -0
  25. po_and_timeseries/create_pomm_median_peak_report.py +133 -0
  26. po_and_timeseries/generate_2d_po_label_list.py +202 -0
  27. po_and_timeseries/plot_po_scenario_timeseries.py +329 -0
  28. po_and_timeseries/plot_water_level_profiles.py +241 -0
  29. raster_processing/__init__.py +1 -0
  30. raster_processing/calculate_raster_differences.py +237 -0
  31. raster_processing/mask_velocity_by_depth.py +212 -0
  32. raster_processing/run_asc_to_asc_maximum_searches.py +120 -0
  33. raster_processing/run_asc_to_asc_mean_then_maximum.py +172 -0
  34. raster_processing/run_asc_to_asc_median_then_maximum.py +151 -0
  35. raster_processing/run_grouped_asc_to_asc_statistics.py +274 -0
  36. raster_processing/run_python_raster_calculations.py +183 -0
  37. ryan-scripts/12D-python/generate_culvert_lines.py +123 -0
  38. ryan-scripts/12D-python/generate_culvert_polygons.py +261 -0
  39. ryan-scripts/12D-python/thin-raster-terrain-for-12D_v5.py +315 -0
  40. ryan-scripts/12D-python/tif-to-LAS-valid-only_v6.py +139 -0
  41. ryan-scripts/12D-python/tif-to-csv-valid-only_v6.py +104 -0
  42. ryan-scripts/12D-python/tif-to-csv-valid-only_v6a.py +105 -0
  43. ryan-scripts/AutoCAD-python/dwg-polygons-txt-to-csv.py +164 -0
  44. ryan-scripts/AutoCAD-python/dwg-to-points.py +360 -0
  45. ryan-scripts/AutoCAD-python/group-by-entity-colour-and-dissolve-to-hatch.py +177 -0
  46. ryan-scripts/AutoCAD-python/group-by-entity-colour-and-dissolve-to-hatch_dask3.py +230 -0
  47. ryan-scripts/AutoCAD-python/group-by-entity-colour-and-dissolve.py +146 -0
  48. ryan-scripts/AutoCAD-python/group-by-entity-colour-and-dissolve3.py +184 -0
  49. ryan-scripts/AutoCAD-python/group-by-entity-colour.py +76 -0
  50. ryan-scripts/GlobalMapper/DXF-to-float_v1.gms +18 -0
  51. ryan-scripts/README.md +107 -0
  52. ryan-scripts/RORB-python/RORB-find-closure-durations.py +143 -0
  53. ryan-scripts/RORB-python/extract_rainfall-to-TUFLOW.py +278 -0
  54. ryan-scripts/RORB-python/hydrograph_extract_rorb_csv.py +352 -0
  55. ryan-scripts/RORB-python/plot_ensemble_results.py +125 -0
  56. ryan-scripts/RORB-python/rorb-peaks_v2.py +220 -0
  57. ryan-scripts/TUFLOW-bat/asc2asc_max_by_search.bat +5 -0
  58. ryan-scripts/TUFLOW-bat/asc_to_asc-DIFF.bat +36 -0
  59. ryan-scripts/TUFLOW-bat/asc_to_asc-MAX.bat +23 -0
  60. ryan-scripts/TUFLOW-python/README.md +242 -0
  61. ryan-scripts/TUFLOW-python/culvert_results/__init__.py +1 -0
  62. ryan-scripts/TUFLOW-python/culvert_results/combine_culvert_maximums.py +106 -0
  63. ryan-scripts/TUFLOW-python/culvert_results/combine_culvert_timeseries.py +105 -0
  64. ryan-scripts/TUFLOW-python/culvert_results/create_mean_culvert_peak_report.py +111 -0
  65. ryan-scripts/TUFLOW-python/culvert_results/create_median_culvert_peak_report.py +111 -0
  66. ryan-scripts/TUFLOW-python/gis_processing/__init__.py +1 -0
  67. ryan-scripts/TUFLOW-python/gis_processing/apply_qgis_styles_to_results.py +85 -0
  68. ryan-scripts/TUFLOW-python/gis_processing/rename_geopackage_layer_to_filename.py +174 -0
  69. ryan-scripts/TUFLOW-python/gis_processing/split_network_layers_by_culvert_id.py +157 -0
  70. ryan-scripts/TUFLOW-python/log_processing/__init__.py +1 -0
  71. ryan-scripts/TUFLOW-python/log_processing/append_log_summary_to_master_workbook.py +119 -0
  72. ryan-scripts/TUFLOW-python/log_processing/create_log_summary_report.py +104 -0
  73. ryan-scripts/TUFLOW-python/model_management/__init__.py +1 -0
  74. ryan-scripts/TUFLOW-python/model_management/collect_result_and_check_files.py +300 -0
  75. ryan-scripts/TUFLOW-python/model_management/delete_duplicate_check_files.py +1037 -0
  76. ryan-scripts/TUFLOW-python/model_management/run_tuflow_simulations.py +1584 -0
  77. ryan-scripts/TUFLOW-python/model_management/verify_converted_tuflow_rasters.py +639 -0
  78. ryan-scripts/TUFLOW-python/po_and_timeseries/__init__.py +1 -0
  79. ryan-scripts/TUFLOW-python/po_and_timeseries/calculate_po_closure_durations.py +94 -0
  80. ryan-scripts/TUFLOW-python/po_and_timeseries/check_po_timeseries_peaks.py +139 -0
  81. ryan-scripts/TUFLOW-python/po_and_timeseries/check_timeseries_stability.py +151 -0
  82. ryan-scripts/TUFLOW-python/po_and_timeseries/combine_po_results.py +126 -0
  83. ryan-scripts/TUFLOW-python/po_and_timeseries/combine_pomm_results.py +127 -0
  84. ryan-scripts/TUFLOW-python/po_and_timeseries/create_pomm_mean_peak_report.py +132 -0
  85. ryan-scripts/TUFLOW-python/po_and_timeseries/create_pomm_median_peak_report.py +133 -0
  86. ryan-scripts/TUFLOW-python/po_and_timeseries/generate_2d_po_label_list.py +202 -0
  87. ryan-scripts/TUFLOW-python/po_and_timeseries/plot_po_scenario_timeseries.py +329 -0
  88. ryan-scripts/TUFLOW-python/po_and_timeseries/plot_water_level_profiles.py +241 -0
  89. ryan-scripts/TUFLOW-python/raster_processing/__init__.py +1 -0
  90. ryan-scripts/TUFLOW-python/raster_processing/calculate_raster_differences.py +237 -0
  91. ryan-scripts/TUFLOW-python/raster_processing/mask_velocity_by_depth.py +212 -0
  92. ryan-scripts/TUFLOW-python/raster_processing/run_asc_to_asc_maximum_searches.py +120 -0
  93. ryan-scripts/TUFLOW-python/raster_processing/run_asc_to_asc_mean_then_maximum.py +172 -0
  94. ryan-scripts/TUFLOW-python/raster_processing/run_asc_to_asc_median_then_maximum.py +151 -0
  95. ryan-scripts/TUFLOW-python/raster_processing/run_grouped_asc_to_asc_statistics.py +274 -0
  96. ryan-scripts/TUFLOW-python/raster_processing/run_python_raster_calculations.py +183 -0
  97. ryan-scripts/WRAPPER_STANDARD.md +195 -0
  98. ryan-scripts/cad-python/dtm_str_converter_to_gpkg.py +1001 -0
  99. ryan-scripts/cad-python/extract_dxf_polyface.py +322 -0
  100. ryan-scripts/cad-python/polyface_parquet_to_gpkg.py +405 -0
  101. ryan-scripts/cad-python/process_arch_d.py +237 -0
  102. ryan-scripts/culvert.py +522 -0
  103. ryan-scripts/docx-python/word_style_audit.py +483 -0
  104. ryan-scripts/file-management-python/archive_compress_folder.py +245 -0
  105. ryan-scripts/file-management-python/archive_compress_individual.py +182 -0
  106. ryan-scripts/file-management-python/archive_extract.py +139 -0
  107. ryan-scripts/file-management-python/copy_file.py +73 -0
  108. ryan-scripts/file-management-python/copy_folder.py +326 -0
  109. ryan-scripts/file-management-python/list_files_recursive.py +97 -0
  110. ryan-scripts/file-management-python/rename-msg-files-argparse-folder.py +300 -0
  111. ryan-scripts/fix-chatgpt-type-hints.py +78 -0
  112. ryan-scripts/floodway.py +275 -0
  113. ryan-scripts/gdal-bat/LAZ-to-LAS.bat +47 -0
  114. ryan-scripts/gdal-bat/README.md +28 -0
  115. ryan-scripts/gdal-bat/gdal_edit_Set_nodata.bat +109 -0
  116. ryan-scripts/gdal-bat/gdal_flood_extent_sieve.bat +220 -0
  117. ryan-scripts/gdal-bat/gdal_merge.bat +66 -0
  118. ryan-scripts/gdal-bat/gdal_merge_CLI.bat +305 -0
  119. ryan-scripts/gdal-bat/gdal_merge_xyz_extent.bat +242 -0
  120. ryan-scripts/gdal-bat/gdal_raster_footprint.bat +127 -0
  121. ryan-scripts/gdal-python/README.md +169 -0
  122. ryan-scripts/gdal-python/audit_CRS.py +260 -0
  123. ryan-scripts/gdal-python/batch_vector_clip.py +219 -0
  124. ryan-scripts/gdal-python/build_VRT.py +131 -0
  125. ryan-scripts/gdal-python/check_flt_tif.py +158 -0
  126. ryan-scripts/gdal-python/convert_gdb_to_gpkg.py +168 -0
  127. ryan-scripts/gdal-python/gdal_flood_extent.py +184 -0
  128. ryan-scripts/gdal-python/gdal_merge.py +152 -0
  129. ryan-scripts/gdal-python/gdal_merge_by_extent.py +155 -0
  130. ryan-scripts/gdal-python/gdal_raster_footprint.py +123 -0
  131. ryan-scripts/gdal-python/gdal_raster_to_xyz.py +180 -0
  132. ryan-scripts/gdal-python/gdal_retile_wrapper.py +122 -0
  133. ryan-scripts/gdal-python/gdal_set_nodata.py +116 -0
  134. ryan-scripts/gdal-python/gdal_stage_storage.py +171 -0
  135. ryan-scripts/gdal-python/gdal_translate_TIF_ovr.py +176 -0
  136. ryan-scripts/gdal-python/gdal_unset_nodata.py +112 -0
  137. ryan-scripts/gdal-python/gdal_vector_translate.py +69 -0
  138. ryan-scripts/gdal-python/gdaladdo_tif_pyramids.py +135 -0
  139. ryan-scripts/gdal-python/gdalwarp_clip_to_polygon.py +201 -0
  140. ryan-scripts/gdal-python/laz_to_las.py +118 -0
  141. ryan-scripts/gdal-python/recompress_geotiffs.py +130 -0
  142. ryan-scripts/gdal-python/split_vector_by_attribute.py +203 -0
  143. ryan-scripts/gdal-python/vacuum_geopackages.py +110 -0
  144. ryan-scripts/hydrology-python/ARF-calcs.py +390 -0
  145. ryan-scripts/hydrology-python/EAS.py +359 -0
  146. ryan-scripts/hydrology-python/RFFE_Only_v6.py +301 -0
  147. ryan-scripts/hydrology-python/RFFE_Only_v6_standalone.py +269 -0
  148. ryan-scripts/hydrology-python/aep_ari_conversions.py +29 -0
  149. ryan-scripts/hydrology-python/combine_ifds_v2.py +331 -0
  150. ryan-scripts/misc-python/heic_to_jpeg.py +216 -0
  151. ryan-scripts/misc-python/remove_excel_protection.py +169 -0
  152. ryan-scripts/other/PDFXChangeEditorSettings_250206.xces +0 -0
  153. ryan-scripts/other/audit_qgis_projects.py +149 -0
  154. ryan-scripts/other/shapefile-explorer-types.ps1 +74 -0
  155. ryan-scripts/pdf-python/break_pdf_signatures.py +193 -0
  156. ryan-scripts/pdf-python/ocg_clean_file.py +579 -0
  157. ryan-scripts/pdf-python/ocg_clean_file_alternative.py +850 -0
  158. ryan-scripts/pdf-python/pypdf_decrypt.py +68 -0
  159. ryan-scripts/pdf-python/remove_pdf_restrictions.py +197 -0
  160. ryan-scripts/point-cloud-python/clean_xyz.py +262 -0
  161. ryan-scripts/point-cloud-python/clip_las_to_polygon.py +227 -0
  162. ryan-scripts/point-cloud-python/parallel-reorder-xyz-updated.py +97 -0
  163. ryan-scripts/powershell/date_to_front_of_msg_v3.ps1 +49 -0
  164. ryan-scripts/powershell/self-signing.ps1 +151 -0
  165. ryan-scripts/python-not-polished/hydrograph_extract_rorb_csv-opt2_132.py +360 -0
  166. ryan-scripts/raster-python/square_raster_cells.py +99 -0
  167. ryan-scripts/raster-python/tif_to_xyz_drop_na_v1.py +121 -0
  168. ryan-scripts/raster-python/tif_to_xyz_drop_na_v2.py +172 -0
  169. ryan-scripts/repair-folder-permissions.ps1 +175 -0
  170. ryan-scripts/tuflow/PROJECT_SETUP.md +112 -0
  171. ryan-scripts/tuflow/find_missing_tlf_runs.py +123 -0
  172. ryan-scripts/tuflow/init_tuflow_project.py +151 -0
  173. ryan-scripts/tuflow/tuflow_culvert_from_1d_nwk.py +612 -0
  174. ryan-scripts/tuflow/tuflow_culvert_from_maximums.py +511 -0
  175. ryan-scripts/tuflow/tuflow_to_hy8.py +134 -0
  176. ryan-scripts/unsorted-bat/VACUUM.BAT +74 -0
  177. ryan-scripts/unsorted-bat/del_xf.bat +38 -0
  178. ryan-scripts/unsorted-bat/dir.bat +14 -0
  179. ryan-scripts/unsorted-bat/dir_recursive.bat +14 -0
  180. ryan-scripts/unsorted-bat/shutdown-a.bat +8 -0
  181. ryan-scripts/unsorted-python/export_water_level_profile_tables_50m.py +697 -0
  182. ryan-scripts/unsorted-python/plot_water_level_profiles.py +387 -0
  183. ryan_library/__init__.py +5 -0
  184. ryan_library/classes/__init__.py +0 -0
  185. ryan_library/classes/column_definitions.json +833 -0
  186. ryan_library/classes/column_definitions.py +192 -0
  187. ryan_library/classes/culvert/__init__.py +64 -0
  188. ryan_library/classes/culvert/alternative.py +25 -0
  189. ryan_library/classes/culvert/candidate.py +20 -0
  190. ryan_library/classes/culvert/criteria.py +95 -0
  191. ryan_library/classes/culvert/crossing.py +232 -0
  192. ryan_library/classes/culvert/event.py +51 -0
  193. ryan_library/classes/culvert/project.py +66 -0
  194. ryan_library/classes/culvert/results.py +144 -0
  195. ryan_library/classes/culvert/scenario.py +83 -0
  196. ryan_library/classes/culvert/uncertainty.py +142 -0
  197. ryan_library/classes/culvert/uncertainty_results.py +78 -0
  198. ryan_library/classes/floodway/__init__.py +48 -0
  199. ryan_library/classes/floodway/envelope.py +90 -0
  200. ryan_library/classes/floodway/models.py +250 -0
  201. ryan_library/classes/floodway/protection.py +130 -0
  202. ryan_library/classes/floodway/results.py +243 -0
  203. ryan_library/classes/path_mappings.json +3 -0
  204. ryan_library/classes/suffixes_and_dtypes.py +463 -0
  205. ryan_library/classes/tuflow_results_validation_and_datatypes.json +388 -0
  206. ryan_library/classes/tuflow_string_classes.py +362 -0
  207. ryan_library/functions/RORB/__init__.py +0 -0
  208. ryan_library/functions/RORB/ensemble_analysis.py +112 -0
  209. ryan_library/functions/RORB/ensemble_plotting.py +162 -0
  210. ryan_library/functions/RORB/read_rorb_files.py +232 -0
  211. ryan_library/functions/__init__.py +0 -0
  212. ryan_library/functions/archive_utils.py +116 -0
  213. ryan_library/functions/culvert/__init__.py +120 -0
  214. ryan_library/functions/culvert/adapter.py +117 -0
  215. ryan_library/functions/culvert/assessment.py +109 -0
  216. ryan_library/functions/culvert/candidate_generation.py +72 -0
  217. ryan_library/functions/culvert/config.py +730 -0
  218. ryan_library/functions/culvert/event_import.py +66 -0
  219. ryan_library/functions/culvert/export.py +413 -0
  220. ryan_library/functions/culvert/plotting.py +105 -0
  221. ryan_library/functions/culvert/tuflow_attributes.py +269 -0
  222. ryan_library/functions/culvert/tuflow_configuration.py +176 -0
  223. ryan_library/functions/culvert/tuflow_engines.py +602 -0
  224. ryan_library/functions/culvert/uncertainty.py +78 -0
  225. ryan_library/functions/culvert/uncertainty_evaluation.py +125 -0
  226. ryan_library/functions/culvert/uncertainty_export.py +260 -0
  227. ryan_library/functions/culvert/uncertainty_statistics.py +118 -0
  228. ryan_library/functions/dashboard_workflow.py +265 -0
  229. ryan_library/functions/dataframe_helpers.py +144 -0
  230. ryan_library/functions/excel_export.py +666 -0
  231. ryan_library/functions/file_utils.py +303 -0
  232. ryan_library/functions/file_verification.py +62 -0
  233. ryan_library/functions/floodway/__init__.py +131 -0
  234. ryan_library/functions/floodway/adapter.py +48 -0
  235. ryan_library/functions/floodway/assessment.py +194 -0
  236. ryan_library/functions/floodway/config.py +215 -0
  237. ryan_library/functions/floodway/envelope.py +67 -0
  238. ryan_library/functions/floodway/export.py +316 -0
  239. ryan_library/functions/floodway/hec23.py +234 -0
  240. ryan_library/functions/floodway/hydraulics.py +237 -0
  241. ryan_library/functions/floodway/mrwa_protection.py +106 -0
  242. ryan_library/functions/gdal/__init__.py +0 -0
  243. ryan_library/functions/gdal/profiling.py +255 -0
  244. ryan_library/functions/gdal/raster_processing.py +752 -0
  245. ryan_library/functions/gdal/raster_recompression.py +482 -0
  246. ryan_library/functions/gdal/stage_storage.py +157 -0
  247. ryan_library/functions/gdal/vector_conversion.py +187 -0
  248. ryan_library/functions/hy8/__init__.py +18 -0
  249. ryan_library/functions/hy8/run_hy8_bridge.py +451 -0
  250. ryan_library/functions/lidar_processing.py +74 -0
  251. ryan_library/functions/live_dashboard.py +393 -0
  252. ryan_library/functions/loguru_helpers.py +405 -0
  253. ryan_library/functions/misc_functions.py +39 -0
  254. ryan_library/functions/multiprocessing_helpers.py +22 -0
  255. ryan_library/functions/pandas/__init__.py +0 -0
  256. ryan_library/functions/pandas/median_calc.py +150 -0
  257. ryan_library/functions/parse_tlf.py +526 -0
  258. ryan_library/functions/path_stuff.py +151 -0
  259. ryan_library/functions/process_12D_culverts.py +487 -0
  260. ryan_library/functions/rock_protection.py +157 -0
  261. ryan_library/functions/string_helpers.py +39 -0
  262. ryan_library/functions/terrain_processing.py +210 -0
  263. ryan_library/functions/tlf_missing_runs.py +274 -0
  264. ryan_library/functions/tuflow/__init__.py +0 -0
  265. ryan_library/functions/tuflow/asc_to_asc_raster_operations.py +567 -0
  266. ryan_library/functions/tuflow/asc_to_asc_runner.py +148 -0
  267. ryan_library/functions/tuflow/closure_durations_functions.py +176 -0
  268. ryan_library/functions/tuflow/logsummary_excel_append.py +340 -0
  269. ryan_library/functions/tuflow/notebook_helpers.py +810 -0
  270. ryan_library/functions/tuflow/po_timeseries_checks.py +807 -0
  271. ryan_library/functions/tuflow/pomm_utils.py +783 -0
  272. ryan_library/functions/tuflow/tuflow_common.py +276 -0
  273. ryan_library/functions/tuflow/tuflow_result_naming.py +78 -0
  274. ryan_library/functions/tuflow/wrapper_helpers.py +42 -0
  275. ryan_library/functions/versioning.py +12 -0
  276. ryan_library/functions/wrapper_utils.py +236 -0
  277. ryan_library/mcp/__init__.py +1 -0
  278. ryan_library/mcp/models.py +167 -0
  279. ryan_library/mcp/registry.py +412 -0
  280. ryan_library/mcp/server.py +480 -0
  281. ryan_library/orchestrators/__init__.py +2 -0
  282. ryan_library/orchestrators/culvert/__init__.py +24 -0
  283. ryan_library/orchestrators/culvert/analyse.py +22 -0
  284. ryan_library/orchestrators/culvert/design.py +85 -0
  285. ryan_library/orchestrators/culvert/events.py +50 -0
  286. ryan_library/orchestrators/culvert/rating.py +23 -0
  287. ryan_library/orchestrators/culvert/report.py +82 -0
  288. ryan_library/orchestrators/culvert/solve.py +34 -0
  289. ryan_library/orchestrators/culvert/uncertainty.py +78 -0
  290. ryan_library/orchestrators/culvert/uncertainty_report.py +72 -0
  291. ryan_library/orchestrators/floodway/__init__.py +33 -0
  292. ryan_library/orchestrators/floodway/assess.py +509 -0
  293. ryan_library/orchestrators/floodway/report.py +237 -0
  294. ryan_library/orchestrators/floodway/sweep.py +281 -0
  295. ryan_library/orchestrators/gdal/__init__.py +2 -0
  296. ryan_library/orchestrators/gdal/file_geodatabase_export.py +205 -0
  297. ryan_library/orchestrators/gdal/gdal_flood_extent.py +193 -0
  298. ryan_library/orchestrators/gdal/raster_maintenance.py +84 -0
  299. ryan_library/orchestrators/gdal/raster_merge.py +153 -0
  300. ryan_library/orchestrators/gdal/raster_mosaic.py +135 -0
  301. ryan_library/orchestrators/gdal/raster_recompression.py +202 -0
  302. ryan_library/orchestrators/gdal/raster_workflows.py +182 -0
  303. ryan_library/orchestrators/rorb/__init__.py +2 -0
  304. ryan_library/orchestrators/rorb/closure_durations.py +214 -0
  305. ryan_library/orchestrators/rorb/ensemble_plotting.py +107 -0
  306. ryan_library/orchestrators/tuflow/__init__.py +2 -0
  307. ryan_library/orchestrators/tuflow/_combination_workflow.py +147 -0
  308. ryan_library/orchestrators/tuflow/asc2asc_max_by_search.py +157 -0
  309. ryan_library/orchestrators/tuflow/asc2asc_mean_then_max_by_search.py +134 -0
  310. ryan_library/orchestrators/tuflow/asc2asc_stat_then_max_by_search.py +461 -0
  311. ryan_library/orchestrators/tuflow/asc_to_asc_batch.py +114 -0
  312. ryan_library/orchestrators/tuflow/closure_durations.py +141 -0
  313. ryan_library/orchestrators/tuflow/peak_check_po_csvs.py +146 -0
  314. ryan_library/orchestrators/tuflow/po_combine.py +74 -0
  315. ryan_library/orchestrators/tuflow/pomm_combine.py +100 -0
  316. ryan_library/orchestrators/tuflow/pomm_max_items.py +222 -0
  317. ryan_library/orchestrators/tuflow/project_setup.py +467 -0
  318. ryan_library/orchestrators/tuflow/tlf_missing_runs.py +43 -0
  319. ryan_library/orchestrators/tuflow/tuflow_culverts_mean.py +458 -0
  320. ryan_library/orchestrators/tuflow/tuflow_culverts_merge.py +124 -0
  321. ryan_library/orchestrators/tuflow/tuflow_culverts_timeseries.py +114 -0
  322. ryan_library/orchestrators/tuflow/tuflow_logsummary.py +391 -0
  323. ryan_library/orchestrators/tuflow/tuflow_logsummary_append.py +93 -0
  324. ryan_library/orchestrators/tuflow/tuflow_results_styling.py +257 -0
  325. ryan_library/orchestrators/tuflow/tuflow_timeseries_stability.py +187 -0
  326. ryan_library/orchestrators/tuflow/water_level_profiles.py +739 -0
  327. ryan_library/processors/__init__.py +0 -0
  328. ryan_library/processors/tuflow/__init__.py +56 -0
  329. ryan_library/processors/tuflow/base_processor.py +736 -0
  330. ryan_library/processors/tuflow/max_data_processor.py +52 -0
  331. ryan_library/processors/tuflow/maximums_1d/CmxProcessor.py +111 -0
  332. ryan_library/processors/tuflow/maximums_1d/NmxProcessor.py +98 -0
  333. ryan_library/processors/tuflow/maximums_1d/__init__.py +8 -0
  334. ryan_library/processors/tuflow/maximums_1d/ccAProcessor.py +290 -0
  335. ryan_library/processors/tuflow/other_processors/ChanProcessor.py +73 -0
  336. ryan_library/processors/tuflow/other_processors/EOFProcessor.py +150 -0
  337. ryan_library/processors/tuflow/other_processors/POMMProcessor.py +126 -0
  338. ryan_library/processors/tuflow/other_processors/POProcessor.py +149 -0
  339. ryan_library/processors/tuflow/other_processors/RLLQmxProcessor.py +60 -0
  340. ryan_library/processors/tuflow/other_processors/TLFProcessor.py +96 -0
  341. ryan_library/processors/tuflow/other_processors/__init__.py +18 -0
  342. ryan_library/processors/tuflow/processor_collection.py +999 -0
  343. ryan_library/processors/tuflow/timeseries_1d/CFProcessor.py +40 -0
  344. ryan_library/processors/tuflow/timeseries_1d/HProcessor.py +70 -0
  345. ryan_library/processors/tuflow/timeseries_1d/QProcessor.py +30 -0
  346. ryan_library/processors/tuflow/timeseries_1d/VProcessor.py +19 -0
  347. ryan_library/processors/tuflow/timeseries_1d/__init__.py +9 -0
  348. ryan_library/processors/tuflow/timeseries_helpers.py +73 -0
  349. ryan_library/processors/tuflow/timeseries_processor.py +352 -0
  350. ryan_library/py.typed +0 -0
  351. ryan_library/resources/__init__.py +2 -0
  352. ryan_library/resources/mcp/__init__.py +1 -0
  353. ryan_library/resources/mcp/gdal_cli_tools.json +236 -0
  354. ryan_library/resources/mcp/workflows.json +486 -0
  355. ryan_library/resources/qgis/__init__.py +2 -0
  356. ryan_library/resources/qgis/tuflow/1d_nwk barrels.qml +208 -0
  357. ryan_library/resources/qgis/tuflow/2d_loc_qa_check.qml +1369 -0
  358. ryan_library/resources/qgis/tuflow/Depth Diff GOOOD.qml +69 -0
  359. ryan_library/resources/qgis/tuflow/_1d_ccA_L.qml +1194 -0
  360. ryan_library/resources/qgis/tuflow/__init__.py +2 -0
  361. ryan_library/resources/qgis/tuflow/depth_for_legend_max2m.qml +179 -0
  362. ryan_library/resources/qgis/tuflow/hillshade.qml +180 -0
  363. ryan_library/resources/qgis/tuflow/hmax.qml +330 -0
  364. ryan_library/resources/qgis/tuflow/velocities scour protection mrwa.qml +91 -0
  365. ryan_library/resources/qgis/tuflow/velocity_vectors.qml +474 -0
  366. ryan_library/resources/tuflow_templates/.gitignore +28 -0
  367. ryan_library/resources/tuflow_templates/__init__.py +2 -0
  368. ryan_library/resources/tuflow_templates/model/BOUND_01.tbc +10 -0
  369. ryan_library/resources/tuflow_templates/model/EVENTS_01.tef +215 -0
  370. ryan_library/resources/tuflow_templates/model/GEOM_01.tgc +29 -0
  371. ryan_library/resources/tuflow_templates/model/Materials_01.csv +13 -0
  372. ryan_library/resources/tuflow_templates/model/Soil_01.tsoilf +4 -0
  373. ryan_library/resources/tuflow_templates/runs/Create_Empties.tcf +3 -0
  374. ryan_library/resources/tuflow_templates/runs/__project___01_~s2~_~s1~_~e1~_~e2~_~e4~_~e3~_~s4~.tcf +89 -0
  375. ryan_library/resources/tuflow_templates/runs/empties.bat +4 -0
  376. ryan_library/resources/tuflow_templates/runs/model_cell_sizes_01.trd +32 -0
  377. ryan_library/resources/tuflow_templates/runs/run_times_01.trd +46 -0
  378. ryan_tools-26.10.18.9.dist-info/METADATA +350 -0
  379. ryan_tools-26.10.18.9.dist-info/RECORD +385 -0
  380. ryan_tools-26.10.18.9.dist-info/WHEEL +5 -0
  381. ryan_tools-26.10.18.9.dist-info/entry_points.txt +2 -0
  382. ryan_tools-26.10.18.9.dist-info/licenses/LICENSE +73 -0
  383. ryan_tools-26.10.18.9.dist-info/top_level.txt +8 -0
  384. vendor/PyHMA/__init__.py +624 -0
  385. 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)