Skip to content

Commit 1b8426d

Browse files
committed
revert feat
1 parent 8030810 commit 1b8426d

5 files changed

Lines changed: 5 additions & 26 deletions

File tree

src/opengeodeweb_back/geode_objects/geode_brep.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]:
8888
def items(self, id: og.uuid) -> list[og.ComponentID]:
8989
return self.brep.items(id)
9090

91-
def component_name(self, id: og.uuid) -> str:
92-
return self.brep.brep_component(id).name() or ""
93-
9491
def is_active(self, id: og.uuid) -> bool:
9592
return self.brep.brep_component(id).is_active()
9693

src/opengeodeweb_back/geode_objects/geode_model.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,5 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]: ...
3636
@abstractmethod
3737
def items(self, id: og.uuid) -> list[og.ComponentID]: ...
3838

39-
@abstractmethod
40-
def component_name(self, id: og.uuid) -> str: ...
41-
4239
@abstractmethod
4340
def is_active(self, id: og.uuid) -> bool: ...

src/opengeodeweb_back/geode_objects/geode_section.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ def internals(self, id: og.uuid) -> list[og.ComponentID]:
9090
def items(self, id: og.uuid) -> list[og.ComponentID]:
9191
return self.section.items(id)
9292

93-
def component_name(self, id: og.uuid) -> str:
94-
return self.section.section_component(id).name() or ""
95-
9693
def is_active(self, id: og.uuid) -> bool:
9794
return self.section.section_component(id).is_active()
9895

src/opengeodeweb_back/utils_functions.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ def model_components(
214214
component_type = mesh_component.get()
215215
for id in ids:
216216
geode_id = id.string()
217-
component_name = model.component_name(id)
218-
if not component_name:
219-
component_name = geode_id
217+
component_name = geode_id
220218
viewer_id = uuid_to_flat_index[geode_id]
221219
boundaries = model.boundaries(id)
222220
boundaries_uuid = [boundary.id().string() for boundary in boundaries]
@@ -225,7 +223,7 @@ def model_components(
225223
mesh_component_object = {
226224
"viewer_id": viewer_id,
227225
"geode_id": geode_id,
228-
"name": component_name,
226+
"name": geode_id,
229227
"type": component_type,
230228
"boundaries": boundaries_uuid,
231229
"internals": internals_uuid,
@@ -239,14 +237,12 @@ def model_components(
239237
component_type = collection_component.get()
240238
for id in ids:
241239
geode_id = id.string()
242-
component_name = model.component_name(id)
243-
if not component_name:
244-
component_name = geode_id
240+
component_name = geode_id
245241
items = model.items(id)
246242
items_uuid = [item.id().string() for item in items]
247243
collection_component_object = {
248244
"geode_id": geode_id,
249-
"name": component_name,
245+
"name": geode_id,
250246
"type": component_type,
251247
"items": items_uuid,
252248
"is_active": model.is_active(id),

tests/test_routes.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -431,34 +431,26 @@ def get_full_data() -> test_utils.JsonData:
431431

432432
def test_model_components(client: FlaskClient) -> None:
433433
geode_object_type = "BRep"
434-
filename = "LS2.og_brep"
434+
filename = "cube.og_brep"
435435
response = test_save_viewable_file(client, geode_object_type, filename)
436436
assert response.status_code == 200
437437
assert "mesh_components" in response.get_json()
438438
mesh_components = response.get_json()["mesh_components"]
439439
assert isinstance(mesh_components, list)
440440
assert len(mesh_components) > 0
441-
name_is_uuid = False
442-
name_is_not_uuid = False
443441
for mesh_component in mesh_components:
444442
assert isinstance(mesh_component, object)
445443
assert isinstance(mesh_component["geode_id"], str)
446444
assert isinstance(mesh_component["viewer_id"], int)
447445
assert isinstance(mesh_component["name"], str)
448446
assert isinstance(mesh_component["type"], str)
449-
if mesh_component["name"] == mesh_component["geode_id"]:
450-
name_is_uuid = True
451-
else:
452-
name_is_not_uuid = True
453447
assert isinstance(mesh_component["boundaries"], list)
454448
for boundary_uuid in mesh_component["boundaries"]:
455449
assert isinstance(boundary_uuid, str)
456450
assert isinstance(mesh_component["internals"], list)
457451
for internal_uuid in mesh_component["internals"]:
458452
assert isinstance(internal_uuid, str)
459453
assert isinstance(mesh_component["is_active"], bool)
460-
assert name_is_uuid is True
461-
assert name_is_not_uuid is True
462454
assert "collection_components" in response.get_json()
463455
collection_components = response.get_json()["collection_components"]
464456
assert isinstance(collection_components, list)

0 commit comments

Comments
 (0)