← Back to all sparks
H

hydroloom

ANALYTICS
Velocity0.0

R package hydroloom by doi-usgs — release notes from GitHub.

USGS puts a type system over its river network toolkit so errors surface at dispatch

hydrologynetwork-analysisgeospatialr-packageusgs
Current state
hydroloom builds and navigates hydrologic flow networks, carrying functionality migrated out of nhdplusTools. Version 1.2.0 introduces an S3 class hierarchy — hy_topo, hy_leveled, hy_node, hy_flownetwork — assigned automatically by hy() and by producer functions, letting the package validate input at dispatch time and emit guided errors. Outlet detection is now defined explicitly: a row is an outlet when its toid is not in id, with reserved values, NA and implicit absence all accepted.
Where it's heading
The package spent its first releases porting and broadening — non-dendritic network support, divergence routing, subsetting that follows diversions out of a basin — and has now turned to making that surface safe to use. The class hierarchy is the structural expression of that turn: instead of every function re-checking whether a data frame has the columns it needs, the type carries the guarantee. The explicit outlet rule resolves a category of failure where valid networks errored on NA or orphan toid values.
Prediction
The release notes flag that subclass attributes are stripped by standard dplyr operations, which is the kind of rough edge that usually generates follow-up work — expect attribute preservation or restoration helpers next.

Recent moves

  1. 2mo ago

    hydroloom v1.2.0

    ⚡ SPARK

    An S3 class hierarchy — hy_topo, hy_leveled, hy_node, hy_flownetwork — is stamped automatically by hy() and by producer functions, enabling dispatch-time validation and guided error messages. Outlet detection becomes an explicit rule rather than an inference, accepting reserved values, NA, implicit absence and unique-per-outlet ids; calls that previously errored on NA or orphan toid now succeed. Existing data.frame and hy code keeps working.

    View source ↗
  2. 5mo ago

    Test tolerances relaxed for CRAN Fedora checks

    Loosens test tolerances so CRAN's Fedora checks pass. Infrastructure only.

    View source ↗
  3. 5mo ago

    Network subsetting and divergence-routed accumulation

    subset_network() arrives with support for including diversions emanating from a basin, accumulate_downstream() gains total-upstream and divergence-routed modes, and make_index_ids() is rewritten with to, from and both modes — deprecating make_fromids() and format_index_ids() in the process.

    View source ↗
  4. 10mo ago

    Sort and indexing fixes

    Bug fixes for sort_network with duplicate extended attributes, plus id-specific search in index_points_to_lines and error handling.

    View source ↗
  5. 1y ago

    Upmain and downmain navigation for non-dendritic networks

    Non-dendritic support deepens: upmain and downmain navigation in navigate_network_dfs() and make_index_ids(), a to_flownetwork() representation, and navigation that now follows a diverted path back to a main path rather than only traditional tributaries.

    View source ↗
  6. 2y ago

    Initial release completing the nhdplusTools migration

    The founding release, completing the migration of network functions out of nhdplusTools: the hy() S3 object, depth-first navigation, non-dendritic sorting, stream order and stream calculator attributes, linear indexing without measure attributes, and support for both NHDPlus and NHD 24k naming.

    View source ↗