From 4d41dffcae5ca48365153bb3afa94f04e5de52c2 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Wed, 2 Dec 2026 10:00:15 +0100 Subject: [PATCH 1/2] feat(model): name the block of a model component block_id Co-Authored-By: Claude Opus 5.5 --- opengeodeweb_back_schemas.json | 30 +++++++++---------- opengeodeweb_back_typed_schemas.d.ts | 2 +- .../routes/create/schemas/edged_curve.py | 2 +- .../routes/create/schemas/horizon_stack.py | 2 +- .../routes/create/schemas/point_set.py | 2 +- .../create/schemas/polygonal_surface.py | 2 +- .../routes/schemas/save_viewable_file.py | 2 +- src/opengeodeweb_back/schema_definitions.json | 12 ++++---- src/opengeodeweb_back/schema_types.d.ts | 4 +-- src/opengeodeweb_back/schema_types.json | 8 ++--- src/opengeodeweb_back/schema_types.py | 6 ++-- src/opengeodeweb_back/utils_functions.py | 4 +-- tests/test_routes.py | 2 +- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/opengeodeweb_back_schemas.json b/opengeodeweb_back_schemas.json index f58f88f0..517bed90 100644 --- a/opengeodeweb_back_schemas.json +++ b/opengeodeweb_back_schemas.json @@ -437,8 +437,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -476,7 +476,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -688,8 +688,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -727,7 +727,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -930,8 +930,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -969,7 +969,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -1194,8 +1194,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -1233,7 +1233,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -2329,8 +2329,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -2368,7 +2368,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", diff --git a/opengeodeweb_back_typed_schemas.d.ts b/opengeodeweb_back_typed_schemas.d.ts index 089425d7..ca215a88 100644 --- a/opengeodeweb_back_typed_schemas.d.ts +++ b/opengeodeweb_back_typed_schemas.d.ts @@ -2,7 +2,7 @@ import type json from "./opengeodeweb_back_schemas.json"; import type { DataId, GeodeId } from "@geode/opengeodeweb-microservice/schema_types"; -import type { AttributeInfo, AttributeName, CRS, CollectionComponent, Filename, MeshComponent, Point3D, ViewerId } from "@geode/opengeodeweb-back/schema_types"; +import type { AttributeInfo, AttributeName, BlockId, CRS, CollectionComponent, Filename, MeshComponent, Point3D } from "@geode/opengeodeweb-back/schema_types"; import type { GeodeObjectType, ViewerObjectType } from "@geode/opengeodeweb-microservice/data_types"; export interface BasemapDeleteParams { diff --git a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py index fb16e388..8dc6bdfe 100644 --- a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py +++ b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py @@ -1,5 +1,5 @@ from opengeodeweb_microservice.schema_types import DataId, GeodeId -from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, MeshComponent, Point3D from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema diff --git a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py index d446c63c..706304d5 100644 --- a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py +++ b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py @@ -1,5 +1,5 @@ from opengeodeweb_microservice.schema_types import DataId, GeodeId -from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, MeshComponent from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema diff --git a/src/opengeodeweb_back/routes/create/schemas/point_set.py b/src/opengeodeweb_back/routes/create/schemas/point_set.py index e0af2779..58144e73 100644 --- a/src/opengeodeweb_back/routes/create/schemas/point_set.py +++ b/src/opengeodeweb_back/routes/create/schemas/point_set.py @@ -1,5 +1,5 @@ from opengeodeweb_microservice.schema_types import DataId, GeodeId -from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, MeshComponent, Point3D from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema diff --git a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py index bcb9c117..fba97aa8 100644 --- a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py +++ b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py @@ -1,5 +1,5 @@ from opengeodeweb_microservice.schema_types import DataId, GeodeId -from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, MeshComponent, Point3D from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema diff --git a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py index 2db115e7..bcea892d 100644 --- a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py +++ b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py @@ -1,4 +1,4 @@ -from opengeodeweb_back.schema_types import CRS, CollectionComponent, Filename, MeshComponent, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, Filename, MeshComponent from opengeodeweb_microservice.schema_types import DataId, GeodeId from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path diff --git a/src/opengeodeweb_back/schema_definitions.json b/src/opengeodeweb_back/schema_definitions.json index 0a04f5b7..a0567aaa 100644 --- a/src/opengeodeweb_back/schema_definitions.json +++ b/src/opengeodeweb_back/schema_definitions.json @@ -32,6 +32,9 @@ "type": "string", "minLength": 1 }, + "BlockId": { + "type": "integer" + }, "CRS": { "type": "object", "properties": { @@ -216,8 +219,8 @@ "MeshComponent": { "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -255,7 +258,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -295,9 +298,6 @@ "default" ] }, - "ViewerId": { - "type": "integer" - }, "ViewerObjectType": { "type": "string", "enum": [ diff --git a/src/opengeodeweb_back/schema_types.d.ts b/src/opengeodeweb_back/schema_types.d.ts index 7cc8de14..712502dd 100644 --- a/src/opengeodeweb_back/schema_types.d.ts +++ b/src/opengeodeweb_back/schema_types.d.ts @@ -1,6 +1,6 @@ // Generated by generate_schema_types.js from schema_types.json: do not edit -export type ViewerId = number; +export type BlockId = number; export type AttributeName = string; export type Filename = string; @@ -26,13 +26,13 @@ export interface CRS { } export interface MeshComponent { + block_id: BlockId; boundaries: GeodeId[]; geode_id: GeodeId; internals: GeodeId[]; is_active: boolean; name: string; type: string; - viewer_id: ViewerId; } export interface CollectionComponent { diff --git a/src/opengeodeweb_back/schema_types.json b/src/opengeodeweb_back/schema_types.json index a9c7bc50..f59b3599 100644 --- a/src/opengeodeweb_back/schema_types.json +++ b/src/opengeodeweb_back/schema_types.json @@ -1,5 +1,5 @@ { - "ViewerId": { + "BlockId": { "type": "integer" }, "AttributeName": { @@ -83,8 +83,8 @@ "MeshComponent": { "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId" + "block_id": { + "title": "BlockId" }, "geode_id": { "title": "GeodeId" @@ -112,7 +112,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", diff --git a/src/opengeodeweb_back/schema_types.py b/src/opengeodeweb_back/schema_types.py index 8a4cce59..166b4ac9 100644 --- a/src/opengeodeweb_back/schema_types.py +++ b/src/opengeodeweb_back/schema_types.py @@ -8,7 +8,7 @@ from opengeodeweb_microservice.schema_types import GeodeId from opengeodeweb_microservice.schemas import print_dataclass -ViewerId = int +BlockId = int AttributeName = str Filename = str @@ -49,13 +49,13 @@ class MeshComponent(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) + block_id: BlockId boundaries: list[GeodeId] geode_id: GeodeId internals: list[GeodeId] is_active: bool name: str type: str - viewer_id: ViewerId @dataclass @@ -74,9 +74,9 @@ def __post_init__(self) -> None: "CRS", "AttributeInfo", "AttributeName", + "BlockId", "CollectionComponent", "Filename", "MeshComponent", "Point3D", - "ViewerId", ] diff --git a/src/opengeodeweb_back/utils_functions.py b/src/opengeodeweb_back/utils_functions.py index a63109df..3dcab544 100644 --- a/src/opengeodeweb_back/utils_functions.py +++ b/src/opengeodeweb_back/utils_functions.py @@ -265,13 +265,13 @@ def _mesh_components(model: GeodeModel, uuid_to_flat_index: dict[str, int]) -> l component_name = component.name() if not component_name: component_name = geode_id - viewer_id = uuid_to_flat_index[geode_id] + block_id = uuid_to_flat_index[geode_id] boundaries = model.boundaries(component_id) boundaries_uuid = [boundary.id.string() for boundary in boundaries] internals = model.internals(component_id) internals_uuid = [internal.id.string() for internal in internals] mesh_component_object = { - "viewer_id": viewer_id, + "block_id": block_id, "geode_id": geode_id, "name": component_name, "type": component_type, diff --git a/tests/test_routes.py b/tests/test_routes.py index 056452e3..63effb8f 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -569,7 +569,7 @@ def test_model_components(client: FlaskClient) -> None: for mesh_component in mesh_components: assert isinstance(mesh_component, dict) assert isinstance(mesh_component["geode_id"], str) - assert isinstance(mesh_component["viewer_id"], int) + assert isinstance(mesh_component["block_id"], int) assert isinstance(mesh_component["name"], str) assert isinstance(mesh_component["type"], str) assert isinstance(mesh_component["boundaries"], list) From 969f374fd4b5e0e0c5b7e61cdbb749af84c4c3bd Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Wed, 2 Dec 2026 09:05:55 +0000 Subject: [PATCH 2/2] Apply prepare changes --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 06139be9..597e5178 100644 --- a/requirements.txt +++ b/requirements.txt @@ -84,4 +84,3 @@ werkzeug==3.1.8 # flask # flask-cors -opengeodeweb-microservice==1.*,>=1.5.0