OpenGeodeWeb-Back 5.10.0rc10__tar.gz → 5.10.0rc12__tar.gz
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.10.0rc10/src/OpenGeodeWeb_Back.egg-info → opengeodeweb_back-5.10.0rc12}/PKG-INFO +3 -2
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/pyproject.toml +7 -8
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/requirements.txt +10 -4
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12/src/OpenGeodeWeb_Back.egg-info}/PKG-INFO +3 -2
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/OpenGeodeWeb_Back.egg-info/SOURCES.txt +1 -2
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/OpenGeodeWeb_Back.egg-info/requires.txt +2 -1
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/app_config.py +3 -1
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/geode_functions.py +4 -4
- opengeodeweb_back-5.10.0rc12/src/opengeodeweb_back/py.typed +1 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/utils_functions.py +13 -5
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/tests/test_models_routes.py +22 -20
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/tests/test_routes.py +26 -22
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/tests/test_utils_functions.py +4 -3
- opengeodeweb_back-5.10.0rc10/src/opengeodeweb_back/data.py +0 -45
- opengeodeweb_back-5.10.0rc10/src/opengeodeweb_back/database.py +0 -19
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/LICENSE +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/README.md +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/setup.cfg +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/OpenGeodeWeb_Back.egg-info/dependency_links.txt +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/OpenGeodeWeb_Back.egg-info/top_level.txt +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/__init__.py +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/geode_objects.py +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/blueprint_routes.py +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/models/blueprint_models.py +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/models/schemas/mesh_components.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/models/schemas/vtm_component_indices.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/allowed_files.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/allowed_objects.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/create_point.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/geographic_coordinate_systems.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/inspect_file.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/missing_files.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/ping.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/save_viewable_file.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/texture_coordinates.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/upload_file.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.json +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/test_utils.py +0 -0
- {opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/tests/test_geode_functions.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: OpenGeodeWeb-Back
|
3
|
-
Version: 5.10.
|
3
|
+
Version: 5.10.0rc12
|
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
|
@@ -14,7 +14,7 @@ License-File: LICENSE
|
|
14
14
|
Requires-Dist: asgiref==3.9.1
|
15
15
|
Requires-Dist: blinker==1.9.0
|
16
16
|
Requires-Dist: click==8.2.1
|
17
|
-
Requires-Dist: fastjsonschema==2.
|
17
|
+
Requires-Dist: fastjsonschema==2.21.1
|
18
18
|
Requires-Dist: flask[async]==3.0.3
|
19
19
|
Requires-Dist: flask-cors==6.0.1
|
20
20
|
Requires-Dist: flask-sqlalchemy==3.1.1
|
@@ -29,6 +29,7 @@ Requires-Dist: opengeode-geosciences==9.2.2
|
|
29
29
|
Requires-Dist: opengeode-geosciencesio==5.7.2
|
30
30
|
Requires-Dist: opengeode-inspector==6.7.0
|
31
31
|
Requires-Dist: opengeode-io==7.3.2
|
32
|
+
Requires-Dist: opengeodeweb-microservice==1.*,>=1.0.0
|
32
33
|
Requires-Dist: sqlalchemy==2.0.43
|
33
34
|
Requires-Dist: typing-extensions==4.15.0
|
34
35
|
Requires-Dist: werkzeug==3.0.3
|
@@ -5,18 +5,16 @@ build-backend = "setuptools.build_meta"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "OpenGeodeWeb-Back"
|
8
|
-
version = "5.10.0-rc.
|
8
|
+
version = "5.10.0-rc.12"
|
9
9
|
dynamic = ["dependencies"]
|
10
|
-
authors = [
|
11
|
-
{ name="Geode-solutions", email="team-web@geode-solutions.com" },
|
12
|
-
]
|
10
|
+
authors = [{ name = "Geode-solutions", email = "team-web@geode-solutions.com" }]
|
13
11
|
description = "OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem"
|
14
12
|
readme = "README.md"
|
15
13
|
requires-python = ">=3.9, <3.13"
|
16
14
|
classifiers = [
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
"Programming Language :: Python :: 3",
|
16
|
+
"License :: OSI Approved :: MIT License",
|
17
|
+
"Operating System :: OS Independent",
|
20
18
|
]
|
21
19
|
|
22
20
|
[project.urls]
|
@@ -24,7 +22,7 @@ classifiers = [
|
|
24
22
|
"Bug Tracker" = "https://github.com/Geode-solutions/OpenGeodeWeb-Back/issues"
|
25
23
|
|
26
24
|
[tool.setuptools.dynamic]
|
27
|
-
dependencies = {file = ["requirements.txt"]}
|
25
|
+
dependencies = { file = ["requirements.txt"] }
|
28
26
|
|
29
27
|
[tool.setuptools.packages.find]
|
30
28
|
where = ["src"]
|
@@ -32,3 +30,4 @@ where = ["src"]
|
|
32
30
|
[tool.setuptools.package-data]
|
33
31
|
"opengeodeweb_back.routes.schemas" = ["*.json"]
|
34
32
|
"opengeodeweb_back.routes.models.schemas" = ["*.json"]
|
33
|
+
opengeodeweb_microservice = ["py.typed"]
|
@@ -10,8 +10,8 @@ blinker==1.9.0
|
|
10
10
|
# via flask
|
11
11
|
click==8.2.1
|
12
12
|
# via flask
|
13
|
-
fastjsonschema==2.
|
14
|
-
# via -
|
13
|
+
fastjsonschema==2.21.1
|
14
|
+
# via opengeodeweb-microservice
|
15
15
|
flask[async]==3.0.3
|
16
16
|
# via
|
17
17
|
# -r requirements.in
|
@@ -21,7 +21,9 @@ flask[async]==3.0.3
|
|
21
21
|
flask-cors==6.0.1
|
22
22
|
# via -r requirements.in
|
23
23
|
flask-sqlalchemy==3.1.1
|
24
|
-
# via
|
24
|
+
# via
|
25
|
+
# -r requirements.in
|
26
|
+
# opengeodeweb-microservice
|
25
27
|
geode-common==33.9.0
|
26
28
|
# via geode-viewables
|
27
29
|
geode-viewables==3.2.0
|
@@ -59,8 +61,12 @@ opengeode-io==7.3.2
|
|
59
61
|
# -r requirements.in
|
60
62
|
# geode-viewables
|
61
63
|
# opengeode-geosciencesio
|
64
|
+
opengeodeweb-microservice==1.*,>=1.0.0
|
65
|
+
# via -r requirements.in
|
62
66
|
sqlalchemy==2.0.43
|
63
|
-
# via
|
67
|
+
# via
|
68
|
+
# flask-sqlalchemy
|
69
|
+
# opengeodeweb-microservice
|
64
70
|
typing-extensions==4.15.0
|
65
71
|
# via sqlalchemy
|
66
72
|
werkzeug==3.0.3
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: OpenGeodeWeb-Back
|
3
|
-
Version: 5.10.
|
3
|
+
Version: 5.10.0rc12
|
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
|
@@ -14,7 +14,7 @@ License-File: LICENSE
|
|
14
14
|
Requires-Dist: asgiref==3.9.1
|
15
15
|
Requires-Dist: blinker==1.9.0
|
16
16
|
Requires-Dist: click==8.2.1
|
17
|
-
Requires-Dist: fastjsonschema==2.
|
17
|
+
Requires-Dist: fastjsonschema==2.21.1
|
18
18
|
Requires-Dist: flask[async]==3.0.3
|
19
19
|
Requires-Dist: flask-cors==6.0.1
|
20
20
|
Requires-Dist: flask-sqlalchemy==3.1.1
|
@@ -29,6 +29,7 @@ Requires-Dist: opengeode-geosciences==9.2.2
|
|
29
29
|
Requires-Dist: opengeode-geosciencesio==5.7.2
|
30
30
|
Requires-Dist: opengeode-inspector==6.7.0
|
31
31
|
Requires-Dist: opengeode-io==7.3.2
|
32
|
+
Requires-Dist: opengeodeweb-microservice==1.*,>=1.0.0
|
32
33
|
Requires-Dist: sqlalchemy==2.0.43
|
33
34
|
Requires-Dist: typing-extensions==4.15.0
|
34
35
|
Requires-Dist: werkzeug==3.0.3
|
@@ -9,10 +9,9 @@ src/OpenGeodeWeb_Back.egg-info/requires.txt
|
|
9
9
|
src/OpenGeodeWeb_Back.egg-info/top_level.txt
|
10
10
|
src/opengeodeweb_back/__init__.py
|
11
11
|
src/opengeodeweb_back/app_config.py
|
12
|
-
src/opengeodeweb_back/data.py
|
13
|
-
src/opengeodeweb_back/database.py
|
14
12
|
src/opengeodeweb_back/geode_functions.py
|
15
13
|
src/opengeodeweb_back/geode_objects.py
|
14
|
+
src/opengeodeweb_back/py.typed
|
16
15
|
src/opengeodeweb_back/test_utils.py
|
17
16
|
src/opengeodeweb_back/utils_functions.py
|
18
17
|
src/opengeodeweb_back/routes/blueprint_routes.py
|
@@ -1,7 +1,7 @@
|
|
1
1
|
asgiref==3.9.1
|
2
2
|
blinker==1.9.0
|
3
3
|
click==8.2.1
|
4
|
-
fastjsonschema==2.
|
4
|
+
fastjsonschema==2.21.1
|
5
5
|
flask[async]==3.0.3
|
6
6
|
flask-cors==6.0.1
|
7
7
|
flask-sqlalchemy==3.1.1
|
@@ -16,6 +16,7 @@ opengeode-geosciences==9.2.2
|
|
16
16
|
opengeode-geosciencesio==5.7.2
|
17
17
|
opengeode-inspector==6.7.0
|
18
18
|
opengeode-io==7.3.2
|
19
|
+
opengeodeweb-microservice==1.*,>=1.0.0
|
19
20
|
sqlalchemy==2.0.43
|
20
21
|
typing-extensions==4.15.0
|
21
22
|
werkzeug==3.0.3
|
@@ -11,8 +11,8 @@ from typing import Any
|
|
11
11
|
# Local application imports
|
12
12
|
from .geode_objects import geode_objects_dict
|
13
13
|
from . import utils_functions
|
14
|
-
from .data import Data
|
15
|
-
from .database import
|
14
|
+
from opengeodeweb_microservice.database.data import Data
|
15
|
+
from opengeodeweb_microservice.database.connection import get_session
|
16
16
|
|
17
17
|
|
18
18
|
def geode_object_value(geode_object: str):
|
@@ -61,12 +61,12 @@ def load_data(data_id: str) -> Any:
|
|
61
61
|
flask.abort(404, f"Data with id {data_id} not found")
|
62
62
|
|
63
63
|
file_absolute_path = data_file_path(data_id, data_entry.native_file_name)
|
64
|
+
print("Loading file: ", file_absolute_path)
|
65
|
+
print("File exists: ", os.path.exists(file_absolute_path))
|
64
66
|
return load(data_entry.geode_object, file_absolute_path)
|
65
67
|
|
66
68
|
|
67
69
|
def get_data_info(data_id: str) -> Data:
|
68
|
-
from .data import Data
|
69
|
-
|
70
70
|
data_entry = Data.get(data_id)
|
71
71
|
if not data_entry:
|
72
72
|
flask.abort(404, f"Data with id {data_id} not found")
|
@@ -0,0 +1 @@
|
|
1
|
+
partial
|
@@ -16,8 +16,8 @@ import werkzeug
|
|
16
16
|
|
17
17
|
# Local application imports
|
18
18
|
from . import geode_functions
|
19
|
-
from .data import Data
|
20
|
-
from .database import
|
19
|
+
from opengeodeweb_microservice.database.data import Data
|
20
|
+
from opengeodeweb_microservice.database.connection import get_session
|
21
21
|
|
22
22
|
|
23
23
|
def increment_request_counter(current_app: flask.Flask) -> None:
|
@@ -193,7 +193,9 @@ def save_all_viewables_and_return_info(
|
|
193
193
|
data_entry.viewable_file_name = os.path.basename(saved_viewable_file_path)
|
194
194
|
data_entry.light_viewable = os.path.basename(saved_light_viewable_file_path)
|
195
195
|
|
196
|
-
|
196
|
+
session = get_session()
|
197
|
+
if session:
|
198
|
+
session.commit()
|
197
199
|
|
198
200
|
return {
|
199
201
|
"native_file_name": data_entry.native_file_name,
|
@@ -247,8 +249,14 @@ def generate_native_viewable_and_light_viewable_from_file(
|
|
247
249
|
|
248
250
|
data = geode_functions.load(geode_object, copied_full_path)
|
249
251
|
|
250
|
-
|
251
|
-
database.session.
|
252
|
+
# Remplacer :
|
253
|
+
# database.session.delete(temp_data_entry)
|
254
|
+
# database.session.flush()
|
255
|
+
# Par :
|
256
|
+
session = get_session()
|
257
|
+
if session:
|
258
|
+
session.delete(temp_data_entry)
|
259
|
+
session.flush()
|
252
260
|
|
253
261
|
return save_all_viewables_and_return_info(
|
254
262
|
geode_object,
|
@@ -3,8 +3,8 @@ import shutil
|
|
3
3
|
import flask
|
4
4
|
|
5
5
|
from src.opengeodeweb_back import geode_functions
|
6
|
-
from
|
7
|
-
from
|
6
|
+
from opengeodeweb_microservice.database.data import Data
|
7
|
+
from opengeodeweb_microservice.database.connection import get_session
|
8
8
|
|
9
9
|
|
10
10
|
def test_model_mesh_components(client, test_id):
|
@@ -33,22 +33,24 @@ def test_extract_brep_uuids(client, test_id):
|
|
33
33
|
brep_filename = "cube.og_brep"
|
34
34
|
|
35
35
|
with client.application.app_context():
|
36
|
-
data_entry = Data.create(
|
36
|
+
data_entry = Data.create(
|
37
|
+
geode_object="BRep",
|
38
|
+
input_file=brep_filename,
|
39
|
+
)
|
37
40
|
data_entry.native_file_name = brep_filename
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
assert isinstance(
|
54
|
-
assert all(isinstance(v, str) for v in value)
|
41
|
+
session = get_session()
|
42
|
+
if session:
|
43
|
+
session.commit()
|
44
|
+
|
45
|
+
src_path = os.path.join("tests", "data", brep_filename)
|
46
|
+
dest_path = os.path.join(
|
47
|
+
flask.current_app.config["DATA_FOLDER_PATH"], data_entry.id, brep_filename
|
48
|
+
)
|
49
|
+
os.makedirs(os.path.dirname(dest_path), exist_ok=True)
|
50
|
+
shutil.copy2(src_path, dest_path)
|
51
|
+
|
52
|
+
response = client.post(route, json={"id": data_entry.id})
|
53
|
+
assert response.status_code == 200
|
54
|
+
assert "uuid_dict" in response.json
|
55
|
+
uuid_dict = response.json["uuid_dict"]
|
56
|
+
assert isinstance(uuid_dict, dict)
|
@@ -6,9 +6,9 @@ import shutil
|
|
6
6
|
from werkzeug.datastructures import FileStorage
|
7
7
|
|
8
8
|
# Local application imports
|
9
|
+
from opengeodeweb_microservice.database.data import Data
|
10
|
+
from opengeodeweb_microservice.database.connection import get_session
|
9
11
|
from src.opengeodeweb_back import geode_functions, test_utils
|
10
|
-
from src.opengeodeweb_back.data import Data
|
11
|
-
from src.opengeodeweb_back.database import database
|
12
12
|
|
13
13
|
|
14
14
|
def test_allowed_files(client):
|
@@ -173,17 +173,15 @@ def test_texture_coordinates(client, test_id):
|
|
173
173
|
with client.application.app_context():
|
174
174
|
data = Data.create(geode_object="PolygonalSurface3D", input_file="hat.vtp")
|
175
175
|
data.native_file_name = "hat.vtp"
|
176
|
-
|
176
|
+
session = get_session()
|
177
|
+
if session:
|
178
|
+
session.commit()
|
177
179
|
|
178
|
-
data_path = geode_functions.data_file_path(data.id,
|
179
|
-
print(data_path)
|
180
|
+
data_path = geode_functions.data_file_path(data.id, data.native_file_name)
|
180
181
|
os.makedirs(os.path.dirname(data_path), exist_ok=True)
|
181
182
|
shutil.copy("./tests/data/hat.vtp", data_path)
|
182
|
-
|
183
|
-
response = client.post(
|
184
|
-
"/texture_coordinates",
|
185
|
-
json={"id": data.id},
|
186
|
-
)
|
183
|
+
assert os.path.exists(data_path), f"File not found at {data_path}"
|
184
|
+
response = client.post("/texture_coordinates", json={"id": data.id})
|
187
185
|
assert response.status_code == 200
|
188
186
|
texture_coordinates = response.json["texture_coordinates"]
|
189
187
|
assert type(texture_coordinates) is list
|
@@ -197,13 +195,14 @@ def test_vertex_attribute_names(client, test_id):
|
|
197
195
|
with client.application.app_context():
|
198
196
|
data = Data.create(geode_object="PolygonalSurface3D", input_file="test.vtp")
|
199
197
|
data.native_file_name = "test.vtp"
|
200
|
-
|
198
|
+
session = get_session()
|
199
|
+
if session:
|
200
|
+
session.commit()
|
201
201
|
|
202
|
-
data_path = geode_functions.data_file_path(data.id,
|
202
|
+
data_path = geode_functions.data_file_path(data.id, data.native_file_name)
|
203
203
|
os.makedirs(os.path.dirname(data_path), exist_ok=True)
|
204
|
-
|
205
|
-
|
206
|
-
|
204
|
+
shutil.copy("./tests/data/test.vtp", data_path)
|
205
|
+
assert os.path.exists(data_path), f"File not found at {data_path}"
|
207
206
|
response = client.post(route, json={"id": data.id})
|
208
207
|
assert response.status_code == 200
|
209
208
|
vertex_attribute_names = response.json["vertex_attribute_names"]
|
@@ -218,12 +217,14 @@ def test_polygon_attribute_names(client, test_id):
|
|
218
217
|
with client.application.app_context():
|
219
218
|
data = Data.create(geode_object="PolygonalSurface3D", input_file="test.vtp")
|
220
219
|
data.native_file_name = "test.vtp"
|
221
|
-
|
220
|
+
session = get_session()
|
221
|
+
if session:
|
222
|
+
session.commit()
|
222
223
|
|
223
|
-
data_path = geode_functions.data_file_path(data.id,
|
224
|
+
data_path = geode_functions.data_file_path(data.id, data.native_file_name)
|
224
225
|
os.makedirs(os.path.dirname(data_path), exist_ok=True)
|
225
|
-
|
226
|
-
|
226
|
+
shutil.copy("./tests/data/test.vtp", data_path)
|
227
|
+
assert os.path.exists(data_path), f"File not found at {data_path}"
|
227
228
|
response = client.post(route, json={"id": data.id})
|
228
229
|
assert response.status_code == 200
|
229
230
|
polygon_attribute_names = response.json["polygon_attribute_names"]
|
@@ -238,13 +239,16 @@ def test_polyhedron_attribute_names(client, test_id):
|
|
238
239
|
with client.application.app_context():
|
239
240
|
data = Data.create(geode_object="PolyhedralSolid3D", input_file="test.vtu")
|
240
241
|
data.native_file_name = "test.vtu"
|
241
|
-
|
242
|
+
session = get_session()
|
243
|
+
if session:
|
244
|
+
session.commit()
|
242
245
|
|
243
|
-
data_path = geode_functions.data_file_path(data.id,
|
246
|
+
data_path = geode_functions.data_file_path(data.id, data.native_file_name)
|
244
247
|
os.makedirs(os.path.dirname(data_path), exist_ok=True)
|
245
248
|
shutil.copy("./tests/data/test.vtu", data_path)
|
246
|
-
|
249
|
+
assert os.path.exists(data_path), f"File not found at {data_path}"
|
247
250
|
response = client.post(route, json={"id": data.id})
|
251
|
+
print(response.json)
|
248
252
|
assert response.status_code == 200
|
249
253
|
polyhedron_attribute_names = response.json["polyhedron_attribute_names"]
|
250
254
|
assert type(polyhedron_attribute_names) is list
|
@@ -8,8 +8,8 @@ import shutil
|
|
8
8
|
import uuid
|
9
9
|
|
10
10
|
# Local application imports
|
11
|
-
from
|
12
|
-
from
|
11
|
+
from opengeodeweb_microservice.database.data import Data
|
12
|
+
from opengeodeweb_microservice.database.connection import get_session
|
13
13
|
from src.opengeodeweb_back import geode_functions, utils_functions
|
14
14
|
|
15
15
|
|
@@ -143,7 +143,8 @@ def test_save_all_viewables_commits_to_db(client):
|
|
143
143
|
db_entry_before = Data.get(data_id)
|
144
144
|
assert db_entry_before is not None
|
145
145
|
assert db_entry_before.native_file_name == result["native_file_name"]
|
146
|
-
|
146
|
+
session = get_session()
|
147
|
+
session.rollback()
|
147
148
|
db_entry_after = Data.get(data_id)
|
148
149
|
assert (
|
149
150
|
db_entry_after is not None
|
@@ -1,45 +0,0 @@
|
|
1
|
-
from sqlalchemy import String, JSON
|
2
|
-
from sqlalchemy.orm import Mapped, mapped_column
|
3
|
-
from .database import database, Base
|
4
|
-
import uuid
|
5
|
-
|
6
|
-
|
7
|
-
class Data(Base):
|
8
|
-
__tablename__ = "datas"
|
9
|
-
|
10
|
-
id: Mapped[str] = mapped_column(
|
11
|
-
String, primary_key=True, default=lambda: str(uuid.uuid4()).replace("-", "")
|
12
|
-
)
|
13
|
-
native_file_name: Mapped[str] = mapped_column(String, nullable=False)
|
14
|
-
viewable_file_name: Mapped[str] = mapped_column(String, nullable=False)
|
15
|
-
geode_object: Mapped[str] = mapped_column(String, nullable=False)
|
16
|
-
|
17
|
-
light_viewable: Mapped[str | None] = mapped_column(String, nullable=True)
|
18
|
-
input_file: Mapped[str | None] = mapped_column(String, nullable=True)
|
19
|
-
additional_files: Mapped[list[str] | None] = mapped_column(JSON, nullable=True)
|
20
|
-
|
21
|
-
@staticmethod
|
22
|
-
def create(
|
23
|
-
geode_object: str,
|
24
|
-
input_file: str | None = None,
|
25
|
-
additional_files: list[str] | None = None,
|
26
|
-
) -> "Data":
|
27
|
-
input_file = input_file if input_file is not None else ""
|
28
|
-
additional_files = additional_files if additional_files is not None else []
|
29
|
-
|
30
|
-
data_entry = Data(
|
31
|
-
geode_object=geode_object,
|
32
|
-
input_file=input_file,
|
33
|
-
additional_files=additional_files,
|
34
|
-
native_file_name="",
|
35
|
-
viewable_file_name="",
|
36
|
-
light_viewable=None,
|
37
|
-
)
|
38
|
-
|
39
|
-
database.session.add(data_entry)
|
40
|
-
database.session.flush()
|
41
|
-
return data_entry
|
42
|
-
|
43
|
-
@staticmethod
|
44
|
-
def get(data_id: str) -> "Data | None":
|
45
|
-
return database.session.get(Data, data_id)
|
@@ -1,19 +0,0 @@
|
|
1
|
-
from flask import Flask
|
2
|
-
from flask_sqlalchemy import SQLAlchemy
|
3
|
-
from sqlalchemy.orm import DeclarativeBase
|
4
|
-
|
5
|
-
DATABASE_FILENAME = "project.db"
|
6
|
-
|
7
|
-
|
8
|
-
class Base(DeclarativeBase):
|
9
|
-
pass
|
10
|
-
|
11
|
-
|
12
|
-
database = SQLAlchemy(model_class=Base)
|
13
|
-
|
14
|
-
|
15
|
-
def initialize_database(app: Flask) -> SQLAlchemy:
|
16
|
-
database.init_app(app)
|
17
|
-
with app.app_context():
|
18
|
-
database.create_all()
|
19
|
-
return database
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/__init__.py
RENAMED
File without changes
|
{opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/geode_objects.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{opengeodeweb_back-5.10.0rc10 → opengeodeweb_back-5.10.0rc12}/src/opengeodeweb_back/test_utils.py
RENAMED
File without changes
|
File without changes
|