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

Fix grid-builder for schema 229 #407

Merged
merged 9 commits into from
Jan 8, 2025
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
fail-fast: false
matrix:
include:
# 2022
# 2022 - 3.9
- python: 3.9
os: ubuntu-22.04
setuptools: setuptools==63.*
numpy: numpy==1.21.*
display_name: "2022"
display_name: "2022 - python 3.9"
margrietpalm marked this conversation as resolved.
Show resolved Hide resolved
pins: "h5py==3.3.* sqlalchemy==1.4.30 shapely==2.0.* pyproj==3.2.*"
extras: "[test,gridadmin]"
# 2022
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Changelog of threedigrid-builder
1.21.4 (unreleased)
-------------------

- Nothing changed yet.
- Remove internal changes made for previous schema upgrades and limit changes to db interface


1.21.3 (2024-12-17)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def get_version():

install_requires = [
"numpy>=1.15,<3.0",
"threedi-schema==0.228.*",
"threedi-schema @ git+https://github.com/nens/threedi-schema.git@margriet_schema_300_leftovers",
# "threedi-schema==0.228.*",
"shapely>=2",
"pyproj>=3",
"condenser[geo]>=0.1.1",
Expand Down
4 changes: 2 additions & 2 deletions threedigrid_builder/grid/boundary_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ def apply(self, grid):
class BoundaryCondition2D:
id: int
type: BoundaryType
geom: shapely.Geometry
the_geom: shapely.Geometry


class BoundaryConditions2D(Array[BoundaryCondition2D]):
def get_intersecting_node_idx(
self, idx: int, cell_tree: shapely.STRtree
) -> np.ndarray:
bc_geom = self.geom[idx]
bc_geom = self.the_geom[idx]

x1, y1, x2, y2 = shapely.bounds(bc_geom)
is_horizontal = (x2 - x1) > (y2 - y1)
Expand Down
4 changes: 2 additions & 2 deletions threedigrid_builder/grid/zero_d.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class BaseSurface:
code: str
display_name: str
area: float
geom: shapely.Geometry
the_geom: shapely.Geometry

connection_node_id: int
connection_node_the_geom: shapely.Geometry
Expand Down Expand Up @@ -267,7 +267,7 @@ def as_grid_surfaces(
if extra_fields is None:
extra_fields = {}

centroids = shapely.centroid(self.geom)
centroids = shapely.centroid(self.the_geom)
no_centroid_mask = shapely.is_missing(centroids)

if np.any(no_centroid_mask):
Expand Down
Loading
Loading