From be49e538ebbe8cd28fe4dac57fe3932c18ab08ee Mon Sep 17 00:00:00 2001 From: Jingru Feng Date: Fri, 3 May 2024 10:43:30 +0200 Subject: [PATCH] adapt comment --- python/ribasim/ribasim/model.py | 19 ------------------- python/ribasim/tests/test_model.py | 8 ++------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/python/ribasim/ribasim/model.py b/python/ribasim/ribasim/model.py index 46774cd46..68f90e812 100644 --- a/python/ribasim/ribasim/model.py +++ b/python/ribasim/ribasim/model.py @@ -229,25 +229,6 @@ def _children(self): if isinstance(getattr(self, k), ChildModel) } - def validate_model_node_field_ids(self): - """Check whether the node IDs of the node_type fields are valid.""" - - raise NotImplementedError() - - def validate_model_node_ids(self): - raise NotImplementedError() - - def validate_model(self): - """Validate the model. - - Checks: - - Whether the node IDs of the node_type fields are valid - - Whether the node IDs in the node field correspond to the node IDs on the node type fields - """ - - self.validate_model_node_field_ids() - self.validate_model_node_ids() - @classmethod def read(cls, filepath: str | PathLike[str]) -> "Model": """Read model from TOML file.""" diff --git a/python/ribasim/tests/test_model.py b/python/ribasim/tests/test_model.py index 3f4c7eaac..c64ba479a 100644 --- a/python/ribasim/tests/test_model.py +++ b/python/ribasim/tests/test_model.py @@ -12,7 +12,6 @@ from ribasim.geometry.edge import NodeData from ribasim.input_base import esc_id from ribasim.model import Model -from ribasim.nodes import pump from shapely import Point @@ -67,15 +66,12 @@ def test_exclude_unset(basic): assert d["solver"]["saveat"] == 86400.0 -# @pytest.mark.xfail(reason="Needs implementation") -def test_invalid_node_id(basic): - model = basic - +def test_invalid_node_id(): with pytest.raises( ValueError, match=r".* Input should be greater than or equal to 0 .*", ): - model.pump.add(Node(-1, Point(7.0, 7.0)), [pump.Static(flow_rate=[0.5 / 3600])]) + Node(-1, Point(7.0, 7.0)) @pytest.mark.xfail(reason="Should be reimplemented by the .add() API.")