Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions neatnet/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,6 @@ def _status(x: pd.Series) -> str:
return "changed"


def _first_non_null(x: pd.Series):
"""Return first observation that is not missing, unless all are."""
non_null = x[~x.isna()]
if non_null.empty:
return x.iloc[0]
return non_null.iloc[0]


def isolate_bowtie_nodes(edgelines: list | np.ndarray | gpd.GeoSeries) -> gpd.GeoSeries:
r"""
Bowties are a rare edgecase whereby a component has:
Expand Down
3 changes: 1 addition & 2 deletions neatnet/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
from .continuity import continuity, get_stroke_info
from .nodes import (
_first_non_null,
_nodes_degrees_from_edges,
_nodes_from_edges,
_status,
Expand Down Expand Up @@ -326,7 +325,7 @@ def neatify_singletons(
if c != "_status":
# returning first non null as we may be joining new with existing
# and want attributes from existing
agg[c] = _first_non_null
agg[c] = "first"
non_empties = new_streets[~(new_streets.is_empty | new_streets.geometry.isna())]
new_streets = remove_interstitial_nodes(non_empties, aggfunc=agg)

Expand Down
Loading