From e9ca763d708a5fb97d69a69ab67b3f7e97d0bad7 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Fri, 20 Mar 2026 12:12:23 +0100 Subject: [PATCH 1/8] feat(isActive): adds is_active mesh_components objects --- requirements.in | 4 ++-- requirements.txt | 4 ++-- src/opengeodeweb_back/geode_objects/geode_brep.py | 3 +++ src/opengeodeweb_back/geode_objects/geode_model.py | 3 +++ src/opengeodeweb_back/geode_objects/geode_section.py | 3 +++ src/opengeodeweb_back/utils_functions.py | 2 ++ tests/test_routes.py | 2 ++ 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/requirements.in b/requirements.in index 5846c313..96a88f06 100644 --- a/requirements.in +++ b/requirements.in @@ -1,7 +1,7 @@ -opengeode-core==16.2.0 +opengeode-core==16.3.1-rc.2 opengeode-io==7.4.9 opengeode-inspector==6.8.18 -opengeode-geosciences==9.5.10 +opengeode-geosciences==9.5.11 opengeode-geosciencesio==5.8.11 geode-common==33.19.1 geode-viewables==3.3.5 diff --git a/requirements.txt b/requirements.txt index e18b73d9..d721788a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,7 +31,7 @@ markupsafe>=3 # flask # jinja2 # werkzeug -opengeode-core==16.2.0 +opengeode-core==16.3.1-rc.2 # via # -r requirements.in # geode-common @@ -40,7 +40,7 @@ opengeode-core==16.2.0 # opengeode-geosciencesio # opengeode-inspector # opengeode-io -opengeode-geosciences==9.5.10 +opengeode-geosciences==9.5.11 # via # -r requirements.in # geode-viewables diff --git a/src/opengeodeweb_back/geode_objects/geode_brep.py b/src/opengeodeweb_back/geode_objects/geode_brep.py index f5cfd5f4..a1408c1f 100644 --- a/src/opengeodeweb_back/geode_objects/geode_brep.py +++ b/src/opengeodeweb_back/geode_objects/geode_brep.py @@ -91,6 +91,9 @@ def items(self, id: og.uuid) -> list[og.ComponentID]: def component_name(self, id: og.uuid) -> str: return self.brep.brep_component(id).name() or "" + def is_active(self, id: og.uuid) -> bool: + return self.brep.brep_component(id).is_active() + def inspect(self) -> og_inspector.BRepInspectionResult: return og_inspector.inspect_brep(self.brep) diff --git a/src/opengeodeweb_back/geode_objects/geode_model.py b/src/opengeodeweb_back/geode_objects/geode_model.py index 70d02feb..9e086ac4 100644 --- a/src/opengeodeweb_back/geode_objects/geode_model.py +++ b/src/opengeodeweb_back/geode_objects/geode_model.py @@ -38,3 +38,6 @@ def items(self, id: og.uuid) -> list[og.ComponentID]: ... @abstractmethod def component_name(self, id: og.uuid) -> str: ... + + @abstractmethod + def is_active(self, id: og.uuid) -> bool: ... diff --git a/src/opengeodeweb_back/geode_objects/geode_section.py b/src/opengeodeweb_back/geode_objects/geode_section.py index 12b16ee0..b03c926c 100644 --- a/src/opengeodeweb_back/geode_objects/geode_section.py +++ b/src/opengeodeweb_back/geode_objects/geode_section.py @@ -93,6 +93,9 @@ def items(self, id: og.uuid) -> list[og.ComponentID]: def component_name(self, id: og.uuid) -> str: return self.section.section_component(id).name() or "" + def is_active(self, id: og.uuid) -> bool: + return self.section.section_component(id).is_active() + def inspect(self) -> og_inspector.SectionInspectionResult: return og_inspector.inspect_section(self.section) diff --git a/src/opengeodeweb_back/utils_functions.py b/src/opengeodeweb_back/utils_functions.py index bf11ad11..669fc8c0 100644 --- a/src/opengeodeweb_back/utils_functions.py +++ b/src/opengeodeweb_back/utils_functions.py @@ -229,6 +229,7 @@ def model_components( "type": component_type, "boundaries": boundaries_uuid, "internals": internals_uuid, + "is_active": model.is_active(id), } mesh_components.append(mesh_component_object) @@ -248,6 +249,7 @@ def model_components( "name": component_name, "type": component_type, "items": items_uuid, + "is_active": model.is_active(id), } collection_components.append(collection_component_object) return { diff --git a/tests/test_routes.py b/tests/test_routes.py index 215afd13..4b833ff5 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -456,6 +456,7 @@ def test_model_components(client: FlaskClient) -> None: assert isinstance(mesh_component["internals"], list) for internal_uuid in mesh_component["internals"]: assert isinstance(internal_uuid, str) + assert isinstance(mesh_component["is_active"], bool) assert name_is_uuid is True assert name_is_not_uuid is True assert "collection_components" in response.get_json() @@ -468,6 +469,7 @@ def test_model_components(client: FlaskClient) -> None: assert isinstance(collection_component["items"], list) for item_uuid in collection_component["items"]: assert isinstance(item_uuid, str) + assert isinstance(collection_component["is_active"], bool) def test_export_project_route(client: FlaskClient, tmp_path: Path) -> None: From fe0fe602da9eb0a0d1c55735a941657b116a7ea7 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Mon, 23 Mar 2026 08:49:30 +0000 Subject: [PATCH 2/8] Apply prepare changes --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d721788a..fcf41028 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,7 +31,7 @@ markupsafe>=3 # flask # jinja2 # werkzeug -opengeode-core==16.3.1-rc.2 +opengeode-core==16.3.1rc2 # via # -r requirements.in # geode-common From 35266fd7b1b6a2f7062fed6fd28a5450ad588cc6 Mon Sep 17 00:00:00 2001 From: MaxNumerique <144453705+MaxNumerique@users.noreply.github.com> Date: Mon, 23 Mar 2026 12:46:22 +0000 Subject: [PATCH 3/8] Apply prepare changes --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d963169b..fcf41028 100644 --- a/requirements.txt +++ b/requirements.txt @@ -60,4 +60,3 @@ werkzeug==3.1.2 # flask # flask-cors -opengeodeweb-microservice==1.*,>=1.1.1 From 1b8426d8fd82b1190ef2e187e16318c807d4ec11 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 23 Mar 2026 13:57:44 +0100 Subject: [PATCH 4/8] revert feat --- src/opengeodeweb_back/geode_objects/geode_brep.py | 3 --- src/opengeodeweb_back/geode_objects/geode_model.py | 3 --- src/opengeodeweb_back/geode_objects/geode_section.py | 3 --- src/opengeodeweb_back/utils_functions.py | 12 ++++-------- tests/test_routes.py | 10 +--------- 5 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/opengeodeweb_back/geode_objects/geode_brep.py b/src/opengeodeweb_back/geode_objects/geode_brep.py index a1408c1f..d984ab07 100644 --- a/src/opengeodeweb_back/geode_objects/geode_brep.py +++ b/src/opengeodeweb_back/geode_objects/geode_brep.py @@ -88,9 +88,6 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: def items(self, id: og.uuid) -> list[og.ComponentID]: return self.brep.items(id) - def component_name(self, id: og.uuid) -> str: - return self.brep.brep_component(id).name() or "" - def is_active(self, id: og.uuid) -> bool: return self.brep.brep_component(id).is_active() diff --git a/src/opengeodeweb_back/geode_objects/geode_model.py b/src/opengeodeweb_back/geode_objects/geode_model.py index 9e086ac4..ab554f5e 100644 --- a/src/opengeodeweb_back/geode_objects/geode_model.py +++ b/src/opengeodeweb_back/geode_objects/geode_model.py @@ -36,8 +36,5 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: ... @abstractmethod def items(self, id: og.uuid) -> list[og.ComponentID]: ... - @abstractmethod - def component_name(self, id: og.uuid) -> str: ... - @abstractmethod def is_active(self, id: og.uuid) -> bool: ... diff --git a/src/opengeodeweb_back/geode_objects/geode_section.py b/src/opengeodeweb_back/geode_objects/geode_section.py index b03c926c..7119be01 100644 --- a/src/opengeodeweb_back/geode_objects/geode_section.py +++ b/src/opengeodeweb_back/geode_objects/geode_section.py @@ -90,9 +90,6 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: def items(self, id: og.uuid) -> list[og.ComponentID]: return self.section.items(id) - def component_name(self, id: og.uuid) -> str: - return self.section.section_component(id).name() or "" - def is_active(self, id: og.uuid) -> bool: return self.section.section_component(id).is_active() diff --git a/src/opengeodeweb_back/utils_functions.py b/src/opengeodeweb_back/utils_functions.py index 669fc8c0..b6510820 100644 --- a/src/opengeodeweb_back/utils_functions.py +++ b/src/opengeodeweb_back/utils_functions.py @@ -214,9 +214,7 @@ def model_components( component_type = mesh_component.get() for id in ids: geode_id = id.string() - component_name = model.component_name(id) - if not component_name: - component_name = geode_id + component_name = geode_id viewer_id = uuid_to_flat_index[geode_id] boundaries = model.boundaries(id) boundaries_uuid = [boundary.id().string() for boundary in boundaries] @@ -225,7 +223,7 @@ def model_components( mesh_component_object = { "viewer_id": viewer_id, "geode_id": geode_id, - "name": component_name, + "name": geode_id, "type": component_type, "boundaries": boundaries_uuid, "internals": internals_uuid, @@ -239,14 +237,12 @@ def model_components( component_type = collection_component.get() for id in ids: geode_id = id.string() - component_name = model.component_name(id) - if not component_name: - component_name = geode_id + component_name = geode_id items = model.items(id) items_uuid = [item.id().string() for item in items] collection_component_object = { "geode_id": geode_id, - "name": component_name, + "name": geode_id, "type": component_type, "items": items_uuid, "is_active": model.is_active(id), diff --git a/tests/test_routes.py b/tests/test_routes.py index 4b833ff5..530b298a 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -431,25 +431,19 @@ def get_full_data() -> test_utils.JsonData: def test_model_components(client: FlaskClient) -> None: geode_object_type = "BRep" - filename = "LS2.og_brep" + filename = "cube.og_brep" response = test_save_viewable_file(client, geode_object_type, filename) assert response.status_code == 200 assert "mesh_components" in response.get_json() mesh_components = response.get_json()["mesh_components"] assert isinstance(mesh_components, list) assert len(mesh_components) > 0 - name_is_uuid = False - name_is_not_uuid = False for mesh_component in mesh_components: assert isinstance(mesh_component, object) assert isinstance(mesh_component["geode_id"], str) assert isinstance(mesh_component["viewer_id"], int) assert isinstance(mesh_component["name"], str) assert isinstance(mesh_component["type"], str) - if mesh_component["name"] == mesh_component["geode_id"]: - name_is_uuid = True - else: - name_is_not_uuid = True assert isinstance(mesh_component["boundaries"], list) for boundary_uuid in mesh_component["boundaries"]: assert isinstance(boundary_uuid, str) @@ -457,8 +451,6 @@ def test_model_components(client: FlaskClient) -> None: for internal_uuid in mesh_component["internals"]: assert isinstance(internal_uuid, str) assert isinstance(mesh_component["is_active"], bool) - assert name_is_uuid is True - assert name_is_not_uuid is True assert "collection_components" in response.get_json() collection_components = response.get_json()["collection_components"] assert isinstance(collection_components, list) From e8e46f239a9c287f91e18008bd32629743b1cdf8 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 23 Mar 2026 14:04:17 +0100 Subject: [PATCH 5/8] revert some --- requirements.in | 2 +- requirements.txt | 2 +- src/opengeodeweb_back/utils_functions.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/requirements.in b/requirements.in index 96a88f06..eb6f0f33 100644 --- a/requirements.in +++ b/requirements.in @@ -3,7 +3,7 @@ opengeode-io==7.4.9 opengeode-inspector==6.8.18 opengeode-geosciences==9.5.11 opengeode-geosciencesio==5.8.11 -geode-common==33.19.1 +geode-common==33.20.0 geode-viewables==3.3.5 flask[async]==3.1.2 flask-cors==6.0.1 diff --git a/requirements.txt b/requirements.txt index fcf41028..eaaae7c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ flask[async]>=3 # flask-cors flask-cors==6.0.1 # via -r requirements.in -geode-common==33.19.1 +geode-common==33.20.0 # via # -r requirements.in # geode-viewables diff --git a/src/opengeodeweb_back/utils_functions.py b/src/opengeodeweb_back/utils_functions.py index b6510820..aae024f1 100644 --- a/src/opengeodeweb_back/utils_functions.py +++ b/src/opengeodeweb_back/utils_functions.py @@ -223,7 +223,7 @@ def model_components( mesh_component_object = { "viewer_id": viewer_id, "geode_id": geode_id, - "name": geode_id, + "name": component_name, "type": component_type, "boundaries": boundaries_uuid, "internals": internals_uuid, @@ -237,7 +237,6 @@ def model_components( component_type = collection_component.get() for id in ids: geode_id = id.string() - component_name = geode_id items = model.items(id) items_uuid = [item.id().string() for item in items] collection_component_object = { From 57afda8b30e1ee2d3654fd20c0f11a57bd0bf513 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 23 Mar 2026 14:32:26 +0100 Subject: [PATCH 6/8] pull from next --- src/opengeodeweb_back/geode_objects/geode_brep.py | 6 +++--- src/opengeodeweb_back/geode_objects/geode_model.py | 3 +++ src/opengeodeweb_back/geode_objects/geode_section.py | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/opengeodeweb_back/geode_objects/geode_brep.py b/src/opengeodeweb_back/geode_objects/geode_brep.py index 2c89bf43..c1e0f6c5 100644 --- a/src/opengeodeweb_back/geode_objects/geode_brep.py +++ b/src/opengeodeweb_back/geode_objects/geode_brep.py @@ -88,12 +88,12 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: def items(self, id: og.uuid) -> list[og.ComponentID]: return self.brep.items(id) - def is_active(self, id: og.uuid) -> bool: - return self.brep.brep_component(id).is_active() - def component_name(self, id: og.uuid) -> str | None: return self.brep.brep_component(id).name() + def is_active(self, id: og.uuid) -> bool: + return self.brep.brep_component(id).is_active() + def inspect(self) -> og_inspector.BRepInspectionResult: return og_inspector.inspect_brep(self.brep) diff --git a/src/opengeodeweb_back/geode_objects/geode_model.py b/src/opengeodeweb_back/geode_objects/geode_model.py index ab554f5e..85935780 100644 --- a/src/opengeodeweb_back/geode_objects/geode_model.py +++ b/src/opengeodeweb_back/geode_objects/geode_model.py @@ -36,5 +36,8 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: ... @abstractmethod def items(self, id: og.uuid) -> list[og.ComponentID]: ... + @abstractmethod + def component_name(self, id: og.uuid) -> str | None: ... + @abstractmethod def is_active(self, id: og.uuid) -> bool: ... diff --git a/src/opengeodeweb_back/geode_objects/geode_section.py b/src/opengeodeweb_back/geode_objects/geode_section.py index a2f26b78..133bd003 100644 --- a/src/opengeodeweb_back/geode_objects/geode_section.py +++ b/src/opengeodeweb_back/geode_objects/geode_section.py @@ -93,6 +93,9 @@ def items(self, id: og.uuid) -> list[og.ComponentID]: def component_name(self, id: og.uuid) -> str | None: return self.section.section_component(id).name() + def is_active(self, id: og.uuid) -> bool: + return self.section.section_component(id).is_active() + def inspect(self) -> og_inspector.SectionInspectionResult: return og_inspector.inspect_section(self.section) From dc7485e7e92468c64ecaab14a86aefc08bc8ae69 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 23 Mar 2026 16:11:04 +0100 Subject: [PATCH 7/8] from next --- src/opengeodeweb_back/utils_functions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/opengeodeweb_back/utils_functions.py b/src/opengeodeweb_back/utils_functions.py index aae024f1..669fc8c0 100644 --- a/src/opengeodeweb_back/utils_functions.py +++ b/src/opengeodeweb_back/utils_functions.py @@ -214,7 +214,9 @@ def model_components( component_type = mesh_component.get() for id in ids: geode_id = id.string() - component_name = geode_id + component_name = model.component_name(id) + if not component_name: + component_name = geode_id viewer_id = uuid_to_flat_index[geode_id] boundaries = model.boundaries(id) boundaries_uuid = [boundary.id().string() for boundary in boundaries] @@ -237,11 +239,14 @@ def model_components( component_type = collection_component.get() for id in ids: geode_id = id.string() + component_name = model.component_name(id) + if not component_name: + component_name = geode_id items = model.items(id) items_uuid = [item.id().string() for item in items] collection_component_object = { "geode_id": geode_id, - "name": geode_id, + "name": component_name, "type": component_type, "items": items_uuid, "is_active": model.is_active(id), From b1f4b855e276b0dd172240efb357d1de7c476800 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 23 Mar 2026 16:39:37 +0100 Subject: [PATCH 8/8] refacto geode_objects classes for model_components --- src/opengeodeweb_back/geode_objects/geode_brep.py | 7 ++----- src/opengeodeweb_back/geode_objects/geode_model.py | 6 ++---- src/opengeodeweb_back/geode_objects/geode_section.py | 7 ++----- src/opengeodeweb_back/utils_functions.py | 10 ++++++---- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/opengeodeweb_back/geode_objects/geode_brep.py b/src/opengeodeweb_back/geode_objects/geode_brep.py index c1e0f6c5..98b2b481 100644 --- a/src/opengeodeweb_back/geode_objects/geode_brep.py +++ b/src/opengeodeweb_back/geode_objects/geode_brep.py @@ -88,11 +88,8 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: def items(self, id: og.uuid) -> list[og.ComponentID]: return self.brep.items(id) - def component_name(self, id: og.uuid) -> str | None: - return self.brep.brep_component(id).name() - - def is_active(self, id: og.uuid) -> bool: - return self.brep.brep_component(id).is_active() + def component(self, id: og.uuid) -> og.Component3D: + return self.brep.brep_component(id) def inspect(self) -> og_inspector.BRepInspectionResult: return og_inspector.inspect_brep(self.brep) diff --git a/src/opengeodeweb_back/geode_objects/geode_model.py b/src/opengeodeweb_back/geode_objects/geode_model.py index 85935780..3aafd671 100644 --- a/src/opengeodeweb_back/geode_objects/geode_model.py +++ b/src/opengeodeweb_back/geode_objects/geode_model.py @@ -1,6 +1,7 @@ # Standard library imports from __future__ import annotations from abc import abstractmethod +from typing import Union # Third party imports import opengeode as og @@ -37,7 +38,4 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: ... def items(self, id: og.uuid) -> list[og.ComponentID]: ... @abstractmethod - def component_name(self, id: og.uuid) -> str | None: ... - - @abstractmethod - def is_active(self, id: og.uuid) -> bool: ... + def component(self, id: og.uuid) -> og.Component2D | og.Component3D: ... diff --git a/src/opengeodeweb_back/geode_objects/geode_section.py b/src/opengeodeweb_back/geode_objects/geode_section.py index 133bd003..d8155395 100644 --- a/src/opengeodeweb_back/geode_objects/geode_section.py +++ b/src/opengeodeweb_back/geode_objects/geode_section.py @@ -90,11 +90,8 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: def items(self, id: og.uuid) -> list[og.ComponentID]: return self.section.items(id) - def component_name(self, id: og.uuid) -> str | None: - return self.section.section_component(id).name() - - def is_active(self, id: og.uuid) -> bool: - return self.section.section_component(id).is_active() + def component(self, id: og.uuid) -> og.Component2D: + return self.section.section_component(id) def inspect(self) -> og_inspector.SectionInspectionResult: return og_inspector.inspect_section(self.section) diff --git a/src/opengeodeweb_back/utils_functions.py b/src/opengeodeweb_back/utils_functions.py index 669fc8c0..6df55ca3 100644 --- a/src/opengeodeweb_back/utils_functions.py +++ b/src/opengeodeweb_back/utils_functions.py @@ -213,8 +213,9 @@ def model_components( for mesh_component, ids in model_mesh_components.items(): component_type = mesh_component.get() for id in ids: + component = model.component(id) geode_id = id.string() - component_name = model.component_name(id) + component_name = component.name() if not component_name: component_name = geode_id viewer_id = uuid_to_flat_index[geode_id] @@ -229,7 +230,7 @@ def model_components( "type": component_type, "boundaries": boundaries_uuid, "internals": internals_uuid, - "is_active": model.is_active(id), + "is_active": component.is_active(), } mesh_components.append(mesh_component_object) @@ -238,8 +239,9 @@ def model_components( for collection_component, ids in model_collection_components.items(): component_type = collection_component.get() for id in ids: + component = model.component(id) geode_id = id.string() - component_name = model.component_name(id) + component_name = component.name() if not component_name: component_name = geode_id items = model.items(id) @@ -249,7 +251,7 @@ def model_components( "name": component_name, "type": component_type, "items": items_uuid, - "is_active": model.is_active(id), + "is_active": component.is_active(), } collection_components.append(collection_component_object) return {