Open
Conversation
Add website to DESCRIPTION
A few minor updates.
hydroloom
Navigate main
v1.1.2 prep
test tolerances
add_levelpaths() performance
phase 2: Additional S3 Class for #73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code Review Summary: hydroloom v1.0.0 → v1.2.0
Generated with Claude Code for PR #71. Covers all changes since
8e70a8c(v1.0.0) through the821ffc63a20a4f0a70289f917cde59a88219c9cb(v1.2.0 dev latest).Documentation Changes
accumulate_downstream(three accumulation modes with worked examples),network_navigation(DFS navigation includingupmain/downmain)hydroloom(addedmake_index_ids()content),advanced_network,flow-table,non-dendritic— terminology consistency (diversion→divergence, flowpath→flowline)webshot/geosto Suggestsadd_measures,get_bridge_flowlines,subset_network,to_flownetwork,hy_capabilities,hy_network_type,is_dendritic; updated pages for all modified functionsdivergence_fraction,upmain,downmainadded toR/00_hydroloom.RPackage Source Changes
New functions (since v1.1.0)
accumulate_downstream()— Three routing modes: dendritic (default), divergence-apportioned (divergence_fraction), and total upstream (bridge-based double-count prevention). Rewritten from serial loop to matrix-based iteration. #17get_bridge_flowlines()— Identifies bridge (cut-edge) flowlines via iterative Tarjan's algorithmsubset_network()— Upstream subsetting with diversion chasing for non-dendritic networks. #60to_flownetwork()— Convertshyobjects to a junction table withid,toid,upmain,downmainadd_measures()— Linear reference positions along aggregate featuresS3 class hierarchy (v1.2.0, #73)
New file
R/hy_classes.R(428 lines) defines:hy()updated — gainsadd_topoparameter; auto-classifies output viaclassify_hy(); setsattr(x, "dendritic")hy_reverse()updated — strips all subclasses, not just"hy"to_flownetwork()converted from plain function to S3 generic.hy,.hy_topo,.hy_node,.hy_leveled) with guided error messages when the wrong network representation is passedadd_toids()→hy_topo,add_levelpaths()→hy_leveled,make_node_topology()→hy_node,to_flownetwork()→hy_flownetworkhy_network_type(),is_dendritic(),hy_capabilities()hy_classify_and_redispatch,hy_as_dataframe,hy_node_to_topo,hy_topo_to_node)data.frame/hycode works without changes. 41 newS3method()registrations + 3 new exports in NAMESPACE.Reworked functions (since v1.1.0)
make_index_ids()— Rewritten withmodeparameter ("to","from","both"). Subsumesmake_fromids()andformat_index_ids(), both now deprecated.add_levelpaths()— Performance rewrite usingdata.table.reweight()removed. Non-dendritic input now supported.navigate_network_dfs()— Added"upmain"and"downmain"modesnavigate_hydro_network()— Now navigates diverted→main paths; added long-form mode aliases ("downmain","upmain","up","down")index_points_to_lines()— Newidsparameter; internalmatcher()rewritten asmatcher_dt()usingdata.table;geos::geos_buffer()when availableadd_divergence()— Usesmake_index_ids(mode = "from"); setsattr(x, "dendritic") <- FALSEcheck_hy_graph()— Usesmake_index_ids(mode = "both")utils.R— Helpers consolidated;add_toids_internal()gains divergence-fraction support; newdata.tableimportsBug fixes
sort_network()— Duplicate entries in extended attributes (#52)add_toids()—return_dendritic = TRUEwas mutatingfromnode; now preservedmake_to_dt()— Dendritic branch failed on tibble input (data.tablesyntax fix)Deprecations
make_fromids()— removed; usemake_index_ids(mode = "from")format_index_ids()— still exported with warningadd_toids(return_dendritic = FALSE)— useto_flownetwork()hy_topowill require uniqueid; non-dendritic duplicated-id edge lists must usehy_flownetworkorhy_nodeTesting Changes
test_accumulate.R(3 routing modes, simple/complex diversions),test_get_bridges.R(full Tarjan coverage),test_subset_network.R,test_to_flownetwork.R,test_add_measures.Rtest_hy_classes.R(374 lines, 25 tests) — constructor validation, auto-classification, producer class stamps, guided error coverage for all dispatch paths, auto-conversion messages, backward compatibilitytest_make_index_ids.R(mode/flownetwork/deprecation tests),test_add_levelpaths.R(non-dendritic input),test_add_toids.R(fromnode mutation),test_index.R(idsparameter, 3DHP),test_navigate_hydro_network.R(long-form modes),test_check_hy_graph.R(nested structure)test_make_fromids.R(folded intotest_make_index_ids.R)diversions.csv,diversions.geojson,simple_diversions.geojson,sort_network_dups.rds. Removed:reweight_test.rds