Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty default point #1872

Merged
merged 2 commits into from
Oct 7, 2024
Merged
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
5 changes: 2 additions & 3 deletions python/ribasim/ribasim/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pydantic
from geopandas import GeoDataFrame
from pydantic import ConfigDict, Field, NonNegativeInt, model_validator
from shapely import is_empty
from shapely.geometry import Point

from ribasim.geometry import BasinAreaSchema, NodeTable
Expand Down Expand Up @@ -170,10 +169,10 @@ class Node(pydantic.BaseModel):
def __init__(
self,
node_id: Optional[NonNegativeInt] = None,
geometry: Point = Point("nan", "nan"),
geometry: Point = Point(),
**kwargs,
) -> None:
if is_empty(geometry):
if geometry.is_empty:
raise (ValueError("Node geometry must be a valid Point"))
super().__init__(node_id=node_id, geometry=geometry, **kwargs)

Expand Down