Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ValidationError from inplace set_geometry
``` ValidationError Traceback (most recent call last) File a:\repo\ribasim\Ribasim\models\see.py:1 ----> 1 ribasim_testmodels.trivial_model() File A:\repo\ribasim\Ribasim\python\ribasim_testmodels\ribasim_testmodels\trivial.py:9, in trivial_model() 7 def trivial_model() -> Model: 8 """Trivial model with just a basin, tabulated rating curve and terminal node.""" ----> 9 model = Model( 10 starttime="2020-01-01", 11 endtime="2021-01-01", 12 crs="EPSG:28992", 13 results=Results(subgrid=True, compression=False), 14 use_validation=True, 15 ) 17 # Convert steady forcing to m/s 18 # 2 mm/d precipitation, 1 mm/d evaporation 19 precipitation = 0.002 / 86400 File a:\repo\ribasim\Ribasim\.pixi\envs\dev\Lib\site-packages\pydantic\main.py:214, in BaseModel.__init__(self, **data) 212 # `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks 213 __tracebackhide__ = True --> 214 validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) 215 if self is not validated_self: 216 warnings.warn( 217 'A custom validator is returning a value other than `self`.\n' 218 "Returning anything other than `self` from a top level model validator isn't supported when validating via `__init__`.\n" 219 'See the `model_validator` docs (https://docs.pydantic.dev/latest/concepts/validators/#model-validators) for more details.', 220 stacklevel=2, 221 ) ValidationError: 1 validation error for Model Value error, Can't do inplace setting when converting from DataFrame to GeoDataFrame [type=value_error, input_value={'starttime': '2020-01-01... 'use_validation': True}, input_type=dict] For further information visit https://errors.pydantic.dev/2.10/v/value_error ```
- Loading branch information