Skip to content
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
e12c1c7
database integration. using id from database of OGW-Microservice's da…
MaxNumerique Sep 15, 2025
71e3bb7
test
MaxNumerique Sep 15, 2025
3dae7e5
refactor database : integrate sqlite database for object management
MaxNumerique Sep 16, 2025
9402b47
fix var
MaxNumerique Sep 16, 2025
0221ba0
adding tests. Need to correct config file to match uuids from test_da…
MaxNumerique Sep 16, 2025
17ddfe8
fix(database): adding database integration. stable version
MaxNumerique Sep 17, 2025
58f182b
Apply prepare changes
MaxNumerique Sep 17, 2025
12ee4e5
test
MaxNumerique Sep 17, 2025
4ce8770
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Sep 17, 2025
2b69cae
test
MaxNumerique Sep 17, 2025
cec2803
model
MaxNumerique Sep 17, 2025
98668e9
Apply prepare changes
MaxNumerique Sep 17, 2025
2ec47e2
test
MaxNumerique Sep 17, 2025
2e06438
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Sep 17, 2025
4748e1c
Apply prepare changes
MaxNumerique Sep 17, 2025
39e7fe9
sql alchemy replacing flask sql alchemy
MaxNumerique Sep 18, 2025
976acf9
tests almost cleared
MaxNumerique Sep 18, 2025
ddc3ba2
rm some space
MaxNumerique Sep 18, 2025
7fc4c8c
adding project.db to gitignore
MaxNumerique Sep 19, 2025
830be80
adding project.db to gitignore
MaxNumerique Sep 19, 2025
901cdc1
test stable
MaxNumerique Sep 19, 2025
bd91d39
replace images
MaxNumerique Sep 19, 2025
7f293fa
why did i delete this data ?
MaxNumerique Sep 19, 2025
ceb4e46
fix deregister mesh protocols test
MaxNumerique Sep 19, 2025
b8d8464
test z-scaling
MaxNumerique Sep 19, 2025
bc5c35c
texture_filename => id_texture
MaxNumerique Sep 19, 2025
836d5af
work in progress
MaxNumerique Sep 19, 2025
308eb97
update applyTextures with texture_id from database entry
MaxNumerique Sep 29, 2025
b92bb79
removed prints
MaxNumerique Sep 30, 2025
337a382
mypy 1
MaxNumerique Sep 30, 2025
a1c6e0d
black formater
MaxNumerique Sep 30, 2025
c683231
black formatter 2
MaxNumerique Sep 30, 2025
a1fae5e
black formatter 3
MaxNumerique Sep 30, 2025
cf39ae9
black formatter 4
MaxNumerique Sep 30, 2025
0151d47
black formatter 5
MaxNumerique Sep 30, 2025
0b7ba26
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 1, 2025
99e405d
Apply prepare changes
MaxNumerique Oct 1, 2025
2d8d964
typing test_generic_protocols
MaxNumerique Oct 1, 2025
5236f46
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
53babb1
Apply prepare changes
MaxNumerique Oct 1, 2025
5f9328e
missed import ServerMonitor
MaxNumerique Oct 1, 2025
5a3e266
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
1008240
Apply prepare changes
MaxNumerique Oct 1, 2025
a3cab48
test_model_protocols typing
MaxNumerique Oct 1, 2025
a3197f7
Apply prepare changes
MaxNumerique Oct 1, 2025
20e4fc6
typing test_mesh_protocols and vtk_protocols
MaxNumerique Oct 1, 2025
9d0a807
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
892f4a5
Apply prepare changes
MaxNumerique Oct 1, 2025
42a191c
typing test_mesh_points_protocols aand test_mesh_polygons_protocols
MaxNumerique Oct 1, 2025
6f669e4
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
b0b8787
Apply prepare changes
MaxNumerique Oct 1, 2025
7e89bf4
conftest typing
MaxNumerique Oct 1, 2025
68d2775
import path test_mesh_points_protocols
MaxNumerique Oct 1, 2025
61243ff
Apply prepare changes
MaxNumerique Oct 1, 2025
af166e6
type object_methods and test_mesh_polyhedra_protocols
MaxNumerique Oct 1, 2025
aaf37ee
Apply prepare changes
MaxNumerique Oct 1, 2025
441850a
type mesh_protocols and test_viewer_protocols
MaxNumerique Oct 1, 2025
7deea79
Apply prepare changes
MaxNumerique Oct 1, 2025
f4d2296
type config, viewer_protocols, test_model_blocks_protocols, test_mode…
MaxNumerique Oct 1, 2025
f166403
Apply prepare changes
MaxNumerique Oct 1, 2025
417a15e
typing test_model_edges_protocols, test_model_lined_protocols, test_m…
MaxNumerique Oct 1, 2025
b95a991
Apply prepare changes
MaxNumerique Oct 1, 2025
630fb43
mypy
MaxNumerique Oct 1, 2025
73e7fbd
conftest
MaxNumerique Oct 1, 2025
e6a03e4
mypy test_viewer_protocols
MaxNumerique Oct 1, 2025
f6333f5
py.typed added
MaxNumerique Oct 1, 2025
901e1d3
get_data_file_path for typing purpose in object_methods
MaxNumerique Oct 1, 2025
33e6d85
abs imports
MaxNumerique Oct 1, 2025
bc9acf4
py.typed added to test folder as well
MaxNumerique Oct 1, 2025
1ecfbeb
restore conftest loop
MaxNumerique Oct 1, 2025
eb7f880
conftest
MaxNumerique Oct 1, 2025
0026445
Apply prepare changes
MaxNumerique Oct 1, 2025
7674a1c
Since vtk==9.5.2, visibility and color images output were outdated
MaxNumerique Oct 1, 2025
4500c9d
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
2cf0bc8
type correction, clean unused code
MaxNumerique Oct 1, 2025
222c0d0
Apply prepare changes
MaxNumerique Oct 1, 2025
5fcc659
vtkReader
MaxNumerique Oct 1, 2025
7e5ff70
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
affdbbe
Apply prepare changes
MaxNumerique Oct 1, 2025
d7e13b4
Any types
MaxNumerique Oct 1, 2025
35f8b58
Apply prepare changes
MaxNumerique Oct 1, 2025
634cf25
test
MaxNumerique Oct 1, 2025
83796ec
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
c083d21
Apply prepare changes
MaxNumerique Oct 1, 2025
c63173a
test
MaxNumerique Oct 1, 2025
f8413ad
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
e72025e
viewer_protocol mypy
MaxNumerique Oct 1, 2025
4460b0c
Apply prepare changes
MaxNumerique Oct 1, 2025
cacb35b
mypy
MaxNumerique Oct 1, 2025
915d829
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
1ab77f0
Apply prepare changes
MaxNumerique Oct 1, 2025
6929a66
object mypy
MaxNumerique Oct 1, 2025
d24b1b0
Apply prepare changes
MaxNumerique Oct 1, 2025
f2f550b
test
MaxNumerique Oct 1, 2025
c213970
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 1, 2025
397da93
Apply prepare changes
MaxNumerique Oct 1, 2025
9d58c30
float !
MaxNumerique Oct 1, 2025
dd9ef78
Optional and union types replaced by python actual types
MaxNumerique Oct 2, 2025
ac51c5f
registerObject in registerMesh for mesh_protocols simplified
MaxNumerique Oct 2, 2025
7305599
registerObject in registerMesh for model_protocols simplified
MaxNumerique Oct 2, 2025
6f81216
refacto types in utils_functions.py
MaxNumerique Oct 2, 2025
ae92e8e
mypy
MaxNumerique Oct 2, 2025
bd2244c
mypy
MaxNumerique Oct 2, 2025
1aadc8f
Union removed
MaxNumerique Oct 2, 2025
4307e0d
test
MaxNumerique Oct 2, 2025
88c3d6e
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 2, 2025
7691cd8
Apply prepare changes
MaxNumerique Oct 2, 2025
332de53
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 3, 2025
dbb6c81
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 3, 2025
3de6087
Apply prepare changes
MaxNumerique Oct 3, 2025
100c5c0
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 3, 2025
07b54ca
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 3, 2025
0f9f10d
Apply prepare changes
MaxNumerique Oct 3, 2025
1b9e97b
deps
MaxNumerique Oct 3, 2025
ad1cb13
please
MaxNumerique Oct 3, 2025
670b411
update test generic
MaxNumerique Oct 3, 2025
1d4c808
get_viewer_object_type new function
MaxNumerique Oct 3, 2025
69c360b
test
MaxNumerique Oct 3, 2025
3d98c87
deregister schema
MaxNumerique Oct 3, 2025
eea0e47
enhanced_params
MaxNumerique Oct 3, 2025
1d75a0c
Apply prepare changes
MaxNumerique Oct 3, 2025
16f1d05
waiting room for refacto web server from Vease-Back
MaxNumerique Oct 3, 2025
9faac94
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 6, 2025
ebee10d
Apply prepare changes
MaxNumerique Oct 6, 2025
19c113c
convention for dash "-" in pyproject
MaxNumerique Oct 6, 2025
cdbcfe1
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 6, 2025
11ed408
Apply prepare changes
MaxNumerique Oct 6, 2025
e4da504
move db_path into run_server function
MaxNumerique Oct 6, 2025
1783d2a
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 6, 2025
c1dd621
Apply prepare changes
MaxNumerique Oct 6, 2025
21c483b
delete all database_path.
MaxNumerique Oct 7, 2025
25743a8
Apply prepare changes
MaxNumerique Oct 7, 2025
839c890
viewer_object added since we get the viewer object from dataabase
MaxNumerique Oct 7, 2025
9ffdd8d
force pyparsing 3.2.5
MaxNumerique Oct 8, 2025
139851a
Apply prepare changes
MaxNumerique Oct 8, 2025
db3f46e
trigger
MaxNumerique Oct 8, 2025
60bd130
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 8, 2025
4278973
test_config()
MaxNumerique Oct 9, 2025
a946c1d
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 9, 2025
d2eaac5
Apply prepare changes
MaxNumerique Oct 9, 2025
6f77bd7
trigger
MaxNumerique Oct 9, 2025
33f12bf
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 9, 2025
c0c1cf7
fixed test_environnement
MaxNumerique Oct 9, 2025
885c2dc
Apply prepare changes
MaxNumerique Oct 9, 2025
21c0940
updated test_generic_protocol to add viewer_object
MaxNumerique Oct 9, 2025
fd50c72
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 9, 2025
a3be467
makes data directory
MaxNumerique Oct 9, 2025
790d148
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 9, 2025
dcb0d06
Apply prepare changes
MaxNumerique Oct 9, 2025
ec5912b
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 13, 2025
f431cac
Apply prepare changes
MaxNumerique Oct 13, 2025
417b738
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Oct 14, 2025
6ba9a4e
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 14, 2025
8c87f66
Apply prepare changes
MaxNumerique Oct 14, 2025
373e0ee
test
MaxNumerique Oct 14, 2025
be7b465
Merge branch 'fix/database' of https://github.com/Geode-solutions/Ope…
MaxNumerique Oct 14, 2025
5ff6437
explicit str
MaxNumerique Oct 14, 2025
3c6018d
revert
MaxNumerique Oct 14, 2025
f111e56
cast
MaxNumerique Oct 14, 2025
bc6c54f
revert
MaxNumerique Oct 14, 2025
7283b02
object not iterable
MaxNumerique Oct 14, 2025
ef7aceb
cast(str, ...) for mesh_points_test
MaxNumerique Oct 14, 2025
d3d6cee
making sure that Viewer dosn't create tables
MaxNumerique Oct 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ build
/src/tests/tests_output/
*.egg-info
.coverage*
.mypy_cache
.mypy_cache
*.db
tests/data
57 changes: 5 additions & 52 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=./requirements.txt --pre ./requirements-internal.in ./requirements.in
# pip-compile --output-file=./requirements.txt --pre ./requirements.in
#
aiohappyeyeballs==2.*,>=2.6.1
# via aiohttp
Expand All @@ -12,54 +12,20 @@ aiosignal==1.*,>=1.4.0
# via aiohttp
attrs==25.*,>=25.3.0
# via aiohttp
blinker==1.*,>=1.9.0
# via
# flask
# opengeodeweb-microservice
click==8.*,>=8.3.0
# via
# flask
# opengeodeweb-microservice
contourpy==1.*,>=1.3.3
# via matplotlib
cycler==0.*,>=0.12.1
# via matplotlib
fastjsonschema==2.*,>=2.21.1
# via opengeodeweb-microservice
flask==3.*,>=3.1.2
# via
# flask-sqlalchemy
# opengeodeweb-microservice
flask-sqlalchemy==3.*,>=3.1.1
# via opengeodeweb-microservice
fonttools==4.*,>=4.60.1
# via matplotlib
frozenlist==1.*,>=1.7.0
# via
# aiohttp
# aiosignal
greenlet==3.*,>=3.2.4
# via
# opengeodeweb-microservice
# sqlalchemy
idna==3.10
# via yarl
itsdangerous==2.*,>=2.2.0
# via
# flask
# opengeodeweb-microservice
jinja2==3.*,>=3.1.6
# via
# flask
# opengeodeweb-microservice
kiwisolver==1.*,>=1.4.10rc0
kiwisolver==1.4.10rc0
# via matplotlib
markupsafe==3.*,>=3.0.2
# via
# flask
# jinja2
# opengeodeweb-microservice
# werkzeug
matplotlib==3.*,>=3.10.6
# via vtk
multidict==6.*,>=6.6.4
Expand All @@ -70,8 +36,6 @@ numpy==2.*,>=2.3.3
# via
# contourpy
# matplotlib
opengeodeweb-microservice==1.*,>=1.0.1rc1
# via -r requirements-internal.in
packaging==25.0
# via matplotlib
pillow==11.*,>=11.3.0
Expand All @@ -80,29 +44,18 @@ propcache==0.*,>=0.3.2
# via
# aiohttp
# yarl
pyparsing==3.*,>=3.3.0a1
pyparsing==3.3.0a1
# via matplotlib
python-dateutil==2.9.*,>=2.9.0.post0
python-dateutil==2.9.0.post0
# via matplotlib
six==1.*,>=1.17.0
# via python-dateutil
sqlalchemy==2.*,>=2.0.43
# via
# flask-sqlalchemy
# opengeodeweb-microservice
typing-extensions==4.*,>=4.15.0
# via
# aiosignal
# opengeodeweb-microservice
# sqlalchemy
# via aiosignal
vtk==9.5.2
# via -r requirements.in
websocket-client==1.*,>=1.8.0
# via -r requirements.in
werkzeug==3.*,>=3.1.3
# via
# flask
# opengeodeweb-microservice
wslink==1.12.4
# via -r requirements.in
yarl==1.*,>=1.20.1
Expand Down
66 changes: 25 additions & 41 deletions src/opengeodeweb_viewer/config.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import os
import tempfile
from shutil import copyfile, copytree
from sys import platform


def default_config():
def default_config() -> None:
os.environ["DEFAULT_HOST"] = "localhost"
os.environ["DEFAULT_PORT"] = "1234"


def prod_config():
def prod_config() -> None:
default_config()
os.environ["DATA_FOLDER_PATH"] = "/data/"


def dev_config():
def dev_config() -> None:
default_config()
if platform == "linux":
os.environ["DATA_FOLDER_PATH"] = "/temp/OpenGeodeWeb_Data/"
Expand All @@ -26,51 +25,36 @@ def dev_config():
os.mkdir(os.environ.get("DATA_FOLDER_PATH"))


def test_config(path):
default_config()

tmp_data_root = tempfile.mkdtemp(prefix="ogw_test_data_")
os.environ["DATA_FOLDER_PATH"] = tmp_data_root

src_data = os.path.join(path, "data")
if not os.path.isdir(src_data):
raise FileNotFoundError(f"Test data folder not found: {src_data}")

test_ids = ["123456789", "12345678"]
valid_exts = {".vtp", ".vti", ".vtu", ".vtm"}

project_uuid = "test-project-uuid"
data_uuid = "test-data-uuid"
uploads_directory = os.path.join(tmp_data_root, project_uuid, "uploads")
structure_directory = os.path.join(tmp_data_root, project_uuid, data_uuid)

for directory in [
*test_ids,
uploads_directory,
structure_directory,
]: # create directories for tests
os.makedirs(
(
os.path.join(tmp_data_root, directory)
if isinstance(directory, str)
else directory
),
exist_ok=True,
)

def _copy_test_assets(
src_data: str,
tmp_data_root: str,
test_ids: list[str],
valid_exts: set[str],
uploads_directory: str,
structure_directory: str,
) -> None:
for root, directories, files in os.walk(src_data):
for directory in directories:
dst = os.path.join(tmp_data_root, test_ids[0], directory)
copytree(os.path.join(root, directory), dst, dirs_exist_ok=True)

for test_id in test_ids:
dst = os.path.join(tmp_data_root, test_id, directory)
copytree(os.path.join(root, directory), dst, dirs_exist_ok=True)
for file in files:
if os.path.splitext(file)[1].lower() not in valid_exts:
continue

src = os.path.join(root, file)
for test_id in test_ids:
copyfile(src, os.path.join(tmp_data_root, test_id, file))
copyfile(src, os.path.join(structure_directory, file))
copyfile(src, os.path.join(uploads_directory, file))

print(f"\nDATA_FOLDER_PATH set to: {tmp_data_root}", flush=True)

def test_config(path: str) -> None:
default_config()
os.environ["DATA_FOLDER_PATH"] = os.path.join(
os.path.dirname(__file__), "..", "..", "tests", "data"
)

os.environ["DATABASE_PATH"] = str(path)
db_file = os.path.join(path, "project.db")
if not os.path.exists(db_file):
open(db_file, "a").close()
Loading
Loading