Skip to content

Commit

Permalink
Return instead of crash when trying to plot model without edges
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian committed Mar 13, 2024
1 parent ed02392 commit b0565a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/ribasim/ribasim/geometry/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def get_where_edge_type(self, edge_type: str) -> NDArray[np.bool_]:
return (self.df.edge_type == edge_type).to_numpy()

def plot(self, **kwargs) -> Axes:
assert self.df is not None # Pleases mypy
if self.df is None:
return

Check warning on line 83 in python/ribasim/ribasim/geometry/edge.py

View check run for this annotation

Codecov / codecov/patch

python/ribasim/ribasim/geometry/edge.py#L83

Added line #L83 was not covered by tests
kwargs = kwargs.copy() # Avoid side-effects
ax = kwargs.get("ax", None)
color_flow = kwargs.pop("color_flow", None)
Expand Down

0 comments on commit b0565a8

Please sign in to comment.