hydroloom 1.2.0
This release introduces an S3 class hierarchy (hy_topo, hy_leveled, hy_node, hy_flownetwork) that lets hydroloom functions validate input at dispatch time and provide guided error messages when the wrong network representation is passed. Existing code that passes data.frame or hy objects continues to work without changes – the new classes are assigned automatically and are transparent to downstream consumers. Package developers who depend on hydroloom should note that returned objects now carry subclass attributes (e.g. hy_topo) which are stripped by hy_reverse() and by standard dplyr operations.
- Outlet detection is explicit (#85): a row is an outlet when its
toidis not inid. Canonical reserved values (0/""),NA, implicit absence, foreign reserved values, and unique-per-outlet ids are all accepted. -
hy()still normalizesNAtoidto the canonical reserved outlet value, sox$toid == 0afterhy()keeps working. -
make_node_topology()andis.hy()acceptNAand orphantoid; the related errors are removed. -
check_hy_outlets()warns only onid/toidtype mismatch. -
sort_network()warns only when a network has zero outlets. - Improve performance of
add_levelpaths()by converting to data.table - Add S3 class hierarchy:
hy_topo,hy_leveled,hy_node,hy_flownetwork– #73 -
hy()gainsadd_topoparameter to auto-build toid from fromnode/tonode - New exported helpers:
hy_network_type(),is_dendritic(),hy_capabilities() - Print methods for
hy_topo,hy_node,hy_flownetwork - Producer functions now stamp output classes:
add_toids()->hy_topo,sort_network()->hy_topo,add_levelpaths()->hy_leveled,make_node_topology()->hy_node,to_flownetwork()->hy_flownetwork -
add_divergence()setsattr(x, "dendritic") <- FALSEon output -
add_toids(return_dendritic = FALSE)is deprecated; useto_flownetwork() - S3 method dispatch: functions now dispatch on subclass (e.g.
.hy_topo,.hy_leveled) with guided error messages for wrong input class - Functions that require
hy_leveled(e.g.add_pfafstetter(),navigate_hydro_network(),to_flownetwork()) fall through fromhy_topo/hy_nodewhen required columns are already present - Fix pre-existing bug in
make_to_dt()where dendritic branch failed on tibble input (data.tablewith = FALSEsyntax on plain data.frame) - Fix
get_bridge_flowlines()correctness on networks with independent terminals:make_nondendritic_topology()collapsed all rows carrying the reserved outlet value into one synthetic node, misclassifying bridges and exhausting memory on continental networks -
to_flownetwork()andget_bridge_flowlines()now accepthy_nodeinput withoutdivergence/levelpath, auto-converting to a non-dendritic edge list with a warning that main-path info is dropped -
hy_flownetworkno longer inherits fromhy– it is a separate junction table whereidis not guaranteed to be a primary key, and it does not passis.hy(). Documented behavior already; the implementation now matches - Documentation:
- Add class-level roxygen pages for
hy_topo,hy_leveled,hy_node, andhy_flownetworkdescribing representation pattern, required columns, supported functions, and conversion paths - Add divergence case study to
vignette("non-dendritic")showing how a secondary path is dropped inhy_topoform and preserved inhy_flownetworkform - Add
hy_capabilities()pipeline walkthrough tovignette("network_navigation")demonstrating thehy->hy_node->hy_topo->hy_leveled->hy_flownetworkprogression - Style and clarity pass across all vignettes
- Add class-level roxygen pages for
- Domain decomposition gains a containment relationship that lets callers declare, post-decomposition, that one domain (a catchment aggregate, in HY_Features terms) is enclosed by another – endorheic basins, drainage-divide remnants, or any isolated component the caller wants treated as contained. New
set_containment()records the declaration;get_containing_domain()reads it back;get_domain_graph()returns one row per declaration (withnexus_id = NAandrelation_type = "contained");recompose()gains acontainmentargument that defaults to"ignore"(each basin’s accumulated value stops at its own outlet) and optionally"accumulate"(the contained basin’s accumulated value is added at the containing domain’s outlet and routed downstream through the containing basin’s extensive network). Containment does not appear innexus_registrybecause no flow crosses a hydro nexus between the two basins. -
Deprecation notice: A future release will require that
hy_topoobjects have uniqueidvalues (one row per catchment). Non-dendritic connectivity with duplicated ids in a toid-based edge list will need to be represented ashy_flownetwork(viato_flownetwork()). Developers who currently pass non-dendritic toid tables through hydroloom functions should migrate toto_flownetwork()ormake_node_topology()for non-dendritic workflows.
hydroloom 1.1.2
CRAN release: 2026-02-20
Hydroloom 1.1.2 introduces new functionality in accumulate_downstream(), reworks the make_index_ids(), and deprecates make_fromids() and format_index_ids() for clarity of package function. Deprecated functions will be removed in the next major version release.
-
subset_network()has been added to support subsetting networks to include all diversions that emanate from the basin. – #60 -
accumulate_downstream()now supports “total upstream” and “divergence routed” accumulation. – #17 -
make_index_ids()has been rewritten. It now uses four modes (“to”, “from”, and “both”). -
make_fromids()is deprecated in favor ofmake_index_ids()with mode = “from”. -
format_index_ids()is deprecated. The *_list element ofmake_index_ids()can be unnested instead.
hydroloom 1.1.0
CRAN release: 2024-08-26
- Add new vignette for network navigation
vignette("network_navigation") - Add support for upmain and downmain navigation in
navigate_network_dfs() - Add support for upmain and downmain in
make_index_ids()andmake_fromids(). - Add function to create a “flownetwork” representation of the network with a
to_flownetworkfunction. - Improved handling / fix bugs with edge cases in
add_toids() - Improved error conditions when missing suggested packages.
-
navigate_hydro_network()will now navigate from a diverted path to a main path where it previously only followed traditional tributaries..
hydroloom 1.0.0
CRAN release: 2023-09-29
- Initialized new project
- Create basic
hys3 object handlinghy() - Ensure tibble is used throughout
- Support generic depth first search navigation
navigate_network_dfs() - Complete migration of nhdplusTools functions to hydroloom. #1
- Support sorting non-dendritic network in
sort_network() - Implemented non-dendritic network support in
add_toids() - Implemented complete stream order / stream calculator attribute
add_streamorder()andadd_streamcalculator()https://github.com/DOI-USGS/nhdplusTools/issues/188 - Support for both numeric and character identifiers #2
- Support for NHDPlus and NHD 24k naming schemes #5
hydroloom_names() - Support for linear indexing for lines that do not have measure attributes #6
index_points_to_lines() - Implemented creation of an attribute topology from a geometric network
make_attribute_topology() - Added vignette showing how to work with the NHD flow table. https://github.com/DOI-USGS/nhdplusTools/issues/340
vignette("flow-table") - Implement method to add divergence attribute to a non-dendritic network.
add_divergence() - Implement basic graph and sophisticate loop detection algorithm #7 and #9.
check_hy_graph()
