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

Initialize spatial table as GeoDataFrame #1242

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions python/ribasim/ribasim/input_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import pandas as pd
import pandera as pa
from pandera.typing import DataFrame
from pandera.typing.geopandas import GeoDataFrame
from pydantic import BaseModel as PydanticBaseModel
from pydantic import (
ConfigDict,
Expand Down Expand Up @@ -339,6 +340,8 @@ def _repr_html_(self):


class SpatialTableModel(TableModel[TableT], Generic[TableT]):
df: GeoDataFrame[TableT] | None = Field(default=None, exclude=True, repr=False)

@classmethod
def _from_db(cls, path: FilePath, table: str):
with connect(path) as connection:
Expand Down
Loading