Skip to content

Commit

Permalink
Merge branch 'main' into new-default
Browse files Browse the repository at this point in the history
  • Loading branch information
visr authored Oct 7, 2024
2 parents 3ee5d6d + 8f64d32 commit 6cc2e95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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
2 changes: 1 addition & 1 deletion python/ribasim/ribasim/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Model(FileModel):
user_demand: UserDemand = Field(default_factory=UserDemand)

edge: EdgeTable = Field(default_factory=EdgeTable)
use_validation: bool = Field(default=True)
use_validation: bool = Field(default=True, exclude=True)

_used_node_ids: UsedIDs = PrivateAttr(default_factory=UsedIDs)

Expand Down
1 change: 1 addition & 0 deletions python/ribasim_testmodels/ribasim_testmodels/trivial.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def trivial_model() -> Model:
endtime="2021-01-01",
crs="EPSG:28992",
results=Results(subgrid=True, compression=False),
use_validation=True,
)

# Convert steady forcing to m/s
Expand Down

0 comments on commit 6cc2e95

Please sign in to comment.