Skip to content

Rename edge to reach throughout network extension#642

Merged
jpalm3r merged 2 commits intoedge_observationsfrom
rename-edge-to-reach
Apr 24, 2026
Merged

Rename edge to reach throughout network extension#642
jpalm3r merged 2 commits intoedge_observationsfrom
rename-edge-to-reach

Conversation

@jpalm3r
Copy link
Copy Markdown
Collaborator

@jpalm3r jpalm3r commented Apr 24, 2026

Closes #641

Summary

Renames all network-related "edge" terminology to "reach" to align with DHI nomenclature.

Class renames

  • EdgeBreakPointReachBreakPoint
  • NetworkEdgeNetworkReach
  • BasicEdgeBasicReach
  • EdgeObservationReachObservation
  • EdgeCoordsReachCoords (internal timeseries layer)

API changes

  • Network(edges=...)Network(reaches=...)
  • Network.find(edge=...)Network.find(reach=...)
  • Network.recall() return dict: 'edge' key → 'reach' key
  • observation(gtype='edge')observation(gtype='reach')
  • xarray coordinate 'edge''reach' in datasets
  • NetworkModelResult._extract_edge()_extract_reach()

Files updated

  • src/modelskill/network.py
  • src/modelskill/obs.py
  • src/modelskill/model/network.py
  • src/modelskill/model/adapters/_res1d.py
  • src/modelskill/timeseries/_coords.py
  • src/modelskill/timeseries/_point.py
  • src/modelskill/timeseries/_timeseries.py
  • src/modelskill/__init__.py
  • src/modelskill/matching.py
  • tests/test_network.py
  • tests/test_match.py
  • docs/user-guide/network.qmd
  • docs/_quarto.yml

All 652 tests pass.

Renames all network-related 'edge' terminology to 'reach' to align
with DHI nomenclature as requested in issue #641.

Changes:
- EdgeBreakPoint -> ReachBreakPoint
- NetworkEdge -> NetworkReach
- BasicEdge -> BasicReach
- EdgeObservation -> ReachObservation
- Network.__init__(edges=) -> Network.__init__(reaches=)
- Network.find(edge=) -> Network.find(reach=)
- Network._edges -> Network._reaches
- NetworkModelResult._extract_edge() -> _extract_reach()
- xarray coordinate 'edge' -> 'reach'
- EdgeCoords -> ReachCoords in timeseries layer
- observation() factory: gtype='edge' -> gtype='reach'
- recall() return dict: 'edge' key -> 'reach' key
- All docs, tests, and error messages updated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jpalm3r jpalm3r requested a review from ecomodeller as a code owner April 24, 2026 06:39
Copy link
Copy Markdown
Member

@ecomodeller ecomodeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — rename is in the right direction and matches DHI terminology.

A few leftover references worth a quick follow-up:

  • src/modelskill/timeseries/_point.py:246 still references EdgeCoords in a type hint (mypy flags it; only silent at runtime because of from __future__ import annotations).
  • tests/test_network.py:452, 469, 485, 500 — four test_extract_edge_observation_* functions not renamed.
  • tests/test_network.py:88-89 — local edges = [...] variable passed to Network(reaches=...).
  • docs/user-guide/network.qmd:183 — "(nodes, edges, lengths)" reads inconsistently next to the new reaches vocabulary.

NetworkX g0.add_edge(...) calls in network.py are correctly left as-is (graph-theory sense).

@jpalm3r
Copy link
Copy Markdown
Collaborator Author

jpalm3r commented Apr 24, 2026

Just fixed the remaining "edge" mentions, will merge now.

@jpalm3r jpalm3r merged commit 2f0065e into edge_observations Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants