OpenGeodeWeb-Back 5.3.2rc1__py3-none-any.whl → 5.4.0rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {OpenGeodeWeb_Back-5.3.2rc1.dist-info → OpenGeodeWeb_Back-5.4.0rc2.dist-info}/METADATA +29 -29
- {OpenGeodeWeb_Back-5.3.2rc1.dist-info → OpenGeodeWeb_Back-5.4.0rc2.dist-info}/RECORD +12 -8
- {OpenGeodeWeb_Back-5.3.2rc1.dist-info → OpenGeodeWeb_Back-5.4.0rc2.dist-info}/WHEEL +1 -1
- opengeodeweb_back/geode_functions.py +4 -0
- opengeodeweb_back/geode_objects.py +30 -0
- opengeodeweb_back/routes/blueprint_routes.py +97 -2
- opengeodeweb_back/routes/schemas/create_point.json +24 -0
- opengeodeweb_back/routes/schemas/polygon_attribute_names.json +15 -0
- opengeodeweb_back/routes/schemas/vertex_attribute_names.json +15 -0
- opengeodeweb_back/test_utils.py +25 -0
- {OpenGeodeWeb_Back-5.3.2rc1.dist-info → OpenGeodeWeb_Back-5.4.0rc2.dist-info}/LICENSE +0 -0
- {OpenGeodeWeb_Back-5.3.2rc1.dist-info → OpenGeodeWeb_Back-5.4.0rc2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: OpenGeodeWeb-Back
|
3
|
-
Version: 5.
|
3
|
+
Version: 5.4.0rc2
|
4
4
|
Summary: OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem
|
5
5
|
Author-email: Geode-solutions <team-web@geode-solutions.com>
|
6
6
|
Project-URL: Homepage, https://github.com/Geode-solutions/OpenGeodeWeb-Back
|
@@ -11,34 +11,34 @@ Classifier: Operating System :: OS Independent
|
|
11
11
|
Requires-Python: >=3.8
|
12
12
|
Description-Content-Type: text/markdown
|
13
13
|
License-File: LICENSE
|
14
|
-
Requires-Dist: asgiref
|
15
|
-
Requires-Dist: attrs
|
16
|
-
Requires-Dist: blinker
|
17
|
-
Requires-Dist: click
|
18
|
-
Requires-Dist: flask[async]
|
19
|
-
Requires-Dist: flask-cors
|
20
|
-
Requires-Dist: geode-background
|
21
|
-
Requires-Dist: geode-common
|
22
|
-
Requires-Dist: geode-conversion
|
23
|
-
Requires-Dist: geode-explicit
|
24
|
-
Requires-Dist: geode-implicit
|
25
|
-
Requires-Dist: geode-numerics
|
26
|
-
Requires-Dist: geode-simplex
|
27
|
-
Requires-Dist: geode-viewables
|
28
|
-
Requires-Dist: itsdangerous
|
29
|
-
Requires-Dist: jinja2
|
30
|
-
Requires-Dist: jsonschema
|
31
|
-
Requires-Dist: jsonschema-specifications
|
32
|
-
Requires-Dist: markupsafe
|
33
|
-
Requires-Dist: opengeode-core
|
34
|
-
Requires-Dist: opengeode-geosciences
|
35
|
-
Requires-Dist: opengeode-geosciencesio
|
36
|
-
Requires-Dist: opengeode-inspector
|
37
|
-
Requires-Dist: opengeode-io
|
38
|
-
Requires-Dist: referencing
|
39
|
-
Requires-Dist: rpds-py
|
40
|
-
Requires-Dist: typing-extensions
|
41
|
-
Requires-Dist: werkzeug
|
14
|
+
Requires-Dist: asgiref==3.8.1
|
15
|
+
Requires-Dist: attrs==24.2.0
|
16
|
+
Requires-Dist: blinker==1.9.0
|
17
|
+
Requires-Dist: click==8.1.7
|
18
|
+
Requires-Dist: flask[async]==3.1.0
|
19
|
+
Requires-Dist: flask-cors==5.0.0
|
20
|
+
Requires-Dist: geode-background==8.7.5
|
21
|
+
Requires-Dist: geode-common==33.1.3
|
22
|
+
Requires-Dist: geode-conversion==6.0.18
|
23
|
+
Requires-Dist: geode-explicit==6.1.17
|
24
|
+
Requires-Dist: geode-implicit==3.3.5
|
25
|
+
Requires-Dist: geode-numerics==5.2.0
|
26
|
+
Requires-Dist: geode-simplex==8.2.18
|
27
|
+
Requires-Dist: geode-viewables==3.0.8
|
28
|
+
Requires-Dist: itsdangerous==2.2.0
|
29
|
+
Requires-Dist: jinja2==3.1.4
|
30
|
+
Requires-Dist: jsonschema==4.23.0
|
31
|
+
Requires-Dist: jsonschema-specifications==2024.10.1
|
32
|
+
Requires-Dist: markupsafe==3.0.2
|
33
|
+
Requires-Dist: opengeode-core==15.6.7
|
34
|
+
Requires-Dist: opengeode-geosciences==8.2.0
|
35
|
+
Requires-Dist: opengeode-geosciencesio==5.3.2
|
36
|
+
Requires-Dist: opengeode-inspector==6.1.15
|
37
|
+
Requires-Dist: opengeode-io==7.0.7
|
38
|
+
Requires-Dist: referencing==0.35.1
|
39
|
+
Requires-Dist: rpds-py==0.21.0
|
40
|
+
Requires-Dist: typing-extensions==4.12.2
|
41
|
+
Requires-Dist: werkzeug==3.1.3
|
42
42
|
|
43
43
|
<h1 align="center">OpenGeodeWeb-Back<sup><i>by Geode-solutions</i></sup></h1>
|
44
44
|
<h3 align="center">OpenSource Python framework based on OpenGeode</h3>
|
@@ -1,20 +1,24 @@
|
|
1
1
|
opengeodeweb_back/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
opengeodeweb_back/app_config.py,sha256=bZIs0giTA0cYJJYbt25ZHYlHdsOy82h5xSxdOitgR4A,752
|
3
|
-
opengeodeweb_back/geode_functions.py,sha256=
|
4
|
-
opengeodeweb_back/geode_objects.py,sha256=
|
3
|
+
opengeodeweb_back/geode_functions.py,sha256=c6mgFoTxL4v2DeeqnZU2aBdEQcUCuOoBawnjLrIcm_s,8814
|
4
|
+
opengeodeweb_back/geode_objects.py,sha256=CIZFu6cwlTW22xCs81KXzYz3aq9iv5X2KrwMGodF-HA,23546
|
5
|
+
opengeodeweb_back/test_utils.py,sha256=gvRPOzin4nI5TKuB-AFgIxcekTOYM4h7yUYk0tYIZFI,820
|
5
6
|
opengeodeweb_back/utils_functions.py,sha256=18kp8M3bnrlu692qj-ymJJPA1hTpPjx_xl9oVi5qGyg,4120
|
6
|
-
opengeodeweb_back/routes/blueprint_routes.py,sha256=
|
7
|
+
opengeodeweb_back/routes/blueprint_routes.py,sha256=DC1B634IgqpDzUvEqdz_H-uAkvme45amgJmCNPyP-90,11452
|
7
8
|
opengeodeweb_back/routes/schemas/allowed_files.json,sha256=pRsGf39LiJpl3zEGLg4IqvRtm7iUx3Wq4Tb4tSFXGV0,234
|
8
9
|
opengeodeweb_back/routes/schemas/allowed_objects.json,sha256=8JLtAI46eXeiJuiryS2geRVv0J1rGkFb87pRwtBZSZw,296
|
10
|
+
opengeodeweb_back/routes/schemas/create_point.json,sha256=fqBOLRxpRtCVz1t7ottdfhSMREhqNFUHrQwamn-F7Ds,306
|
9
11
|
opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json,sha256=0t4YhdKxDlzcLh85JU85z6Pn5h8wlXVt3Zi4ZhXXmTQ,308
|
10
12
|
opengeodeweb_back/routes/schemas/geographic_coordinate_systems.json,sha256=86QEBxAJXdMHulj2SyrxvAAwvyUq3mpKSazwASukeoM,242
|
11
13
|
opengeodeweb_back/routes/schemas/inspect_file.json,sha256=7jmmLD2oZ2dxn5-2HqS6fU92eGM3FWBQdj3CjyYmGOA,285
|
12
14
|
opengeodeweb_back/routes/schemas/missing_files.json,sha256=tJVdSM3CqYFZRC6eNW6Q3JG3RtoaZDxaZtbfx6djbX0,286
|
13
15
|
opengeodeweb_back/routes/schemas/ping.json,sha256=MhI5jtrjMsAsfIKEzdY8p1HyV9xv4O3hYfESWw6tkyE,162
|
16
|
+
opengeodeweb_back/routes/schemas/polygon_attribute_names.json,sha256=y0qDZ0v3zkzYuM-9jfBXU0aTUnWz2w0gXqes9Xs7PgE,296
|
14
17
|
opengeodeweb_back/routes/schemas/save_viewable_file.json,sha256=7BXO8vsQrmqyEQ2uycm2Ift_EY7a0KocvnGEjYrQFcQ,368
|
15
18
|
opengeodeweb_back/routes/schemas/upload_file.json,sha256=sE6bxz3mJbSZlGmrnR_hZmcx0dvZGn3Wpnn6szRPxXQ,186
|
16
|
-
|
17
|
-
OpenGeodeWeb_Back-5.
|
18
|
-
OpenGeodeWeb_Back-5.
|
19
|
-
OpenGeodeWeb_Back-5.
|
20
|
-
OpenGeodeWeb_Back-5.
|
19
|
+
opengeodeweb_back/routes/schemas/vertex_attribute_names.json,sha256=wijww9z7vVUIr1_3hMnR5efpMfW2-o2-QvcO_MVDefE,295
|
20
|
+
OpenGeodeWeb_Back-5.4.0rc2.dist-info/LICENSE,sha256=LoTB-aqQvzTGxoTRXNnhNV0LKiqdk2bQv6MB34l8zkI,1079
|
21
|
+
OpenGeodeWeb_Back-5.4.0rc2.dist-info/METADATA,sha256=MYSQ49DSPWxT8vsApEt24Xo6Ozi4s95Gg-rhizjBFfs,3059
|
22
|
+
OpenGeodeWeb_Back-5.4.0rc2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
23
|
+
OpenGeodeWeb_Back-5.4.0rc2.dist-info/top_level.txt,sha256=tN1FZeLIVBrdja2-pbmhg5-tK-JILmmT9OeIBnhlUrQ,18
|
24
|
+
OpenGeodeWeb_Back-5.4.0rc2.dist-info/RECORD,,
|
@@ -15,6 +15,10 @@ def geode_object_value(geode_object: str):
|
|
15
15
|
return geode_objects_dict()[geode_object]
|
16
16
|
|
17
17
|
|
18
|
+
def geode_object_class(geode_object: str):
|
19
|
+
return geode_object_value(geode_object)["class"]
|
20
|
+
|
21
|
+
|
18
22
|
def input_factory(geode_object: str):
|
19
23
|
return geode_object_value(geode_object)["input_factory"]
|
20
24
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# Standard library imports
|
2
|
+
|
3
|
+
# Third party imports
|
1
4
|
import opengeode as og
|
2
5
|
import opengeode_io as og_io
|
3
6
|
import opengeode_inspector as og_inspector
|
@@ -5,10 +8,13 @@ import opengeode_geosciences as og_gs
|
|
5
8
|
import opengeode_geosciencesio as og_gs_io
|
6
9
|
import geode_viewables as g_v
|
7
10
|
|
11
|
+
# Local application imports
|
12
|
+
|
8
13
|
|
9
14
|
def geode_objects_dict():
|
10
15
|
return {
|
11
16
|
"BRep": {
|
17
|
+
"class": og.BRep,
|
12
18
|
"input_factory": og.BRepInputFactory,
|
13
19
|
"output_factory": og.BRepOutputFactory,
|
14
20
|
"missing_files": og.check_brep_missing_files,
|
@@ -30,6 +36,7 @@ def geode_objects_dict():
|
|
30
36
|
},
|
31
37
|
"CrossSection": {
|
32
38
|
"parent": "Section",
|
39
|
+
"class": og_gs.CrossSection,
|
33
40
|
"input_factory": og_gs.CrossSectionInputFactory,
|
34
41
|
"output_factory": og_gs.CrossSectionOutputFactory,
|
35
42
|
"missing_files": og_gs.check_cross_section_missing_files,
|
@@ -50,6 +57,7 @@ def geode_objects_dict():
|
|
50
57
|
"inspector": og_inspector.inspect_section,
|
51
58
|
},
|
52
59
|
"EdgedCurve2D": {
|
60
|
+
"class": og.EdgedCurve2D,
|
53
61
|
"input_factory": og.EdgedCurveInputFactory2D,
|
54
62
|
"output_factory": og.EdgedCurveOutputFactory2D,
|
55
63
|
"missing_files": og.check_edged_curve_missing_files2D,
|
@@ -70,6 +78,7 @@ def geode_objects_dict():
|
|
70
78
|
"inspector": og_inspector.inspect_edged_curve2D,
|
71
79
|
},
|
72
80
|
"EdgedCurve3D": {
|
81
|
+
"class": og.EdgedCurve3D,
|
73
82
|
"input_factory": og.EdgedCurveInputFactory3D,
|
74
83
|
"output_factory": og.EdgedCurveOutputFactory3D,
|
75
84
|
"missing_files": og.check_edged_curve_missing_files3D,
|
@@ -90,6 +99,7 @@ def geode_objects_dict():
|
|
90
99
|
"inspector": og_inspector.inspect_edged_curve3D,
|
91
100
|
},
|
92
101
|
"Graph": {
|
102
|
+
"class": og.Graph,
|
93
103
|
"input_factory": og.GraphInputFactory,
|
94
104
|
"output_factory": og.GraphOutputFactory,
|
95
105
|
"missing_files": og.check_graph_missing_files,
|
@@ -103,6 +113,7 @@ def geode_objects_dict():
|
|
103
113
|
"is_viewable": True,
|
104
114
|
},
|
105
115
|
"HybridSolid3D": {
|
116
|
+
"class": og.HybridSolid3D,
|
106
117
|
"input_factory": og.HybridSolidInputFactory3D,
|
107
118
|
"output_factory": og.HybridSolidOutputFactory3D,
|
108
119
|
"missing_files": og.check_hybrid_solid_missing_files3D,
|
@@ -124,6 +135,7 @@ def geode_objects_dict():
|
|
124
135
|
},
|
125
136
|
"ImplicitCrossSection": {
|
126
137
|
"parent": "CrossSection",
|
138
|
+
"class": og_gs.ImplicitCrossSection,
|
127
139
|
"input_factory": og_gs.ImplicitCrossSectionInputFactory,
|
128
140
|
"output_factory": og_gs.ImplicitCrossSectionOutputFactory,
|
129
141
|
"missing_files": og_gs.check_implicit_cross_section_missing_files,
|
@@ -145,6 +157,7 @@ def geode_objects_dict():
|
|
145
157
|
},
|
146
158
|
"ImplicitStructuralModel": {
|
147
159
|
"parent": "StructuralModel",
|
160
|
+
"class": og_gs.ImplicitStructuralModel,
|
148
161
|
"input_factory": og_gs.ImplicitStructuralModelInputFactory,
|
149
162
|
"output_factory": og_gs.ImplicitStructuralModelOutputFactory,
|
150
163
|
"missing_files": og_gs.check_implicit_structural_model_missing_files,
|
@@ -165,6 +178,7 @@ def geode_objects_dict():
|
|
165
178
|
"inspector": og_inspector.inspect_brep,
|
166
179
|
},
|
167
180
|
"LightRegularGrid2D": {
|
181
|
+
"class": og.LightRegularGrid2D,
|
168
182
|
"input_factory": og.LightRegularGridInputFactory2D,
|
169
183
|
"output_factory": og.LightRegularGridOutputFactory2D,
|
170
184
|
"missing_files": og.check_light_regular_grid_missing_files2D,
|
@@ -178,6 +192,7 @@ def geode_objects_dict():
|
|
178
192
|
"save_viewable": g_v.save_viewable_light_regular_grid2D,
|
179
193
|
},
|
180
194
|
"LightRegularGrid3D": {
|
195
|
+
"class": og.LightRegularGrid3D,
|
181
196
|
"input_factory": og.LightRegularGridInputFactory3D,
|
182
197
|
"output_factory": og.LightRegularGridOutputFactory3D,
|
183
198
|
"missing_files": og.check_light_regular_grid_missing_files3D,
|
@@ -191,6 +206,7 @@ def geode_objects_dict():
|
|
191
206
|
"save_viewable": g_v.save_viewable_light_regular_grid3D,
|
192
207
|
},
|
193
208
|
"PointSet2D": {
|
209
|
+
"class": og.PointSet2D,
|
194
210
|
"input_factory": og.PointSetInputFactory2D,
|
195
211
|
"output_factory": og.PointSetOutputFactory2D,
|
196
212
|
"missing_files": og.check_point_set_missing_files2D,
|
@@ -211,6 +227,7 @@ def geode_objects_dict():
|
|
211
227
|
"inspector": og_inspector.inspect_point_set2D,
|
212
228
|
},
|
213
229
|
"PointSet3D": {
|
230
|
+
"class": og.PointSet3D,
|
214
231
|
"input_factory": og.PointSetInputFactory3D,
|
215
232
|
"output_factory": og.PointSetOutputFactory3D,
|
216
233
|
"missing_files": og.check_point_set_missing_files3D,
|
@@ -231,6 +248,7 @@ def geode_objects_dict():
|
|
231
248
|
"inspector": og_inspector.inspect_point_set3D,
|
232
249
|
},
|
233
250
|
"PolygonalSurface2D": {
|
251
|
+
"class": og.PolygonalSurface2D,
|
234
252
|
"input_factory": og.PolygonalSurfaceInputFactory2D,
|
235
253
|
"output_factory": og.PolygonalSurfaceOutputFactory2D,
|
236
254
|
"missing_files": og.check_polygonal_surface_missing_files2D,
|
@@ -251,6 +269,7 @@ def geode_objects_dict():
|
|
251
269
|
"inspector": og_inspector.inspect_surface2D,
|
252
270
|
},
|
253
271
|
"PolygonalSurface3D": {
|
272
|
+
"class": og.PolygonalSurface3D,
|
254
273
|
"input_factory": og.PolygonalSurfaceInputFactory3D,
|
255
274
|
"output_factory": og.PolygonalSurfaceOutputFactory3D,
|
256
275
|
"missing_files": og.check_polygonal_surface_missing_files3D,
|
@@ -271,6 +290,7 @@ def geode_objects_dict():
|
|
271
290
|
"inspector": og_inspector.inspect_surface3D,
|
272
291
|
},
|
273
292
|
"PolyhedralSolid3D": {
|
293
|
+
"class": og.PolyhedralSolid3D,
|
274
294
|
"input_factory": og.PolyhedralSolidInputFactory3D,
|
275
295
|
"output_factory": og.PolyhedralSolidOutputFactory3D,
|
276
296
|
"missing_files": og.check_polyhedral_solid_missing_files3D,
|
@@ -291,6 +311,7 @@ def geode_objects_dict():
|
|
291
311
|
"inspector": og_inspector.inspect_solid3D,
|
292
312
|
},
|
293
313
|
"RasterImage2D": {
|
314
|
+
"class": og.RasterImage2D,
|
294
315
|
"input_factory": og.RasterImageInputFactory2D,
|
295
316
|
"output_factory": og.RasterImageOutputFactory2D,
|
296
317
|
"missing_files": og.check_raster_image_missing_files2D,
|
@@ -304,6 +325,7 @@ def geode_objects_dict():
|
|
304
325
|
"save_viewable": g_v.save_viewable_raster_image2D,
|
305
326
|
},
|
306
327
|
"RasterImage3D": {
|
328
|
+
"class": og.RasterImage3D,
|
307
329
|
"input_factory": og.RasterImageInputFactory3D,
|
308
330
|
"output_factory": og.RasterImageOutputFactory3D,
|
309
331
|
"missing_files": og.check_raster_image_missing_files3D,
|
@@ -317,6 +339,7 @@ def geode_objects_dict():
|
|
317
339
|
"save_viewable": g_v.save_viewable_raster_image3D,
|
318
340
|
},
|
319
341
|
"RegularGrid2D": {
|
342
|
+
"class": og.RegularGrid2D,
|
320
343
|
"input_factory": og.RegularGridInputFactory2D,
|
321
344
|
"output_factory": og.RegularGridOutputFactory2D,
|
322
345
|
"missing_files": og.check_regular_grid_missing_files2D,
|
@@ -336,6 +359,7 @@ def geode_objects_dict():
|
|
336
359
|
"save_viewable": g_v.save_viewable_regular_grid2D,
|
337
360
|
},
|
338
361
|
"RegularGrid3D": {
|
362
|
+
"class": og.RegularGrid3D,
|
339
363
|
"input_factory": og.RegularGridInputFactory3D,
|
340
364
|
"output_factory": og.RegularGridOutputFactory3D,
|
341
365
|
"missing_files": og.check_regular_grid_missing_files3D,
|
@@ -355,6 +379,7 @@ def geode_objects_dict():
|
|
355
379
|
"save_viewable": g_v.save_viewable_regular_grid3D,
|
356
380
|
},
|
357
381
|
"Section": {
|
382
|
+
"class": og.Section,
|
358
383
|
"input_factory": og.SectionInputFactory,
|
359
384
|
"output_factory": og.SectionOutputFactory,
|
360
385
|
"missing_files": og.check_section_missing_files,
|
@@ -376,6 +401,7 @@ def geode_objects_dict():
|
|
376
401
|
},
|
377
402
|
"StructuralModel": {
|
378
403
|
"parent": "BRep",
|
404
|
+
"class": og_gs.StructuralModel,
|
379
405
|
"input_factory": og_gs.StructuralModelInputFactory,
|
380
406
|
"output_factory": og_gs.StructuralModelOutputFactory,
|
381
407
|
"missing_files": og_gs.check_structural_model_missing_files,
|
@@ -396,6 +422,7 @@ def geode_objects_dict():
|
|
396
422
|
"inspector": og_inspector.inspect_brep,
|
397
423
|
},
|
398
424
|
"TetrahedralSolid3D": {
|
425
|
+
"class": og.TetrahedralSolid3D,
|
399
426
|
"input_factory": og.TetrahedralSolidInputFactory3D,
|
400
427
|
"output_factory": og.TetrahedralSolidOutputFactory3D,
|
401
428
|
"missing_files": og.check_tetrahedral_solid_missing_files3D,
|
@@ -416,6 +443,7 @@ def geode_objects_dict():
|
|
416
443
|
"inspector": og_inspector.inspect_solid3D,
|
417
444
|
},
|
418
445
|
"TriangulatedSurface2D": {
|
446
|
+
"class": og.TriangulatedSurface2D,
|
419
447
|
"input_factory": og.TriangulatedSurfaceInputFactory2D,
|
420
448
|
"output_factory": og.TriangulatedSurfaceOutputFactory2D,
|
421
449
|
"missing_files": og.check_triangulated_surface_missing_files2D,
|
@@ -436,6 +464,7 @@ def geode_objects_dict():
|
|
436
464
|
"inspector": og_inspector.inspect_surface2D,
|
437
465
|
},
|
438
466
|
"TriangulatedSurface3D": {
|
467
|
+
"class": og.TriangulatedSurface3D,
|
439
468
|
"input_factory": og.TriangulatedSurfaceInputFactory3D,
|
440
469
|
"output_factory": og.TriangulatedSurfaceOutputFactory3D,
|
441
470
|
"missing_files": og.check_triangulated_surface_missing_files3D,
|
@@ -456,6 +485,7 @@ def geode_objects_dict():
|
|
456
485
|
"inspector": og_inspector.inspect_surface3D,
|
457
486
|
},
|
458
487
|
"VertexSet": {
|
488
|
+
"class": og.VertexSet,
|
459
489
|
"input_factory": og.VertexSetInputFactory,
|
460
490
|
"output_factory": og.VertexSetOutputFactory,
|
461
491
|
"missing_files": og.check_vertex_set_missing_files,
|
@@ -5,9 +5,12 @@ import time
|
|
5
5
|
|
6
6
|
# Third party imports
|
7
7
|
import flask
|
8
|
-
|
9
|
-
import werkzeug
|
8
|
+
import opengeode
|
10
9
|
import uuid
|
10
|
+
import werkzeug
|
11
|
+
|
12
|
+
# Local application imports
|
13
|
+
from .. import geode_functions, utils_functions
|
11
14
|
|
12
15
|
routes = flask.Blueprint("routes", __name__)
|
13
16
|
|
@@ -271,6 +274,98 @@ def save_viewable_file():
|
|
271
274
|
)
|
272
275
|
|
273
276
|
|
277
|
+
with open(os.path.join(schemas, "create_point.json"), "r") as file:
|
278
|
+
create_point_json = json.load(file)
|
279
|
+
|
280
|
+
|
281
|
+
@routes.route(create_point_json["route"], methods=create_point_json["methods"])
|
282
|
+
def create_point():
|
283
|
+
utils_functions.validate_request(flask.request, create_point_json)
|
284
|
+
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
|
285
|
+
x = flask.request.json["x"]
|
286
|
+
y = flask.request.json["y"]
|
287
|
+
z = flask.request.json["z"]
|
288
|
+
class_ = geode_functions.geode_object_class("PointSet3D")
|
289
|
+
PointSet3D = class_.create()
|
290
|
+
builder = geode_functions.create_builder("PointSet3D", PointSet3D)
|
291
|
+
builder.create_point(opengeode.Point3D([x, y, z]))
|
292
|
+
|
293
|
+
generated_id = str(uuid.uuid4()).replace("-", "")
|
294
|
+
saved_viewable_file_path = geode_functions.save_viewable(
|
295
|
+
"PointSet3D", PointSet3D, DATA_FOLDER_PATH, generated_id
|
296
|
+
)
|
297
|
+
|
298
|
+
return flask.make_response(
|
299
|
+
{
|
300
|
+
"viewable_file_name": os.path.basename(saved_viewable_file_path),
|
301
|
+
"id": generated_id,
|
302
|
+
},
|
303
|
+
200,
|
304
|
+
)
|
305
|
+
|
306
|
+
|
307
|
+
with open(
|
308
|
+
os.path.join(schemas, "vertex_attribute_names.json"),
|
309
|
+
"r",
|
310
|
+
) as file:
|
311
|
+
vertex_attribute_names_json = json.load(file)
|
312
|
+
|
313
|
+
|
314
|
+
@routes.route(
|
315
|
+
vertex_attribute_names_json["route"],
|
316
|
+
methods=vertex_attribute_names_json["methods"],
|
317
|
+
)
|
318
|
+
def vertex_attribute_names():
|
319
|
+
|
320
|
+
UPLOAD_FOLDER = flask.current_app.config["UPLOAD_FOLDER"]
|
321
|
+
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
|
322
|
+
file_absolute_path = os.path.join(
|
323
|
+
UPLOAD_FOLDER, werkzeug.utils.secure_filename(flask.request.json["filename"])
|
324
|
+
)
|
325
|
+
data = geode_functions.load(
|
326
|
+
flask.request.json["input_geode_object"], file_absolute_path
|
327
|
+
)
|
328
|
+
vertex_attribute_names = data.vertex_attribute_manager().attribute_names()
|
329
|
+
|
330
|
+
return flask.make_response(
|
331
|
+
{
|
332
|
+
"vertex_attribute_names": vertex_attribute_names,
|
333
|
+
},
|
334
|
+
200,
|
335
|
+
)
|
336
|
+
|
337
|
+
|
338
|
+
with open(
|
339
|
+
os.path.join(schemas, "polygon_attribute_names.json"),
|
340
|
+
"r",
|
341
|
+
) as file:
|
342
|
+
polygon_attribute_names_json = json.load(file)
|
343
|
+
|
344
|
+
|
345
|
+
@routes.route(
|
346
|
+
polygon_attribute_names_json["route"],
|
347
|
+
methods=polygon_attribute_names_json["methods"],
|
348
|
+
)
|
349
|
+
def polygon_attribute_names():
|
350
|
+
|
351
|
+
UPLOAD_FOLDER = flask.current_app.config["UPLOAD_FOLDER"]
|
352
|
+
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
|
353
|
+
file_absolute_path = os.path.join(
|
354
|
+
UPLOAD_FOLDER, werkzeug.utils.secure_filename(flask.request.json["filename"])
|
355
|
+
)
|
356
|
+
data = geode_functions.load(
|
357
|
+
flask.request.json["input_geode_object"], file_absolute_path
|
358
|
+
)
|
359
|
+
polygon_attribute_names = data.polygon_attribute_manager().attribute_names()
|
360
|
+
|
361
|
+
return flask.make_response(
|
362
|
+
{
|
363
|
+
"polygon_attribute_names": polygon_attribute_names,
|
364
|
+
},
|
365
|
+
200,
|
366
|
+
)
|
367
|
+
|
368
|
+
|
274
369
|
with open(
|
275
370
|
os.path.join(schemas, "ping.json"),
|
276
371
|
"r",
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"route": "/create_point",
|
3
|
+
"methods": [
|
4
|
+
"POST"
|
5
|
+
],
|
6
|
+
"type": "object",
|
7
|
+
"properties": {
|
8
|
+
"x": {
|
9
|
+
"type": "number"
|
10
|
+
},
|
11
|
+
"y": {
|
12
|
+
"type": "number"
|
13
|
+
},
|
14
|
+
"z": {
|
15
|
+
"type": "number"
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"required": [
|
19
|
+
"x",
|
20
|
+
"y",
|
21
|
+
"z"
|
22
|
+
],
|
23
|
+
"additionalProperties": false
|
24
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"route": "/polygon_attribute_names",
|
3
|
+
"methods": ["POST"],
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"input_geode_object": {
|
7
|
+
"type": "string"
|
8
|
+
},
|
9
|
+
"filename": {
|
10
|
+
"type": "string"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"required": ["input_geode_object", "filename"],
|
14
|
+
"additionalProperties": false
|
15
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"route": "/vertex_attribute_names",
|
3
|
+
"methods": ["POST"],
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"input_geode_object": {
|
7
|
+
"type": "string"
|
8
|
+
},
|
9
|
+
"filename": {
|
10
|
+
"type": "string"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"required": ["input_geode_object", "filename"],
|
14
|
+
"additionalProperties": false
|
15
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Standard library imports
|
2
|
+
|
3
|
+
# Third party imports
|
4
|
+
|
5
|
+
# Local application imports
|
6
|
+
|
7
|
+
|
8
|
+
def test_route_wrong_params(client, route, get_full_data):
|
9
|
+
for key, value in get_full_data().items():
|
10
|
+
json = get_full_data()
|
11
|
+
json.pop(key)
|
12
|
+
response = client.post(route, json=json)
|
13
|
+
assert response.status_code == 400
|
14
|
+
error_description = response.json["description"]
|
15
|
+
assert error_description == f"Validation error: '{key}' is a required property"
|
16
|
+
|
17
|
+
json = get_full_data()
|
18
|
+
json["dumb_key"] = "dumb_value"
|
19
|
+
response = client.post(route, json=json)
|
20
|
+
assert response.status_code == 400
|
21
|
+
error_description = response.json["description"]
|
22
|
+
assert (
|
23
|
+
error_description
|
24
|
+
== "Validation error: Additional properties are not allowed ('dumb_key' was unexpected)"
|
25
|
+
)
|
File without changes
|
File without changes
|