hydroloom 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. hydroloom-0.1.0/.gitignore +28 -0
  2. hydroloom-0.1.0/CHANGELOG.md +18 -0
  3. hydroloom-0.1.0/LICENSE +116 -0
  4. hydroloom-0.1.0/PKG-INFO +246 -0
  5. hydroloom-0.1.0/README.md +228 -0
  6. hydroloom-0.1.0/hatch_build.py +32 -0
  7. hydroloom-0.1.0/inst/extdata/abbreviations.json +4 -0
  8. hydroloom-0.1.0/inst/extdata/abbreviations.schema.json +18 -0
  9. hydroloom-0.1.0/inst/extdata/coastal_example.gpkg +0 -0
  10. hydroloom-0.1.0/inst/extdata/conformance/algorithms/TEMPLATE.md +85 -0
  11. hydroloom-0.1.0/inst/extdata/conformance/algorithms/add_toids.md +144 -0
  12. hydroloom-0.1.0/inst/extdata/conformance/algorithms/add_topo_sort.md +160 -0
  13. hydroloom-0.1.0/inst/extdata/conformance/algorithms/align_names.md +140 -0
  14. hydroloom-0.1.0/inst/extdata/conformance/algorithms/check_hy_graph.md +405 -0
  15. hydroloom-0.1.0/inst/extdata/conformance/algorithms/hy.md +192 -0
  16. hydroloom-0.1.0/inst/extdata/conformance/algorithms/hy_capabilities.md +314 -0
  17. hydroloom-0.1.0/inst/extdata/conformance/algorithms/hy_network_type.md +292 -0
  18. hydroloom-0.1.0/inst/extdata/conformance/algorithms/hy_reverse.md +113 -0
  19. hydroloom-0.1.0/inst/extdata/conformance/algorithms/hydroloom_name_definitions.md +128 -0
  20. hydroloom-0.1.0/inst/extdata/conformance/algorithms/hydroloom_names.md +298 -0
  21. hydroloom-0.1.0/inst/extdata/conformance/algorithms/is.hy.md +210 -0
  22. hydroloom-0.1.0/inst/extdata/conformance/algorithms/is_dendritic.md +219 -0
  23. hydroloom-0.1.0/inst/extdata/conformance/algorithms/make_index_ids.md +145 -0
  24. hydroloom-0.1.0/inst/extdata/conformance/algorithms/navigate_network_dfs.md +162 -0
  25. hydroloom-0.1.0/inst/extdata/conformance/algorithms/sort_network.md +160 -0
  26. hydroloom-0.1.0/inst/extdata/conformance/expected/add_toids.gpkg +0 -0
  27. hydroloom-0.1.0/inst/extdata/conformance/expected/add_topo_sort.gpkg +0 -0
  28. hydroloom-0.1.0/inst/extdata/conformance/expected/align_names.gpkg +0 -0
  29. hydroloom-0.1.0/inst/extdata/conformance/expected/check_hy_graph.gpkg +0 -0
  30. hydroloom-0.1.0/inst/extdata/conformance/expected/hy.gpkg +0 -0
  31. hydroloom-0.1.0/inst/extdata/conformance/expected/hy_capabilities.gpkg +0 -0
  32. hydroloom-0.1.0/inst/extdata/conformance/expected/hy_network_type.gpkg +0 -0
  33. hydroloom-0.1.0/inst/extdata/conformance/expected/hy_reverse.gpkg +0 -0
  34. hydroloom-0.1.0/inst/extdata/conformance/expected/hydroloom_name_definitions.gpkg +0 -0
  35. hydroloom-0.1.0/inst/extdata/conformance/expected/hydroloom_names.gpkg +0 -0
  36. hydroloom-0.1.0/inst/extdata/conformance/expected/is.hy.gpkg +0 -0
  37. hydroloom-0.1.0/inst/extdata/conformance/expected/is_dendritic.gpkg +0 -0
  38. hydroloom-0.1.0/inst/extdata/conformance/expected/make_index_ids.gpkg +0 -0
  39. hydroloom-0.1.0/inst/extdata/conformance/expected/navigate_network_dfs.gpkg +0 -0
  40. hydroloom-0.1.0/inst/extdata/conformance/expected/sort_network.gpkg +0 -0
  41. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_character_id.gpkg +0 -0
  42. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_divergence_minor_only.gpkg +0 -0
  43. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_divergence_without_main.gpkg +0 -0
  44. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_divergence_without_minor.gpkg +0 -0
  45. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_divergence_zero_main.gpkg +0 -0
  46. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_downstream_swapped.gpkg +0 -0
  47. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_missing_divergence.gpkg +0 -0
  48. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_missing_divergence_off_split.gpkg +0 -0
  49. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_missing_tonode_first.gpkg +0 -0
  50. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_missing_tonode_target.gpkg +0 -0
  51. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_no_connections.gpkg +0 -0
  52. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_single_row.gpkg +0 -0
  53. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_worked_example.gpkg +0 -0
  54. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_worked_example_shuffled.gpkg +0 -0
  55. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_toids_zero_rows.gpkg +0 -0
  56. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_topo_sort_collation.gpkg +0 -0
  57. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_topo_sort_diversions.gpkg +0 -0
  58. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_topo_sort_worked_example.gpkg +0 -0
  59. hydroloom-0.1.0/inst/extdata/conformance/fixtures/add_topo_sort_worked_example_reversed.gpkg +0 -0
  60. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_conflict_toid.gpkg +0 -0
  61. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_duplicate_alias_swapped.gpkg +0 -0
  62. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_geometry_shape.gpkg +0 -0
  63. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_new_hope_totda.gpkg +0 -0
  64. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_permanent_identifier_alone.gpkg +0 -0
  65. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_permanent_identifier_beside_id.gpkg +0 -0
  66. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_permanent_identifier_elsewhere.gpkg +0 -0
  67. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_permanent_identifier_pair.gpkg +0 -0
  68. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_three_aliases.gpkg +0 -0
  69. hydroloom-0.1.0/inst/extdata/conformance/fixtures/align_names_totda.gpkg +0 -0
  70. hydroloom-0.1.0/inst/extdata/conformance/fixtures/all_terminals.gpkg +0 -0
  71. hydroloom-0.1.0/inst/extdata/conformance/fixtures/capabilities_leveled.gpkg +0 -0
  72. hydroloom-0.1.0/inst/extdata/conformance/fixtures/capabilities_node_aggregate.gpkg +0 -0
  73. hydroloom-0.1.0/inst/extdata/conformance/fixtures/capabilities_node_bare.gpkg +0 -0
  74. hydroloom-0.1.0/inst/extdata/conformance/fixtures/check_divergence_and_cycle.gpkg +0 -0
  75. hydroloom-0.1.0/inst/extdata/conformance/fixtures/check_reciprocal_chains.gpkg +0 -0
  76. hydroloom-0.1.0/inst/extdata/conformance/fixtures/coastal.gpkg +0 -0
  77. hydroloom-0.1.0/inst/extdata/conformance/fixtures/coastal_hydroseq_order.gpkg +0 -0
  78. hydroloom-0.1.0/inst/extdata/conformance/fixtures/coastal_inland.gpkg +0 -0
  79. hydroloom-0.1.0/inst/extdata/conformance/fixtures/dfs_rejoin.gpkg +0 -0
  80. hydroloom-0.1.0/inst/extdata/conformance/fixtures/dfs_tie.gpkg +0 -0
  81. hydroloom-0.1.0/inst/extdata/conformance/fixtures/dfs_tie_permuted.gpkg +0 -0
  82. hydroloom-0.1.0/inst/extdata/conformance/fixtures/dfs_two_outlets.gpkg +0 -0
  83. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_at_split.gpkg +0 -0
  84. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_attribute.gpkg +0 -0
  85. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_fan.gpkg +0 -0
  86. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_flagged_no_split.gpkg +0 -0
  87. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_fraction_all_flow.gpkg +0 -0
  88. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_fraction_near.gpkg +0 -0
  89. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_fraction_over.gpkg +0 -0
  90. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_fraction_short.gpkg +0 -0
  91. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_fraction_valid.gpkg +0 -0
  92. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_minor_absent.gpkg +0 -0
  93. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_miscoded.gpkg +0 -0
  94. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_na.gpkg +0 -0
  95. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_na_fromnode.gpkg +0 -0
  96. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_no_attribute.gpkg +0 -0
  97. hydroloom-0.1.0/inst/extdata/conformance/fixtures/divergence_valid.gpkg +0 -0
  98. hydroloom-0.1.0/inst/extdata/conformance/fixtures/duplicated_edge.gpkg +0 -0
  99. hydroloom-0.1.0/inst/extdata/conformance/fixtures/empty_name.gpkg +0 -0
  100. hydroloom-0.1.0/inst/extdata/conformance/fixtures/empty_network.gpkg +0 -0
  101. hydroloom-0.1.0/inst/extdata/conformance/fixtures/flownetwork_cycle.gpkg +0 -0
  102. hydroloom-0.1.0/inst/extdata/conformance/fixtures/huc12_implicit_outlets.gpkg +0 -0
  103. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_add_topo_isolated_first.gpkg +0 -0
  104. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_comid_nodes_single.gpkg +0 -0
  105. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_duplicate_alias_tie.gpkg +0 -0
  106. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_duplicated_id.gpkg +0 -0
  107. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_flag_missing.gpkg +0 -0
  108. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_flag_value_not_binary.gpkg +0 -0
  109. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_flownetwork_downmain_conflict.gpkg +0 -0
  110. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_flownetwork_upmain_conflict.gpkg +0 -0
  111. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_id_integer_toid_character.gpkg +0 -0
  112. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_id_missing.gpkg +0 -0
  113. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_id_missing_two.gpkg +0 -0
  114. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_identifier_not_finite.gpkg +0 -0
  115. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_identifier_not_whole.gpkg +0 -0
  116. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_large_ids.gpkg +0 -0
  117. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_large_nodes.gpkg +0 -0
  118. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_leveled.gpkg +0 -0
  119. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_mixed_case_names.gpkg +0 -0
  120. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_name_conflict.gpkg +0 -0
  121. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_network_type_node_repeated_id.gpkg +0 -0
  122. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_network_type_not_hy.gpkg +0 -0
  123. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_permanent_identifier_tie.gpkg +0 -0
  124. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_reverse_divergence.gpkg +0 -0
  125. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_reverse_renamed.gpkg +0 -0
  126. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_reverse_renamed_shuffled.gpkg +0 -0
  127. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_reverse_zero_rows.gpkg +0 -0
  128. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_toid_and_nodes.gpkg +0 -0
  129. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_toid_missing_character.gpkg +0 -0
  130. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_toid_missing_integer.gpkg +0 -0
  131. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_toid_missing_with_nodes.gpkg +0 -0
  132. hydroloom-0.1.0/inst/extdata/conformance/fixtures/hy_worked_example.gpkg +0 -0
  133. hydroloom-0.1.0/inst/extdata/conformance/fixtures/index.yaml +2460 -0
  134. hydroloom-0.1.0/inst/extdata/conformance/fixtures/is_dendritic_chain.gpkg +0 -0
  135. hydroloom-0.1.0/inst/extdata/conformance/fixtures/is_dendritic_chain_divergence.gpkg +0 -0
  136. hydroloom-0.1.0/inst/extdata/conformance/fixtures/is_dendritic_repeated_id.gpkg +0 -0
  137. hydroloom-0.1.0/inst/extdata/conformance/fixtures/is_hy_hy_names_na_toid.gpkg +0 -0
  138. hydroloom-0.1.0/inst/extdata/conformance/fixtures/is_hy_source_names.gpkg +0 -0
  139. hydroloom-0.1.0/inst/extdata/conformance/fixtures/isolated_flowline.gpkg +0 -0
  140. hydroloom-0.1.0/inst/extdata/conformance/fixtures/loop.gpkg +0 -0
  141. hydroloom-0.1.0/inst/extdata/conformance/fixtures/loop2.gpkg +0 -0
  142. hydroloom-0.1.0/inst/extdata/conformance/fixtures/loop2_repaired.gpkg +0 -0
  143. hydroloom-0.1.0/inst/extdata/conformance/fixtures/loop_check_recombine.gpkg +0 -0
  144. hydroloom-0.1.0/inst/extdata/conformance/fixtures/loop_check_three_cycle.gpkg +0 -0
  145. hydroloom-0.1.0/inst/extdata/conformance/fixtures/loop_outlets.gpkg +0 -0
  146. hydroloom-0.1.0/inst/extdata/conformance/fixtures/make_fixtures.R +1442 -0
  147. hydroloom-0.1.0/inst/extdata/conformance/fixtures/make_index_ids_conflicting_downmain.gpkg +0 -0
  148. hydroloom-0.1.0/inst/extdata/conformance/fixtures/make_index_ids_divergence_order.gpkg +0 -0
  149. hydroloom-0.1.0/inst/extdata/conformance/fixtures/make_index_ids_flownetwork_cycle.gpkg +0 -0
  150. hydroloom-0.1.0/inst/extdata/conformance/fixtures/make_index_ids_return_divergence_main.gpkg +0 -0
  151. hydroloom-0.1.0/inst/extdata/conformance/fixtures/make_index_ids_type_mismatch.gpkg +0 -0
  152. hydroloom-0.1.0/inst/extdata/conformance/fixtures/make_index_ids_worked_example.gpkg +0 -0
  153. hydroloom-0.1.0/inst/extdata/conformance/fixtures/make_index_ids_worked_example_permuted.gpkg +0 -0
  154. hydroloom-0.1.0/inst/extdata/conformance/fixtures/missing_weight.gpkg +0 -0
  155. hydroloom-0.1.0/inst/extdata/conformance/fixtures/network.gpkg +0 -0
  156. hydroloom-0.1.0/inst/extdata/conformance/fixtures/network_shuffled.gpkg +0 -0
  157. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope.gpkg +0 -0
  158. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope_3dhp.gpkg +0 -0
  159. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope_character_id.gpkg +0 -0
  160. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope_flownetwork.gpkg +0 -0
  161. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope_no_divergence.gpkg +0 -0
  162. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope_shuffled.gpkg +0 -0
  163. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope_state_plane.gpkg +0 -0
  164. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope_toids_not_dendritic.gpkg +0 -0
  165. hydroloom-0.1.0/inst/extdata/conformance/fixtures/new_hope_ut_8894172.gpkg +0 -0
  166. hydroloom-0.1.0/inst/extdata/conformance/fixtures/nhdplushr.gpkg +0 -0
  167. hydroloom-0.1.0/inst/extdata/conformance/fixtures/outlet_character_empty.gpkg +0 -0
  168. hydroloom-0.1.0/inst/extdata/conformance/fixtures/outlet_foreign.gpkg +0 -0
  169. hydroloom-0.1.0/inst/extdata/conformance/fixtures/outlet_implicit.gpkg +0 -0
  170. hydroloom-0.1.0/inst/extdata/conformance/fixtures/outlet_na.gpkg +0 -0
  171. hydroloom-0.1.0/inst/extdata/conformance/fixtures/outlet_numeric_zero.gpkg +0 -0
  172. hydroloom-0.1.0/inst/extdata/conformance/fixtures/outlet_unique_ids.gpkg +0 -0
  173. hydroloom-0.1.0/inst/extdata/conformance/fixtures/point_index_tie.gpkg +0 -0
  174. hydroloom-0.1.0/inst/extdata/conformance/fixtures/point_index_tie_points.gpkg +0 -0
  175. hydroloom-0.1.0/inst/extdata/conformance/fixtures/reciprocal_pair.gpkg +0 -0
  176. hydroloom-0.1.0/inst/extdata/conformance/fixtures/return_divergence.gpkg +0 -0
  177. hydroloom-0.1.0/inst/extdata/conformance/fixtures/self_loop.gpkg +0 -0
  178. hydroloom-0.1.0/inst/extdata/conformance/fixtures/single_flowline.gpkg +0 -0
  179. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_braids_nested_outlet.gpkg +0 -0
  180. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_branch_leaves_outer_basin.gpkg +0 -0
  181. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_branching.gpkg +0 -0
  182. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_bypass_nested_outlet.gpkg +0 -0
  183. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_chain.gpkg +0 -0
  184. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_divergence_leaves.gpkg +0 -0
  185. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_divergence_leaves_permuted.gpkg +0 -0
  186. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_divergence_leaves_relabelled.gpkg +0 -0
  187. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_divergence_outlets.gpkg +0 -0
  188. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_flownetwork_cycle.gpkg +0 -0
  189. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_flownetwork_divergence.gpkg +0 -0
  190. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_joined_chains.gpkg +0 -0
  191. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_mixed_types.gpkg +0 -0
  192. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_network_dups.gpkg +0 -0
  193. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_network_dups_distinct.gpkg +0 -0
  194. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_no_outlet.gpkg +0 -0
  195. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_outlets_divergence_branch.gpkg +0 -0
  196. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_siblings.gpkg +0 -0
  197. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_siblings_permuted.gpkg +0 -0
  198. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_siblings_text.gpkg +0 -0
  199. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_test.gpkg +0 -0
  200. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_test_hy_names.gpkg +0 -0
  201. hydroloom-0.1.0/inst/extdata/conformance/fixtures/sort_two_networks.gpkg +0 -0
  202. hydroloom-0.1.0/inst/extdata/conformance/fixtures/three_cycle.gpkg +0 -0
  203. hydroloom-0.1.0/inst/extdata/conformance/fixtures/two_cycles_byte_order.gpkg +0 -0
  204. hydroloom-0.1.0/inst/extdata/conformance/fixtures/two_cycles_byte_order_shuffled.gpkg +0 -0
  205. hydroloom-0.1.0/inst/extdata/conformance/fixtures/zero_length.gpkg +0 -0
  206. hydroloom-0.1.0/inst/extdata/conformance/fixtures/zero_length_points.gpkg +0 -0
  207. hydroloom-0.1.0/inst/extdata/conformance/manifest.schema.json +185 -0
  208. hydroloom-0.1.0/inst/extdata/conformance/manifest.yaml +5599 -0
  209. hydroloom-0.1.0/inst/extdata/conformance/parity.md +26 -0
  210. hydroloom-0.1.0/inst/extdata/docstrings.json +1916 -0
  211. hydroloom-0.1.0/inst/extdata/hy_vocab.json +648 -0
  212. hydroloom-0.1.0/inst/extdata/hy_vocab.schema.json +102 -0
  213. hydroloom-0.1.0/inst/extdata/new_hope.gpkg +0 -0
  214. hydroloom-0.1.0/inst/extdata/new_hope_mainstems.R +25 -0
  215. hydroloom-0.1.0/inst/extdata/new_hope_mainstems.csv +680 -0
  216. hydroloom-0.1.0/inst/extdata/remedies.json +811 -0
  217. hydroloom-0.1.0/inst/extdata/remedies.schema.json +101 -0
  218. hydroloom-0.1.0/inst/extdata/walker.gpkg +0 -0
  219. hydroloom-0.1.0/inst/extdata/walker_cats.gpkg +0 -0
  220. hydroloom-0.1.0/pyproject.toml +295 -0
  221. hydroloom-0.1.0/src/hydroloom/__init__.py +41 -0
  222. hydroloom-0.1.0/src/hydroloom/_docstrings.py +310 -0
  223. hydroloom-0.1.0/src/hydroloom/_hy.py +930 -0
  224. hydroloom-0.1.0/src/hydroloom/_kernels/__init__.py +1 -0
  225. hydroloom-0.1.0/src/hydroloom/_kernels/csr.py +121 -0
  226. hydroloom-0.1.0/src/hydroloom/_kernels/sequential.py +119 -0
  227. hydroloom-0.1.0/src/hydroloom/_kernels/walk.py +156 -0
  228. hydroloom-0.1.0/src/hydroloom/errors.py +109 -0
  229. hydroloom-0.1.0/src/hydroloom/index_ids.py +145 -0
  230. hydroloom-0.1.0/src/hydroloom/network.py +549 -0
  231. hydroloom-0.1.0/src/hydroloom/py.typed +0 -0
  232. hydroloom-0.1.0/tests/python/conformance.py +711 -0
  233. hydroloom-0.1.0/tests/python/test_add_toids.py +281 -0
  234. hydroloom-0.1.0/tests/python/test_api.py +65 -0
  235. hydroloom-0.1.0/tests/python/test_capabilities.py +318 -0
  236. hydroloom-0.1.0/tests/python/test_conformance.py +19 -0
  237. hydroloom-0.1.0/tests/python/test_csr.py +343 -0
  238. hydroloom-0.1.0/tests/python/test_docstrings.py +506 -0
  239. hydroloom-0.1.0/tests/python/test_errors.py +118 -0
  240. hydroloom-0.1.0/tests/python/test_harness.py +517 -0
  241. hydroloom-0.1.0/tests/python/test_hy.py +694 -0
  242. hydroloom-0.1.0/tests/python/test_index_ids.py +217 -0
  243. hydroloom-0.1.0/tests/python/test_is_dendritic.py +165 -0
  244. hydroloom-0.1.0/tests/python/test_naming.py +366 -0
  245. hydroloom-0.1.0/tests/python/test_navigate_network_dfs.py +387 -0
  246. hydroloom-0.1.0/tests/python/test_permutation_invariance.py +368 -0
  247. hydroloom-0.1.0/tests/python/test_register_names.py +303 -0
  248. hydroloom-0.1.0/tests/python/test_sort_network.py +471 -0
@@ -0,0 +1,28 @@
1
+ .Rproj.user
2
+ .Rhistory
3
+ .RData
4
+ .Ruserdata
5
+ .Renviron
6
+ cran-comments.md
7
+ CRAN-SUBMISSION
8
+ *temp*
9
+ !.github/PULL_REQUEST_TEMPLATE.md
10
+ .vscode/
11
+ revdep/
12
+ dev/*
13
+ !dev/plan/
14
+ !dev/milestones/
15
+ !dev/done_check.R
16
+ !dev/FIXTURE_ARCHITECTURE.md
17
+ vignettes/*.html
18
+ docs/
19
+ .kiro/workflow-output/
20
+ .kiro/settings/lsp.json
21
+ !.kiro/context/pr-body-template.md
22
+ !.kiro/context/kickoff-template.md
23
+ !inst/extdata/conformance/algorithms/TEMPLATE.md
24
+ .pixi/
25
+ __pycache__/
26
+ *.egg-info/
27
+ dist/
28
+ src/hydroloom/data/
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ <!-- towncrier release notes start -->
4
+
5
+ ## 0.1.0 (2026-11-05)
6
+
7
+ ### Added
8
+
9
+ - The package version comes from the `py-v*` release tag, and `hydroloom.__version__` reports it.
10
+ - `add_toids` builds `toid`, each flowline's downstream flowline, from `fromnode` and `tonode`, the identifiers of the points at each end of every flowline. By default it keeps only the main path where a flowline splits, which needs a `divergence` column (1 main path, 2 minor path), and raises `HydroloomError` when `divergence` is missing or a split has no main path or more than one. A flowline that reaches no other gets the empty string that marks an outlet. `return_dendritic=False` keeps every downstream connection and issues a `FutureWarning`, since `to_flownetwork` is to replace it. A network that already has `toid`, or lacks `fromnode`/`tonode`, raises `RepresentationError`.
11
+ - `align_names` renames the columns hydroloom knows by another name to its standard names and changes nothing else: identifiers keep their type and a missing `toid` stays missing. `hy_reverse` renames standard names back to those of one source, given as `source="nhdplus"`, `"nhdplushr"`, `"3dhp"`, or `"hydrofabric"`, in lowercase, so `id` becomes `comid`. With `source=None`, the default, `hy_reverse` gives each standard name the alias most recently registered for it with `register_names`, and leaves a name with no registered alias unchanged. `is_hy` reports whether a table is in the form `as_hy` returns: standard names, an `id` column with no missing values, and identifier columns as text. `name_definitions` returns a table of every standard name and its definition.
12
+ - `as_hy` renames the columns hydroloom knows by another name to its standard names (`COMID` becomes `id`, `ToCOMID` becomes `toid`), turns identifiers into text, and gives a missing `toid` the empty string that marks an outlet (a flowline that flows to nothing else in the table). `representation` reports which representation a table follows (the pattern of its columns), such as an id/toid list or a fromnode/tonode list; it reads the column names and the `id` values only. `make_index_ids` returns an `IndexIds` that gives each flowline's downstream or upstream flowlines as integer positions, for walking the network, and `mode="both"` returns the two as a pair. All three raise `RepresentationError` when no column becomes `id` and `HydroloomError` when an `id` value is missing.
13
+ - `capabilities` reports which hydroloom functions accept a network as it stands, in a table sorted by function name, with one row per hydroloom function that takes a table and with the columns `function`, `available`, and `via`. `available` is `True` where the network follows the representation the function needs (the pattern of columns `representation` reports) and holds the fixed columns the function requires; it tests the shape of the table, not its values, so a function marked available can still raise on the data. `via` gives the one conversion that makes an unavailable function available, such as `add_toids`, which builds `toid` for a node table (one that gives the nodes at the two ends of each flowline in `fromnode` and `tonode`). It is `""` where the function is available or no single conversion reaches it. A table with no `id` column, or an object that is not a table, has no representation, so only the functions that take any table are available. R's `hy_capabilities` takes `include_conversions` to mark the functions `via` reaches as available; `capabilities` has no such argument, since `via` gives the same answer.
14
+ - `hydroloom.errors` holds the exception and warning classes hydroloom raises. `HydroloomError` subclasses `ValueError`. It is raised for a problem in the input table that the caller can fix. `RepresentationError` subclasses `HydroloomError`. It is raised when a table lacks the representation (the pattern of its columns, such as an id/toid list) or the columns a function needs. Two cases raise built-in exceptions that `except HydroloomError` does not catch. A vocabulary problem, a column name that hydroloom's list of names cannot resolve, raises `KeyError`. An identifier column that mixes text and numbers raises `TypeError`. Warnings other than deprecations are `HydroloomWarning`, and each one points at the line in the caller's code that made the call.
15
+ - `is_dendritic` returns `False` when the table records a divergence and `True` otherwise. It reads two things the table records: a `divergence` value of 2, which marks the minor path leaving a divergence in NHDPlus coding, and, unless `validate_data=False`, an `id` that repeats beside a `toid` column, which is how a flowline with two downstream connections is listed. Column names are aligned to hydroloom names first, so an NHDPlus table with `COMID`, `ToCOMID`, and `Divergence` gives the same answer as one already renamed with `as_hy`. A table `as_hy` cannot read raises what `as_hy` raises, including `HydroloomError` on an (`id`, `toid`) pair listed twice. A node table whose divergences show only as a shared `fromnode`, with no `divergence` column, returns `True`.
16
+ - `navigate_network_dfs` walks a network depth first from each flowline in `starts` and returns, for each unique start in the order given, the flowlines it reaches as a list of paths, each a pandas `Index` of identifiers in visit order. `direction` is `"down"` (along `toid`), `"up"` (against it), or `"downmain"` or `"upmain"`, which follow only the main connections that `downmain` or `upmain` mark. Where the walk can go on to more than one flowline it takes the smallest identifier in byte order of the identifiers as text first, so `"10"` comes before `"9"` and any row order of the input gives the same result. A path ends at an outlet going down or a headwater going up (a flowline with no flowline below it or above it), or where the walk turns back to a flowline it has already visited. With `reset=False`, the default, a flowline returned for one start is left out of the results for later starts; `reset=True` walks each start on its own. `network` may be a network table or the `IndexIds` that `make_index_ids` returns, built with `mode="to"` for the downstream directions and `mode="from"` for the upstream ones. A node table, which gives the nodes at the two ends of each flowline in `fromnode` and `tonode`, is converted with `add_toids` first for `"down"` and `"up"`; for `"downmain"` and `"upmain"` it raises `RepresentationError`.
17
+ - `register_names` registers input column names as aliases of standard names for the rest of the session, so `align_names`, `as_hy`, and `hy_reverse` recognize them: `register_names({"FlowlineID": "id"})` makes a `FlowlineID` column `id`. Aliases are stored in lowercase, so `hy_reverse` gives back `flowlineid`. `replace=True` drops earlier registrations and keeps the aliases hydroloom ships. Used as `with register_names(mapping):`, the registration is undone when the block exits. A value that is not a standard name, or an alias that is a standard name other than its value, raises `KeyError` and registers nothing.
18
+ - `sort_network` returns the rows of a network ordered upstream to downstream, so every flowline comes after every flowline that drains to it. Outlets, and flowlines that drain to the same flowline, are taken in byte order of their identifiers as text, so `"10"` comes before `"9"` and any row order of the input gives the same output. `split=True` adds `terminal_id`, the `id` of the outlet each flowline drains to, and `outlets` limits the result to the networks above the flowlines given in `outlets`. `add_topo_sort` sorts the same way and adds `topo_sort`, numbered from the number of flowlines down to 1 at the last outlet; it replaces an input `topo_sort` column, such as NHDPlus `Hydroseq`, under the input's name. Both raise `HydroloomError` when the network holds a cycle, a set of flowlines that drain back into themselves, or when a value in `outlets` is not an `id`. `sort_network` also raises it when `split=True` and one flowline in `outlets` lies upstream of another. A node table, where each flowline names the nodes at its upstream and downstream ends in `fromnode` and `tonode` and carries `divergence`, is converted with `add_toids` first; a table with neither `toid` nor node columns raises `RepresentationError`.
@@ -0,0 +1,116 @@
1
+ CC0 1.0 Universal
2
+
3
+ Statement of Purpose
4
+
5
+ The laws of most jurisdictions throughout the world automatically confer
6
+ exclusive Copyright and Related Rights (defined below) upon the creator and
7
+ subsequent owner(s) (each and all, an "owner") of an original work of
8
+ authorship and/or a database (each, a "Work").
9
+
10
+ Certain owners wish to permanently relinquish those rights to a Work for the
11
+ purpose of contributing to a commons of creative, cultural and scientific
12
+ works ("Commons") that the public can reliably and without fear of later
13
+ claims of infringement build upon, modify, incorporate in other works, reuse
14
+ and redistribute as freely as possible in any form whatsoever and for any
15
+ purposes, including without limitation commercial purposes. These owners may
16
+ contribute to the Commons to promote the ideal of a free culture and the
17
+ further production of creative, cultural and scientific works, or to gain
18
+ reputation or greater distribution for their Work in part through the use and
19
+ efforts of others.
20
+
21
+ For these and/or other purposes and motivations, and without any expectation
22
+ of additional consideration or compensation, the person associating CC0 with a
23
+ Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
24
+ and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
25
+ and publicly distribute the Work under its terms, with knowledge of his or her
26
+ Copyright and Related Rights in the Work and the meaning and intended legal
27
+ effect of CC0 on those rights.
28
+
29
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
30
+ protected by copyright and related or neighboring rights ("Copyright and
31
+ Related Rights"). Copyright and Related Rights include, but are not limited
32
+ to, the following:
33
+
34
+ i. the right to reproduce, adapt, distribute, perform, display, communicate,
35
+ and translate a Work;
36
+
37
+ ii. moral rights retained by the original author(s) and/or performer(s);
38
+
39
+ iii. publicity and privacy rights pertaining to a person's image or likeness
40
+ depicted in a Work;
41
+
42
+ iv. rights protecting against unfair competition in regards to a Work,
43
+ subject to the limitations in paragraph 4(a), below;
44
+
45
+ v. rights protecting the extraction, dissemination, use and reuse of data in
46
+ a Work;
47
+
48
+ vi. database rights (such as those arising under Directive 96/9/EC of the
49
+ European Parliament and of the Council of 11 March 1996 on the legal
50
+ protection of databases, and under any national implementation thereof,
51
+ including any amended or successor version of such directive); and
52
+
53
+ vii. other similar, equivalent or corresponding rights throughout the world
54
+ based on applicable law or treaty, and any national implementations thereof.
55
+
56
+ 2. Waiver. To the greatest extent permitted by, but not in contravention of,
57
+ applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
58
+ unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
59
+ and Related Rights and associated claims and causes of action, whether now
60
+ known or unknown (including existing as well as future claims and causes of
61
+ action), in the Work (i) in all territories worldwide, (ii) for the maximum
62
+ duration provided by applicable law or treaty (including future time
63
+ extensions), (iii) in any current or future medium and for any number of
64
+ copies, and (iv) for any purpose whatsoever, including without limitation
65
+ commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
66
+ the Waiver for the benefit of each member of the public at large and to the
67
+ detriment of Affirmer's heirs and successors, fully intending that such Waiver
68
+ shall not be subject to revocation, rescission, cancellation, termination, or
69
+ any other legal or equitable action to disrupt the quiet enjoyment of the Work
70
+ by the public as contemplated by Affirmer's express Statement of Purpose.
71
+
72
+ 3. Public License Fallback. Should any part of the Waiver for any reason be
73
+ judged legally invalid or ineffective under applicable law, then the Waiver
74
+ shall be preserved to the maximum extent permitted taking into account
75
+ Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
76
+ is so judged Affirmer hereby grants to each affected person a royalty-free,
77
+ non transferable, non sublicensable, non exclusive, irrevocable and
78
+ unconditional license to exercise Affirmer's Copyright and Related Rights in
79
+ the Work (i) in all territories worldwide, (ii) for the maximum duration
80
+ provided by applicable law or treaty (including future time extensions), (iii)
81
+ in any current or future medium and for any number of copies, and (iv) for any
82
+ purpose whatsoever, including without limitation commercial, advertising or
83
+ promotional purposes (the "License"). The License shall be deemed effective as
84
+ of the date CC0 was applied by Affirmer to the Work. Should any part of the
85
+ License for any reason be judged legally invalid or ineffective under
86
+ applicable law, such partial invalidity or ineffectiveness shall not
87
+ invalidate the remainder of the License, and in such case Affirmer hereby
88
+ affirms that he or she will not (i) exercise any of his or her remaining
89
+ Copyright and Related Rights in the Work or (ii) assert any associated claims
90
+ and causes of action with respect to the Work, in either case contrary to
91
+ Affirmer's express Statement of Purpose.
92
+
93
+ 4. Limitations and Disclaimers.
94
+
95
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
96
+ surrendered, licensed or otherwise affected by this document.
97
+
98
+ b. Affirmer offers the Work as-is and makes no representations or warranties
99
+ of any kind concerning the Work, express, implied, statutory or otherwise,
100
+ including without limitation warranties of title, merchantability, fitness
101
+ for a particular purpose, non infringement, or the absence of latent or
102
+ other defects, accuracy, or the present or absence of errors, whether or not
103
+ discoverable, all to the greatest extent permissible under applicable law.
104
+
105
+ c. Affirmer disclaims responsibility for clearing rights of other persons
106
+ that may apply to the Work or any use thereof, including without limitation
107
+ any person's Copyright and Related Rights in the Work. Further, Affirmer
108
+ disclaims responsibility for obtaining any necessary consents, permissions
109
+ or other rights required for any use of the Work.
110
+
111
+ d. Affirmer understands and acknowledges that Creative Commons is not a
112
+ party to this document and has no duty or obligation with respect to this
113
+ CC0 or use of the Work.
114
+
115
+ For more information, please see
116
+ <http://creativecommons.org/publicdomain/zero/1.0/>
@@ -0,0 +1,246 @@
1
+ Metadata-Version: 2.5
2
+ Name: hydroloom
3
+ Version: 0.1.0
4
+ Summary: Utilities to weave hydrologic fabrics.
5
+ Project-URL: Homepage, https://github.com/DOI-USGS/hydroloom
6
+ Project-URL: Issues, https://github.com/DOI-USGS/hydroloom/issues
7
+ Author-email: David Blodgett <dblodgett@usgs.gov>
8
+ License-Expression: CC0-1.0
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.10
11
+ Requires-Dist: geopandas>=1.0
12
+ Requires-Dist: numpy
13
+ Requires-Dist: pandas>=2.2.2
14
+ Requires-Dist: pyogrio
15
+ Requires-Dist: scipy
16
+ Requires-Dist: shapely>=2.0
17
+ Description-Content-Type: text/markdown
18
+
19
+
20
+ <!-- README.md is generated from README.Rmd. Please edit that file -->
21
+
22
+ # hydroloom <img src="man/figures/logo.png" align="right" alt="" width="120" />
23
+
24
+ [![R-CMD-check](https://github.com/DOI-USGS/hydroloom/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/DOI-USGS/hydroloom/actions/workflows/R-CMD-check.yaml)
25
+ [![codecov](https://codecov.io/gh/doi-usgs/hydroloom/branch/main/graph/badge.svg)](https://app.codecov.io/gh/doi-usgs/hydroloom)
26
+ [![CRAN](https://www.r-pkg.org/badges/version/hydroloom)](https://cran.r-project.org/package=hydroloom)
27
+
28
+ ## hydroloom:
29
+
30
+ **Install:** `install.packages("hydroloom")`
31
+
32
+ Or for latest development:
33
+ `remotes::install_github("doi-usgs/hydroloom")`
34
+
35
+ `hydroloom` is a collection of functions to work with hydrologic
36
+ geospatial fabrics. Hydroloom is designed to provide general hydrologic
37
+ network functionality for any hydrographic or hydrologic data. The
38
+ package is intended for developers of workflows and other packages that
39
+ require low level network and network data manipulation utilities.
40
+
41
+ **To Learn More, visit the pkgdown site**:
42
+ <https://doi-usgs.github.io/hydroloom/articles/hydroloom.html>
43
+
44
+ ## Citation:
45
+
46
+ Blodgett, D., 2026, hydroloom: Utilities to Weave Hydrologic Fabrics v1.2,
47
+ https://doi.org/10.5066/P16RS3UZ
48
+
49
+ Hydroloom has support for attributes that can be seen in:
50
+
51
+ ``` r
52
+ hydroloom::hydroloom_name_definitions
53
+ ```
54
+
55
+ <details>
56
+
57
+ <summary>
58
+
59
+ Click to See Definitions
60
+ </summary>
61
+
62
+ | Name | Definition |
63
+ |:---|:---|
64
+ | id | shared network identifier for catchment divide and flowpath or flowline |
65
+ | toid | indicates to the downstream id. May or may not be dendritic |
66
+ | fromnode | indicates the node representing the nexus upstream of a catchment |
67
+ | tonode | indicates the node representing the nexus downstream of a catchment |
68
+ | divergence | indicates whether a catchment is not downstream of a divergence (0), the primary path downstream of a divergence (1), or a diversion downstream of a divergence (2). |
69
+ | divergence_fraction | Indicates the fraction of flow to be apportioned to a given diverted path. Should sum to 1 when considering all diverted flowlines downstream of a diversion. |
70
+ | wbid | waterbody id |
71
+ | total_da_sqkm | total drainage area at the outlet of a catchment |
72
+ | da_sqkm | local drainage area of a catchment |
73
+ | length_km | length of a single catchment’s flowpath |
74
+ | pathlength_km | distance from the outlet of a catchment to the terminal outlet of a network |
75
+ | arbolate_sum | total accumulated length of all upstream flowlines |
76
+ | topo_sort | Similar to hydrosequence in NHDPlus. Large topo_sort values are upstream of small topo_sort values. Note that there are many valid topological sort orders of a directed graph. |
77
+ | up_topo_sort | topo sort value of the upstream mainstem |
78
+ | dn_topo_sort | topo sort value of the downstream mainstem |
79
+ | dn_minor_topo_sort | topo sort value of the downstream minor network element with the smallest id |
80
+ | terminal_topo_sort | topo sort value of the outlet network element |
81
+ | terminal_flag | 1 for network terminous 0 for within network |
82
+ | terminal_id | id of terminal catchment for entire drainage basin |
83
+ | start_flag | 1 for a headwater, 0 otherwise |
84
+ | levelpath | provides an identifier for the collection of flowlines that make up a single mainstem flowpath of a drainage basin |
85
+ | up_levelpath | levelpath value of the upstream mainstem |
86
+ | dn_levelpath | levelpath value of the downstream mainstem |
87
+ | levelpath_outlet_id | id of outlet catchment of a levelpath |
88
+ | stream_level | starting at 1 for coastal terminals and 4 for inland terminals increments by 1 for each smaller tributary level |
89
+ | dn_stream_level | stream level of downstream mainstem network element |
90
+ | stream_order | starting at 1 for headwaters increments by 1 for each larger tributary level, diversions adopt stream order from upstream but returning diverted network does not increment stream order |
91
+ | stream_calculator | starting at 1 for headwaters and 0 along diverted paths increments by 1 for each larger tributary level, does no increment along diverted paths. Is equal to stream_order along the dendritic network |
92
+ | feature_type | descriptive feature type moniker |
93
+ | feature_type_code | compact feature type identifier |
94
+ | vector_proc_unit | identifier for processing units based on vector encapsulation |
95
+ | raster_proc_unit | identifier for processing units based on raster encapsulation |
96
+ | id_measure | interpolative linear reference measure along a single identified feature |
97
+ | aggregate_id | aggregate identifier useful for ‘reach’ or ‘flowpath’ aggregation of flowlines |
98
+ | aggregate_id_measure | interpolative linear reference measure along an aggregate feature |
99
+ | aggregate_id_from_measure | interpolative linear reference for downstream end of a single feature that makes up an aggregate feature |
100
+ | aggregate_id_to_measure | interpolative linear reference for the upstream end of a single feature that makes up an aggregate feature |
101
+ | point_id | identifier of hydrologic location point |
102
+ | offset | offset distance from point to line in units of linear reference analysis units |
103
+ | upmain | indicates that a given network element is the primary upstream connection at a confluence |
104
+ | downmain | indicates that a given network element is the primary downstream connection at a confluence |
105
+
106
+ </details>
107
+
108
+ <br/>
109
+
110
+ `hydroloom` supports your attribute names that map to the in-built
111
+ definitions. See
112
+ [`hydroloom_names()`](https://doi-usgs.github.io/hydroloom/reference/hydroloom_names.html)
113
+ for more.
114
+
115
+ `hydroloom` supports both dendritic and non-dendritic networks start at
116
+ [this
117
+ vignette](https://doi-usgs.github.io/hydroloom/articles/non-dendritic.html)
118
+ for more.
119
+
120
+ `hydroloom` was largely created from components of
121
+ [nhdplusTools](https://doi.org/10.5066/P97AS8JD), which is now published
122
+ as [hydrogeofetch](https://doi-usgs.github.io/hydrogeofetch/):
123
+
124
+ Blodgett, D., Johnson, J.M., 2022, nhdplusTools: Tools for
125
+ Accessing and Working with the NHDPlus,
126
+ https://doi.org/10.5066/P97AS8JD
127
+
128
+ `hydrogeofetch` supports web service access and the particulars of the
129
+ NHDPlus data model. In contrast, `hydroloom` is intended to be more
130
+ general and focused specifically on hydro fabric data functionality.
131
+
132
+ `hydroloom` implements algorithms documented in:
133
+
134
+ NHDPlus Attributes:
135
+
136
+ Moore, R.B., McKay, L.D., Rea, A.H., Bondelid, T.R., Price, C.V., Dewald, T.G.,
137
+ and Johnston, C.M., 2019, User's guide for the national hydrography dataset
138
+ plus (NHDPlus) high resolution: U.S. Geological Survey Open-File Report 2019–1096,
139
+ 66 p., https://doi.org/10.3133/ofr20191096.
140
+
141
+ Graph Concepts:
142
+
143
+ Cormen, T. H., & Leiserson, C. E. (2022). Introduction to
144
+ Algorithms, fourth edition. MIT Press.
145
+
146
+ Pfafstetter Attributes:
147
+
148
+ Verdin, K. L., & Verdin, J. P. (1999). A topological system for
149
+ delineation and codification of the Earth's river basins.
150
+ Journal of Hydrology, 218(1–2), 1–12.
151
+ https://doi.org/10.1016/S0022-1694(99)00011-6
152
+
153
+ ### Terminology:
154
+
155
+ The following definitions have been used as much as possible throughout
156
+ the package. Terms for rivers: **Flowline:** A flowline is an linear
157
+ geometry that represents a segment of a flowing body of water. Some
158
+ flowlines have no local drainage area and are never aggregate features.
159
+ **Flowpath:** A flowpath is a linear geometry that represents the
160
+ connection between a catchment’s inlet and its outlet. All flowpaths
161
+ have a local drainage area and may be aggregates of flowlines.
162
+ **Catchment:** A physiographic unit with zero or one inlets and one
163
+ outlet. A catchment is represented by one or more partial realizations;
164
+ flowpath, divide, and networks of flowpaths and divides. **Catchment
165
+ Divide:** The polygon boundary that encompasses a catchment.
166
+ **Divergence:** The hydrologic nexus (node) where flow diverges. A
167
+ divergence is an abstract location in a hydrologic network.
168
+ **Diversion:** A flowline that is below a divergence and is not the
169
+ primary downstream path. A diversion is a specific feature downstream of
170
+ a divergence.
171
+
172
+ ### Design Notes:
173
+
174
+ - Hydroloom uses tibble because dplyr verbs for data.frame was dropping
175
+ the custom hy attributes.
176
+ - The `data.table` package is used for some key joins to enhance
177
+ scalability but dplyr is preferred for clarity.
178
+ - `hy` class tibble standardizes all attribute names in code.
179
+ - graph representation facilitated by `make_index_ids()`
180
+ - names are plural when referring to identifiers and singular when
181
+ referring to a numerical attribute.
182
+
183
+ ### Build and release:
184
+
185
+ Development happens on GitHub (DOI-USGS/hydroloom). Official builds and
186
+ release candidates are produced on code.usgs.gov
187
+ (code.usgs.gov/water/hydroloom) using GitLab CI.
188
+
189
+ Vignettes use the `BUILD_VIGNETTES` environment variable to control code
190
+ evaluation. Set `BUILD_VIGNETTES=TRUE` in a local `.Renviron` to build
191
+ them with live code; without it every chunk renders as prose and code
192
+ with no evaluated output. Only `vignettes/hydroloom.Rmd` ships to CRAN.
193
+ Everything under `vignettes/articles/` is website-only — excluded from
194
+ the source tarball by `.Rbuildignore` and built by pkgdown. A vignette
195
+ that needs a web service or a large download belongs in
196
+ `vignettes/articles/`.
197
+
198
+ Local development does not require building the source package. Use
199
+ `devtools::test()`, `devtools::check()`, and `devtools::document()`
200
+ directly.
201
+
202
+ Release candidates are built on code.usgs.gov. Push a branch named
203
+ `rc/<version>` (e.g. `rc/1.2.1`) to trigger the GitLab CI pipeline,
204
+ which runs three stages:
205
+
206
+ 1. **check** — lightweight structural check with no tests, examples, or
207
+ vignettes. Gates the rest of the pipeline.
208
+ 2. **build** — `R CMD build .` to produce the source tarball, which is
209
+ uploaded to the GitLab generic package registry.
210
+ 3. **verify** — `R CMD check --as-cran` on the built tarball.
211
+
212
+ Once the pipeline passes, download the tarball from the package registry
213
+ and submit it to CRAN. The tarball that CRAN receives is the exact
214
+ artifact that passed `--as-cran` in CI.
215
+
216
+ ### Release checklist:
217
+
218
+ - All checks pass and code coverage is adequate
219
+ - NEWS.md is up to date
220
+ - Disclaimer is in released form
221
+ - Version updated in `code.json`
222
+ - Push `rc/<version>` branch to code.usgs.gov and confirm the pipeline
223
+ passes
224
+ - Download tarball from the GitLab package registry and submit to CRAN
225
+ - After CRAN acceptance:
226
+ - Ensure pkgdown is up to date
227
+ - Commit, push, and PR/MR changes
228
+ - Create release page and tag
229
+ - Attach CRAN tar.gz to release page
230
+ - Update DOI to point to release page
231
+ - Switch README disclaimer back to “dev” mode
232
+ - Bump version in DESCRIPTION
233
+
234
+ # Disclaimer
235
+
236
+ This software is preliminary or provisional and is subject to revision.
237
+ It is being provided to meet the need for timely best science. The
238
+ software has not received final approval by the U.S. Geological Survey
239
+ (USGS). No warranty, expressed or implied, is made by the USGS or the
240
+ U.S. Government as to the functionality of the software and related
241
+ material nor shall the fact of release constitute any such warranty. The
242
+ software is provided on the condition that neither the USGS nor the U.S.
243
+ Government shall be held liable for any damages resulting from the
244
+ authorized or unauthorized use of the software.
245
+
246
+ [![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/)
@@ -0,0 +1,228 @@
1
+
2
+ <!-- README.md is generated from README.Rmd. Please edit that file -->
3
+
4
+ # hydroloom <img src="man/figures/logo.png" align="right" alt="" width="120" />
5
+
6
+ [![R-CMD-check](https://github.com/DOI-USGS/hydroloom/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/DOI-USGS/hydroloom/actions/workflows/R-CMD-check.yaml)
7
+ [![codecov](https://codecov.io/gh/doi-usgs/hydroloom/branch/main/graph/badge.svg)](https://app.codecov.io/gh/doi-usgs/hydroloom)
8
+ [![CRAN](https://www.r-pkg.org/badges/version/hydroloom)](https://cran.r-project.org/package=hydroloom)
9
+
10
+ ## hydroloom:
11
+
12
+ **Install:** `install.packages("hydroloom")`
13
+
14
+ Or for latest development:
15
+ `remotes::install_github("doi-usgs/hydroloom")`
16
+
17
+ `hydroloom` is a collection of functions to work with hydrologic
18
+ geospatial fabrics. Hydroloom is designed to provide general hydrologic
19
+ network functionality for any hydrographic or hydrologic data. The
20
+ package is intended for developers of workflows and other packages that
21
+ require low level network and network data manipulation utilities.
22
+
23
+ **To Learn More, visit the pkgdown site**:
24
+ <https://doi-usgs.github.io/hydroloom/articles/hydroloom.html>
25
+
26
+ ## Citation:
27
+
28
+ Blodgett, D., 2026, hydroloom: Utilities to Weave Hydrologic Fabrics v1.2,
29
+ https://doi.org/10.5066/P16RS3UZ
30
+
31
+ Hydroloom has support for attributes that can be seen in:
32
+
33
+ ``` r
34
+ hydroloom::hydroloom_name_definitions
35
+ ```
36
+
37
+ <details>
38
+
39
+ <summary>
40
+
41
+ Click to See Definitions
42
+ </summary>
43
+
44
+ | Name | Definition |
45
+ |:---|:---|
46
+ | id | shared network identifier for catchment divide and flowpath or flowline |
47
+ | toid | indicates to the downstream id. May or may not be dendritic |
48
+ | fromnode | indicates the node representing the nexus upstream of a catchment |
49
+ | tonode | indicates the node representing the nexus downstream of a catchment |
50
+ | divergence | indicates whether a catchment is not downstream of a divergence (0), the primary path downstream of a divergence (1), or a diversion downstream of a divergence (2). |
51
+ | divergence_fraction | Indicates the fraction of flow to be apportioned to a given diverted path. Should sum to 1 when considering all diverted flowlines downstream of a diversion. |
52
+ | wbid | waterbody id |
53
+ | total_da_sqkm | total drainage area at the outlet of a catchment |
54
+ | da_sqkm | local drainage area of a catchment |
55
+ | length_km | length of a single catchment’s flowpath |
56
+ | pathlength_km | distance from the outlet of a catchment to the terminal outlet of a network |
57
+ | arbolate_sum | total accumulated length of all upstream flowlines |
58
+ | topo_sort | Similar to hydrosequence in NHDPlus. Large topo_sort values are upstream of small topo_sort values. Note that there are many valid topological sort orders of a directed graph. |
59
+ | up_topo_sort | topo sort value of the upstream mainstem |
60
+ | dn_topo_sort | topo sort value of the downstream mainstem |
61
+ | dn_minor_topo_sort | topo sort value of the downstream minor network element with the smallest id |
62
+ | terminal_topo_sort | topo sort value of the outlet network element |
63
+ | terminal_flag | 1 for network terminous 0 for within network |
64
+ | terminal_id | id of terminal catchment for entire drainage basin |
65
+ | start_flag | 1 for a headwater, 0 otherwise |
66
+ | levelpath | provides an identifier for the collection of flowlines that make up a single mainstem flowpath of a drainage basin |
67
+ | up_levelpath | levelpath value of the upstream mainstem |
68
+ | dn_levelpath | levelpath value of the downstream mainstem |
69
+ | levelpath_outlet_id | id of outlet catchment of a levelpath |
70
+ | stream_level | starting at 1 for coastal terminals and 4 for inland terminals increments by 1 for each smaller tributary level |
71
+ | dn_stream_level | stream level of downstream mainstem network element |
72
+ | stream_order | starting at 1 for headwaters increments by 1 for each larger tributary level, diversions adopt stream order from upstream but returning diverted network does not increment stream order |
73
+ | stream_calculator | starting at 1 for headwaters and 0 along diverted paths increments by 1 for each larger tributary level, does no increment along diverted paths. Is equal to stream_order along the dendritic network |
74
+ | feature_type | descriptive feature type moniker |
75
+ | feature_type_code | compact feature type identifier |
76
+ | vector_proc_unit | identifier for processing units based on vector encapsulation |
77
+ | raster_proc_unit | identifier for processing units based on raster encapsulation |
78
+ | id_measure | interpolative linear reference measure along a single identified feature |
79
+ | aggregate_id | aggregate identifier useful for ‘reach’ or ‘flowpath’ aggregation of flowlines |
80
+ | aggregate_id_measure | interpolative linear reference measure along an aggregate feature |
81
+ | aggregate_id_from_measure | interpolative linear reference for downstream end of a single feature that makes up an aggregate feature |
82
+ | aggregate_id_to_measure | interpolative linear reference for the upstream end of a single feature that makes up an aggregate feature |
83
+ | point_id | identifier of hydrologic location point |
84
+ | offset | offset distance from point to line in units of linear reference analysis units |
85
+ | upmain | indicates that a given network element is the primary upstream connection at a confluence |
86
+ | downmain | indicates that a given network element is the primary downstream connection at a confluence |
87
+
88
+ </details>
89
+
90
+ <br/>
91
+
92
+ `hydroloom` supports your attribute names that map to the in-built
93
+ definitions. See
94
+ [`hydroloom_names()`](https://doi-usgs.github.io/hydroloom/reference/hydroloom_names.html)
95
+ for more.
96
+
97
+ `hydroloom` supports both dendritic and non-dendritic networks start at
98
+ [this
99
+ vignette](https://doi-usgs.github.io/hydroloom/articles/non-dendritic.html)
100
+ for more.
101
+
102
+ `hydroloom` was largely created from components of
103
+ [nhdplusTools](https://doi.org/10.5066/P97AS8JD), which is now published
104
+ as [hydrogeofetch](https://doi-usgs.github.io/hydrogeofetch/):
105
+
106
+ Blodgett, D., Johnson, J.M., 2022, nhdplusTools: Tools for
107
+ Accessing and Working with the NHDPlus,
108
+ https://doi.org/10.5066/P97AS8JD
109
+
110
+ `hydrogeofetch` supports web service access and the particulars of the
111
+ NHDPlus data model. In contrast, `hydroloom` is intended to be more
112
+ general and focused specifically on hydro fabric data functionality.
113
+
114
+ `hydroloom` implements algorithms documented in:
115
+
116
+ NHDPlus Attributes:
117
+
118
+ Moore, R.B., McKay, L.D., Rea, A.H., Bondelid, T.R., Price, C.V., Dewald, T.G.,
119
+ and Johnston, C.M., 2019, User's guide for the national hydrography dataset
120
+ plus (NHDPlus) high resolution: U.S. Geological Survey Open-File Report 2019–1096,
121
+ 66 p., https://doi.org/10.3133/ofr20191096.
122
+
123
+ Graph Concepts:
124
+
125
+ Cormen, T. H., & Leiserson, C. E. (2022). Introduction to
126
+ Algorithms, fourth edition. MIT Press.
127
+
128
+ Pfafstetter Attributes:
129
+
130
+ Verdin, K. L., & Verdin, J. P. (1999). A topological system for
131
+ delineation and codification of the Earth's river basins.
132
+ Journal of Hydrology, 218(1–2), 1–12.
133
+ https://doi.org/10.1016/S0022-1694(99)00011-6
134
+
135
+ ### Terminology:
136
+
137
+ The following definitions have been used as much as possible throughout
138
+ the package. Terms for rivers: **Flowline:** A flowline is an linear
139
+ geometry that represents a segment of a flowing body of water. Some
140
+ flowlines have no local drainage area and are never aggregate features.
141
+ **Flowpath:** A flowpath is a linear geometry that represents the
142
+ connection between a catchment’s inlet and its outlet. All flowpaths
143
+ have a local drainage area and may be aggregates of flowlines.
144
+ **Catchment:** A physiographic unit with zero or one inlets and one
145
+ outlet. A catchment is represented by one or more partial realizations;
146
+ flowpath, divide, and networks of flowpaths and divides. **Catchment
147
+ Divide:** The polygon boundary that encompasses a catchment.
148
+ **Divergence:** The hydrologic nexus (node) where flow diverges. A
149
+ divergence is an abstract location in a hydrologic network.
150
+ **Diversion:** A flowline that is below a divergence and is not the
151
+ primary downstream path. A diversion is a specific feature downstream of
152
+ a divergence.
153
+
154
+ ### Design Notes:
155
+
156
+ - Hydroloom uses tibble because dplyr verbs for data.frame was dropping
157
+ the custom hy attributes.
158
+ - The `data.table` package is used for some key joins to enhance
159
+ scalability but dplyr is preferred for clarity.
160
+ - `hy` class tibble standardizes all attribute names in code.
161
+ - graph representation facilitated by `make_index_ids()`
162
+ - names are plural when referring to identifiers and singular when
163
+ referring to a numerical attribute.
164
+
165
+ ### Build and release:
166
+
167
+ Development happens on GitHub (DOI-USGS/hydroloom). Official builds and
168
+ release candidates are produced on code.usgs.gov
169
+ (code.usgs.gov/water/hydroloom) using GitLab CI.
170
+
171
+ Vignettes use the `BUILD_VIGNETTES` environment variable to control code
172
+ evaluation. Set `BUILD_VIGNETTES=TRUE` in a local `.Renviron` to build
173
+ them with live code; without it every chunk renders as prose and code
174
+ with no evaluated output. Only `vignettes/hydroloom.Rmd` ships to CRAN.
175
+ Everything under `vignettes/articles/` is website-only — excluded from
176
+ the source tarball by `.Rbuildignore` and built by pkgdown. A vignette
177
+ that needs a web service or a large download belongs in
178
+ `vignettes/articles/`.
179
+
180
+ Local development does not require building the source package. Use
181
+ `devtools::test()`, `devtools::check()`, and `devtools::document()`
182
+ directly.
183
+
184
+ Release candidates are built on code.usgs.gov. Push a branch named
185
+ `rc/<version>` (e.g. `rc/1.2.1`) to trigger the GitLab CI pipeline,
186
+ which runs three stages:
187
+
188
+ 1. **check** — lightweight structural check with no tests, examples, or
189
+ vignettes. Gates the rest of the pipeline.
190
+ 2. **build** — `R CMD build .` to produce the source tarball, which is
191
+ uploaded to the GitLab generic package registry.
192
+ 3. **verify** — `R CMD check --as-cran` on the built tarball.
193
+
194
+ Once the pipeline passes, download the tarball from the package registry
195
+ and submit it to CRAN. The tarball that CRAN receives is the exact
196
+ artifact that passed `--as-cran` in CI.
197
+
198
+ ### Release checklist:
199
+
200
+ - All checks pass and code coverage is adequate
201
+ - NEWS.md is up to date
202
+ - Disclaimer is in released form
203
+ - Version updated in `code.json`
204
+ - Push `rc/<version>` branch to code.usgs.gov and confirm the pipeline
205
+ passes
206
+ - Download tarball from the GitLab package registry and submit to CRAN
207
+ - After CRAN acceptance:
208
+ - Ensure pkgdown is up to date
209
+ - Commit, push, and PR/MR changes
210
+ - Create release page and tag
211
+ - Attach CRAN tar.gz to release page
212
+ - Update DOI to point to release page
213
+ - Switch README disclaimer back to “dev” mode
214
+ - Bump version in DESCRIPTION
215
+
216
+ # Disclaimer
217
+
218
+ This software is preliminary or provisional and is subject to revision.
219
+ It is being provided to meet the need for timely best science. The
220
+ software has not received final approval by the U.S. Geological Survey
221
+ (USGS). No warranty, expressed or implied, is made by the USGS or the
222
+ U.S. Government as to the functionality of the software and related
223
+ material nor shall the fact of release constitute any such warranty. The
224
+ software is provided on the condition that neither the USGS nor the U.S.
225
+ Government shall be held liable for any damages resulting from the
226
+ authorized or unauthorized use of the software.
227
+
228
+ [![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/)