Skip to content

Fix grid-builder for schema 229 #407

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

Merged
merged 9 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
include:
# 2022
# 2022 - 3.9
- python: 3.9
os: ubuntu-22.04
setuptools: setuptools==63.*
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_version():

install_requires = [
"numpy>=1.15,<3.0",
"threedi-schema==0.228.*",
"threedi-schema==0.229.*",
"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