Skip to content

Commit 9c33eed

Browse files
committed
Update docs
1 parent 21c54d6 commit 9c33eed

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

docs/user-guide/network.qmd

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ network.to_dataframe(sel="WaterLevel").head()
261261

262262
After construction, nodes are re-labelled as integers. Use `find()` to go from original coordinates to the integer ID and `recall()` to go back.
263263

264+
::: {.callout-tip}
265+
When creating `NodeObservation` objects for skill assessment you generally do **not** need to call `find()`. You can pass the original string ID or a `(edge, distance)` tuple directly as `node=`, and `NetworkModelResult` will resolve it for you during matching. See [Skill assessment workflow](#skill-assessment-workflow) for details.
266+
:::
267+
264268
```{python}
265269
# Look up a named node by its original id
266270
node_id = network.find(node="117")
@@ -309,6 +313,11 @@ mr
309313

310314
`NodeObservation` accepts a file path directly; the observation name is taken from the filename.
311315

316+
The `node=` argument can be specified in three ways, depending on what information you have at hand.
317+
318+
#### Option A — integer node ID (direct)
319+
320+
Pass the integer ID assigned by the `Network`. This is the most explicit form:
312321

313322
```{python}
314323
obs_1 = ms.NodeObservation(path_to_sensor_data_1, node=network.find(node="78"))
@@ -318,6 +327,35 @@ cc = ms.match(obs=[obs_1, obs_2], mod=mr)
318327
cc.skill()
319328
```
320329

330+
#### Option B — original string alias
331+
332+
Pass the original node identifier from the source format (e.g. the Res1D node name) as a plain string. The `NetworkModelResult` resolves it to the correct integer ID at match time, so you never need to call `network.find()` yourself:
333+
334+
```{python}
335+
obs_1 = ms.NodeObservation(path_to_sensor_data_1, node="78")
336+
obs_2 = ms.NodeObservation(path_to_sensor_data_2, node="46")
337+
338+
cc = ms.match(obs=[obs_1, obs_2], mod=mr)
339+
cc.skill()
340+
```
341+
342+
::: {.callout-note}
343+
Resolution happens inside `ms.match()`. If the string is not found in the network's alias map a `ValueError` is raised with a clear message indicating which alias could not be resolved.
344+
:::
345+
346+
#### Option C — breakpoint by `(edge, distance)` tuple
347+
348+
When your observation sits at a chainage along a reach rather than at a named junction node, pass a `(edge_id, distance)` tuple. The `NetworkModelResult` looks up the corresponding breakpoint at match time:
349+
350+
```python
351+
obs_bp = ms.NodeObservation(path_to_sensor_data_1, node=("94l1", 21.285))
352+
353+
cc = ms.match(obs=obs_bp, mod=mr)
354+
cc.skill()
355+
```
356+
357+
The tuple form is equivalent to calling `network.find(edge="94l1", distance=21.285)` beforehand and is resolved during matching.
358+
321359
## Development
322360

323361
### Custom network formats

0 commit comments

Comments
 (0)