Skip to content

Commit 69e151a

Browse files
Merge pull request #75 from Geode-solutions/feat/update_inspector
Feat/update inspector
2 parents cf41940 + beb1a05 commit 69e151a

File tree

8 files changed

+167
-529
lines changed

8 files changed

+167
-529
lines changed

requirements.txt

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.9
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
55
# pip-compile requirements.in
66
#
7-
asgiref==3.7.2
7+
asgiref==3.8.1
88
# via flask
99
attrs==23.2.0
1010
# via
1111
# jsonschema
1212
# referencing
13-
blinker==1.7.0
13+
blinker==1.8.1
1414
# via flask
1515
click==8.1.7
1616
# via flask
17-
colorama==0.4.6
18-
# via click
19-
flask[async]==3.0.1
17+
flask[async]==3.0.3
2018
# via
2119
# -r requirements.in
2220
# flask-cors
2321
flask-cors==4.0.0
2422
# via -r requirements.in
25-
geode-background==7.7.1
23+
geode-background==7.9.8
2624
# via
2725
# geode-explicit
2826
# geode-implicit
2927
# geode-simplex
30-
geode-common==30.1.2
28+
geode-common==31.0.8
3129
# via
3230
# -r requirements.in
3331
# geode-background
@@ -36,40 +34,38 @@ geode-common==30.1.2
3634
# geode-numerics
3735
# geode-simplex
3836
# geode-viewables
39-
geode-conversion==5.2.1
37+
geode-conversion==5.2.8
4038
# via
4139
# geode-explicit
4240
# geode-implicit
43-
geode-explicit==4.4.3
41+
geode-explicit==4.7.5
4442
# via
4543
# -r requirements.in
4644
# geode-implicit
47-
geode-implicit==2.6.1
45+
geode-implicit==2.8.6
4846
# via -r requirements.in
49-
geode-numerics==4.3.0
47+
geode-numerics==4.3.3
5048
# via
5149
# -r requirements.in
5250
# geode-implicit
5351
# geode-simplex
54-
geode-simplex==6.5.1
52+
geode-simplex==6.7.4
5553
# via -r requirements.in
56-
geode-viewables==2.2.0
54+
geode-viewables==2.2.2
5755
# via -r requirements.in
58-
importlib-metadata==7.0.1
59-
# via flask
60-
itsdangerous==2.1.2
56+
itsdangerous==2.2.0
6157
# via flask
6258
jinja2==3.1.3
6359
# via flask
6460
jsonschema==4.21.1
6561
# via -r requirements.in
6662
jsonschema-specifications==2023.12.1
6763
# via jsonschema
68-
markupsafe==2.1.4
64+
markupsafe==2.1.5
6965
# via
7066
# jinja2
7167
# werkzeug
72-
opengeode-core==14.13.2
68+
opengeode-core==14.19.2
7369
# via
7470
# -r requirements.in
7571
# geode-background
@@ -84,40 +80,37 @@ opengeode-core==14.13.2
8480
# opengeode-geosciencesio
8581
# opengeode-inspector
8682
# opengeode-io
87-
opengeode-geosciences==7.4.0
83+
opengeode-geosciences==7.6.4
8884
# via
8985
# -r requirements.in
9086
# geode-implicit
9187
# geode-viewables
9288
# opengeode-geosciencesio
93-
opengeode-geosciencesio==4.6.0
89+
opengeode-geosciencesio==4.7.6
9490
# via
9591
# -r requirements.in
9692
# geode-implicit
97-
opengeode-inspector==4.0.6
93+
opengeode-inspector==5.1.3
9894
# via
9995
# -r requirements.in
10096
# geode-explicit
10197
# geode-implicit
102-
opengeode-io==6.4.0
98+
# geode-simplex
99+
opengeode-io==6.5.1
103100
# via
104101
# -r requirements.in
105102
# geode-implicit
106103
# geode-viewables
107104
# opengeode-geosciencesio
108-
referencing==0.33.0
105+
referencing==0.35.0
109106
# via
110107
# jsonschema
111108
# jsonschema-specifications
112-
rpds-py==0.17.1
109+
rpds-py==0.18.0
113110
# via
114111
# jsonschema
115112
# referencing
116-
typing-extensions==4.9.0
117-
# via asgiref
118-
werkzeug==3.0.1
113+
werkzeug==3.0.2
119114
# via
120115
# -r requirements.in
121116
# flask
122-
zipp==3.17.0
123-
# via importlib-metadata

src/opengeodeweb_back/geode_functions.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def is_viewable(geode_object: str):
9090
return geode_object_value(geode_object)["is_viewable"]
9191

9292

93-
def inspector(geode_object: str, data):
93+
def inspect(geode_object: str, data):
9494
return geode_object_value(geode_object)["inspector"](data)
9595

9696

@@ -174,6 +174,32 @@ def geode_objects_output_extensions(geode_object: str, data):
174174
return geode_objects_output_extensions_dict
175175

176176

177+
def get_inspector_children(obj):
178+
new_object = {}
179+
180+
if "inspection_type" in dir(obj):
181+
new_object["title"] = obj.inspection_type()
182+
new_object["nb_issues"] = 0
183+
new_object["children"] = []
184+
for child in dir(obj):
185+
if not child.startswith("__") and not child in [
186+
"inspection_type",
187+
"string",
188+
]:
189+
child_instance = obj.__getattribute__(child)
190+
child_object = get_inspector_children(child_instance)
191+
new_object["children"].append(child_object)
192+
new_object["nb_issues"] += child_object["nb_issues"]
193+
else:
194+
new_object["title"] = obj.description()
195+
nb_issues = obj.nb_issues()
196+
new_object["nb_issues"] = nb_issues
197+
if nb_issues > 0:
198+
issues = obj.string().split("\n")
199+
new_object["issues"] = issues
200+
return new_object
201+
202+
177203
def versions(list_packages: list):
178204
list_with_versions = []
179205
for package in list_packages:

src/opengeodeweb_back/geode_objects.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def geode_objects_dict():
2626
"is_3D": True,
2727
"is_viewable": True,
2828
"save_viewable": g_v.save_viewable_brep,
29-
"inspector": og_inspector.BRepInspector,
29+
"inspector": og_inspector.inspect_brep,
3030
},
3131
"CrossSection": {
3232
"parent": "Section",
@@ -47,7 +47,7 @@ def geode_objects_dict():
4747
"is_3D": False,
4848
"is_viewable": True,
4949
"save_viewable": g_v.save_viewable_cross_section,
50-
"inspector": og_inspector.SectionInspector,
50+
"inspector": og_inspector.inspect_section,
5151
},
5252
"EdgedCurve2D": {
5353
"input_factory": og.EdgedCurveInputFactory2D,
@@ -67,7 +67,7 @@ def geode_objects_dict():
6767
"is_3D": False,
6868
"is_viewable": True,
6969
"save_viewable": g_v.save_viewable_edged_curve2D,
70-
"inspector": og_inspector.EdgedCurveInspector2D,
70+
"inspector": og_inspector.inspect_edgedcurve2D,
7171
},
7272
"EdgedCurve3D": {
7373
"input_factory": og.EdgedCurveInputFactory3D,
@@ -87,7 +87,7 @@ def geode_objects_dict():
8787
"is_3D": True,
8888
"is_viewable": True,
8989
"save_viewable": g_v.save_viewable_edged_curve3D,
90-
"inspector": og_inspector.EdgedCurveInspector3D,
90+
"inspector": og_inspector.inspect_edgedcurve3D,
9191
},
9292
"Graph": {
9393
"input_factory": og.GraphInputFactory,
@@ -120,7 +120,7 @@ def geode_objects_dict():
120120
"is_3D": True,
121121
"is_viewable": True,
122122
"save_viewable": g_v.save_viewable_hybrid_solid3D,
123-
"inspector": og_inspector.SolidMeshInspector3D,
123+
"inspector": og_inspector.inspect_solid3D,
124124
},
125125
"LightRegularGrid2D": {
126126
"input_factory": og.LightRegularGridInputFactory2D,
@@ -166,7 +166,7 @@ def geode_objects_dict():
166166
"is_3D": False,
167167
"is_viewable": True,
168168
"save_viewable": g_v.save_viewable_point_set2D,
169-
"inspector": og_inspector.PointSetInspector2D,
169+
"inspector": og_inspector.inspect_pointset2D,
170170
},
171171
"PointSet3D": {
172172
"input_factory": og.PointSetInputFactory3D,
@@ -186,7 +186,7 @@ def geode_objects_dict():
186186
"is_3D": True,
187187
"is_viewable": True,
188188
"save_viewable": g_v.save_viewable_point_set3D,
189-
"inspector": og_inspector.PointSetInspector3D,
189+
"inspector": og_inspector.inspect_pointset3D,
190190
},
191191
"PolygonalSurface2D": {
192192
"input_factory": og.PolygonalSurfaceInputFactory2D,
@@ -206,7 +206,7 @@ def geode_objects_dict():
206206
"is_3D": False,
207207
"is_viewable": True,
208208
"save_viewable": g_v.save_viewable_polygonal_surface2D,
209-
"inspector": og_inspector.SurfaceMeshInspector2D,
209+
"inspector": og_inspector.inspect_surface2D,
210210
},
211211
"PolygonalSurface3D": {
212212
"input_factory": og.PolygonalSurfaceInputFactory3D,
@@ -226,7 +226,7 @@ def geode_objects_dict():
226226
"is_3D": True,
227227
"is_viewable": True,
228228
"save_viewable": g_v.save_viewable_polygonal_surface3D,
229-
"inspector": og_inspector.SurfaceMeshInspector3D,
229+
"inspector": og_inspector.inspect_surface3D,
230230
},
231231
"PolyhedralSolid3D": {
232232
"input_factory": og.PolyhedralSolidInputFactory3D,
@@ -246,7 +246,7 @@ def geode_objects_dict():
246246
"is_3D": True,
247247
"is_viewable": True,
248248
"save_viewable": g_v.save_viewable_polyhedral_solid3D,
249-
"inspector": og_inspector.SolidMeshInspector3D,
249+
"inspector": og_inspector.inspect_solid3D,
250250
},
251251
"RasterImage2D": {
252252
"input_factory": og.RasterImageInputFactory2D,
@@ -330,7 +330,7 @@ def geode_objects_dict():
330330
"is_3D": False,
331331
"is_viewable": True,
332332
"save_viewable": g_v.save_viewable_section,
333-
"inspector": og_inspector.SectionInspector,
333+
"inspector": og_inspector.inspect_section,
334334
},
335335
"StructuralModel": {
336336
"parent": "BRep",
@@ -351,7 +351,7 @@ def geode_objects_dict():
351351
"is_3D": True,
352352
"is_viewable": True,
353353
"save_viewable": g_v.save_viewable_structural_model,
354-
"inspector": og_inspector.BRepInspector,
354+
"inspector": og_inspector.inspect_brep,
355355
},
356356
"TetrahedralSolid3D": {
357357
"input_factory": og.TetrahedralSolidInputFactory3D,
@@ -371,7 +371,7 @@ def geode_objects_dict():
371371
"is_3D": True,
372372
"is_viewable": True,
373373
"save_viewable": g_v.save_viewable_tetrahedral_solid3D,
374-
"inspector": og_inspector.SolidMeshInspector3D,
374+
"inspector": og_inspector.inspect_solid3D,
375375
},
376376
"TriangulatedSurface2D": {
377377
"input_factory": og.TriangulatedSurfaceInputFactory2D,
@@ -391,7 +391,7 @@ def geode_objects_dict():
391391
"is_3D": False,
392392
"is_viewable": True,
393393
"save_viewable": g_v.save_viewable_triangulated_surface2D,
394-
"inspector": og_inspector.TriangulatedSurfaceInspector2D,
394+
"inspector": og_inspector.inspect_triangulated_surface2D,
395395
},
396396
"TriangulatedSurface3D": {
397397
"input_factory": og.TriangulatedSurfaceInputFactory3D,
@@ -411,7 +411,7 @@ def geode_objects_dict():
411411
"is_3D": True,
412412
"is_viewable": True,
413413
"save_viewable": g_v.save_viewable_triangulated_surface3D,
414-
"inspector": og_inspector.TriangulatedSurfaceInspector3D,
414+
"inspector": og_inspector.inspect_triangulated_surface3D,
415415
},
416416
"VertexSet": {
417417
"input_factory": og.VertexSetInputFactory,

0 commit comments

Comments
 (0)