Skip to content

Feat/nhf upstream flow#81

Closed
dylanlee wants to merge 13 commits intofeat/add-nhf-links-and-nodesfrom
feat/nhf-upstream-flow
Closed

Feat/nhf upstream flow#81
dylanlee wants to merge 13 commits intofeat/add-nhf-links-and-nodesfrom
feat/nhf-upstream-flow

Conversation

@dylanlee
Copy link

@dylanlee dylanlee commented Mar 3, 2026

No description provided.

dylanlee and others added 13 commits March 2, 2026 18:07
Modify NHF.py to distribute Q into nodes and nexuses rather than as
Q_lat into links
This commit fixes a bug that was introduced because _connections was
being rebuilt on every routing loop. When virtual segments that are
being used for Q_up discrarges were 0 in a loop this was causing an
uncaught error
Clean up imports so don't have to export unecessarily from refactored
NHF.py
Was previously not distributing upstream flow because virtual segment
IDs were overwriting link IDs that were bing included in
fp_to_first_link dict. This was causing loss of upstream flow because
the flow was being recorded to virtual segments.
geom = row['geometry']
if geom is not None:
fp_geom_lookup[int(row['fp_id'])] = (
geom.geoms[0] if geom.geom_type == 'MultiLineString' else geom
Copy link

Choose a reason for hiding this comment

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

Should this be geoms[0] or should we do a line_merge here?

I'm thinking about an edge case where you take the first linestring and then one of the virtual nexuses doesn't intersect it?

Another impact might be the difference between fp_geom_length_m = fp_geom.length and length_km = fp['length_km']

has_geometry = fp_geom is not None and tnex_ids

if has_geometry:
fp_geom_length_m = fp_geom.length
Copy link

Choose a reason for hiding this comment

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

Was there a reason to split this out and not use fp_geom_length_m = length_km * 1000

@sclaw
Copy link

sclaw commented Mar 19, 2026

Closing because this has been superseded by #85

@sclaw sclaw closed this Mar 19, 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