Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 1 addition & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.14
# by the following command:
#
# pip-compile --output-file=./requirements.txt ./requirements.in
Expand Down Expand Up @@ -52,10 +52,6 @@ python-dateutil==2.9.0.post0
# via matplotlib
six==1.*
# via python-dateutil
typing-extensions==4.*
# via
# aiohttp
# aiosignal
vtk==9.6.2
# via -r requirements.in
websocket-client==1.8.0
Expand All @@ -65,4 +61,3 @@ wslink==2.6.0
yarl==1.*
# via aiohttp

opengeodeweb-microservice==1.*,>=1.3.2
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://docs.astral.sh/ruff/configuration/

target-version = "py312"
target-version = "py314"
line-length = 100
indent-width = 4
extend-exclude = ["**/schemas/**"] # generated schemas
Expand Down
7 changes: 5 additions & 2 deletions src/opengeodeweb_viewer/object/object_methods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from typing import TYPE_CHECKING

# Third party imports
from vtkmodules.vtkCommonDataModel import (
Expand All @@ -13,10 +14,12 @@
)

# Local application imports
from opengeodeweb_viewer.utils_functions import ColorClassProtocol
from opengeodeweb_viewer.vtk_pipeline import VtkPipeline
from opengeodeweb_viewer.vtk_protocol import VtkView

if TYPE_CHECKING:
from opengeodeweb_viewer.utils_functions import ColorClassProtocol
from opengeodeweb_viewer.vtk_pipeline import VtkPipeline

logger = logging.getLogger(__name__)


Expand Down
7 changes: 5 additions & 2 deletions src/opengeodeweb_viewer/rpc/generic/generic_protocols.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Standard library imports
from pathlib import Path
from typing import TYPE_CHECKING

# Third party imports
from opengeodeweb_microservice.schemas import get_schemas_dict

from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView
from opengeodeweb_viewer.rpc.model.model_protocols import VtkModelView
from opengeodeweb_viewer.typed_rpc import typed_rpc

# Local application imports
from opengeodeweb_viewer.vtk_protocol import VtkView

from . import schemas

if TYPE_CHECKING:
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView
from opengeodeweb_viewer.rpc.model.model_protocols import VtkModelView


class VtkGenericView(VtkView):
generic_prefix = "opengeodeweb_viewer.generic."
Expand Down
6 changes: 5 additions & 1 deletion src/opengeodeweb_viewer/rpc/protocols.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Local application imports
from opengeodeweb_viewer.vtk_protocol import VtkView

from typing import TYPE_CHECKING

from .mesh.cells.attribute.cell.cells_attribute_cell_protocols import VtkMeshCellsAttributeCellView
from .mesh.cells.attribute.vertex.cells_attribute_vertex_protocols import (
Expand Down Expand Up @@ -69,6 +70,9 @@
)
from .model.surfaces.points.model_surfaces_points_protocols import VtkModelSurfacesPointsView

if TYPE_CHECKING:
from opengeodeweb_viewer.vtk_protocol import VtkView

MESH_PROTOCOLS: tuple[type[VtkView], ...] = (
VtkMeshPointsView,
VtkMeshPointsAttributeVertexView,
Expand Down
9 changes: 6 additions & 3 deletions src/opengeodeweb_viewer/typed_rpc.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Standard library imports
import functools
import os
from collections.abc import Callable
from dataclasses import fields
from typing import Any, Concatenate, Protocol, cast
from typing import TYPE_CHECKING, Any, Concatenate, Protocol, cast

# Third party imports
import fastjsonschema # type: ignore[import-untyped]
from dataclasses_json import DataClassJsonMixin
from opengeodeweb_microservice.schemas import Route
from wslink import register # type: ignore[import-untyped]

# Local application imports
from opengeodeweb_viewer.utils_functions import RpcParams, validate_schema

if TYPE_CHECKING:
from collections.abc import Callable

from opengeodeweb_microservice.schemas import Route

TYPED_RPC_MARKER = "__typed_rpc__"


Expand Down
6 changes: 4 additions & 2 deletions src/opengeodeweb_viewer/utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

# Standard library imports
# Third party imports
from typing import Protocol
from typing import TYPE_CHECKING, Protocol

import fastjsonschema # type: ignore[import-untyped]
from opengeodeweb_microservice.schemas import SchemaDict
from vtkmodules.vtkRenderingCore import vtkColorTransferFunction

if TYPE_CHECKING:
from opengeodeweb_microservice.schemas import SchemaDict

logger = logging.getLogger(__name__)


Expand Down
18 changes: 10 additions & 8 deletions src/opengeodeweb_viewer/vtk_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
# Standard library imports
import math
from dataclasses import dataclass, field
from typing import Literal, TypedDict, cast
from typing import TYPE_CHECKING, Literal, TypedDict, cast

# Local application imports
from opengeodeweb_microservice.database.data_types import (
ViewerElementsType,
ViewerType,
)
from vtkmodules.vtkCommonDataModel import (
vtkBoundingBox,
vtkCompositeDataSet,
Expand All @@ -20,17 +16,14 @@
vtkSelectionNode,
vtkVector2d,
)
from vtkmodules.vtkCommonExecutionModel import vtkAlgorithm
from vtkmodules.vtkCommonTransforms import vtkTransform
from vtkmodules.vtkFiltersCore import vtkAppendFilter, vtkThreshold
from vtkmodules.vtkFiltersExtraction import (
vtkExtractGeometry,
vtkExtractSelection,
)
from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter, vtkTransformFilter
from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter
from vtkmodules.vtkFiltersSources import vtkLineSource, vtkSphereSource
from vtkmodules.vtkIOXML import vtkXMLReader
from vtkmodules.vtkRenderingAnnotation import (
vtkScalarBarActor,
)
Expand All @@ -57,6 +50,15 @@
create_color_transfer_function,
)

if TYPE_CHECKING:
from opengeodeweb_microservice.database.data_types import (
ViewerElementsType,
ViewerType,
)
from vtkmodules.vtkCommonExecutionModel import vtkAlgorithm
from vtkmodules.vtkFiltersCore import vtkAppendFilter, vtkThreshold
from vtkmodules.vtkIOXML import vtkXMLReader

logger = logging.getLogger(__name__)


Expand Down
23 changes: 13 additions & 10 deletions src/opengeodeweb_viewer/vtk_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import math
import os
from pathlib import Path
from typing import cast
from typing import TYPE_CHECKING, cast

import vtkmodules.vtkRenderingOpenGL2 # noqa: F401 registers the OpenGL render window backend

Expand All @@ -27,31 +27,34 @@
from vtkmodules.vtkFiltersExtraction import vtkExtractGeometry
from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter
from vtkmodules.vtkImagingCore import vtkExtractVOI
from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget
from vtkmodules.vtkRenderingAnnotation import (
vtkAxesActor,
vtkCubeAxesActor,
vtkScalarBarActor,
)
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkCellPicker,
vtkCompositePolyDataMapper,
vtkRenderer,
vtkRenderWindow,
)
from vtkmodules.vtkWebCore import vtkWebApplication
from vtkmodules.web import protocols as vtk_protocols

from opengeodeweb_viewer.rpc.viewer.schemas.clipping_planes import Plane
from opengeodeweb_viewer.rpc.viewer.schemas.slice import SliceElement
from opengeodeweb_viewer.rpc.viewer.schemas.threshold import Attribute, Location
from opengeodeweb_viewer.vtk_pipeline import (
RulerPipeline,
ViewerData,
VtkPipeline,
)

if TYPE_CHECKING:
from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget
from vtkmodules.vtkRenderingAnnotation import (
vtkAxesActor,
vtkCubeAxesActor,
vtkScalarBarActor,
)
from vtkmodules.vtkWebCore import vtkWebApplication

from opengeodeweb_viewer.rpc.viewer.schemas.clipping_planes import Plane
from opengeodeweb_viewer.rpc.viewer.schemas.slice import SliceElement

logger = logging.getLogger(__name__)

MAX_DATA_NAME_LENGTH = 22
Expand Down
10 changes: 6 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import shutil
import tempfile
import xml.etree.ElementTree as ET
from collections.abc import Callable, Generator
from pathlib import Path
from typing import Any, ClassVar
from typing import TYPE_CHECKING, Any, ClassVar

import msgpack # type: ignore[import-untyped]
import pytest
Expand All @@ -21,6 +20,9 @@
from opengeodeweb_viewer.config import TestConfig
from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView

if TYPE_CHECKING:
from collections.abc import Callable, Generator

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -182,7 +184,7 @@ class Starter(ProcessStarter): # type: ignore[misc]


@pytest.fixture
def server(xprocess: XProcess) -> Generator[ServerMonitor, None, None]:
def server(xprocess: XProcess) -> Generator[ServerMonitor]:
name, starter, monitor_class = HELPER.get_xprocess_args(TEST_PROJECT_FOLDER_PATH)
os.environ["PYTHON_ENV"] = "test"
_, log = xprocess.ensure(name, starter)
Expand All @@ -195,7 +197,7 @@ def server(xprocess: XProcess) -> Generator[ServerMonitor, None, None]:


@pytest.fixture(scope="session", autouse=True)
def configure_test_environment() -> Generator[None, None, None]:
def configure_test_environment() -> Generator[None]:
app_config = TestConfig(TEST_PROJECT_FOLDER_PATH)
db_path = Path(app_config.DATA_FOLDER_PATH) / "project.db"
init_database(db_path=db_path)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Standard library imports
from collections.abc import Callable

from typing import TYPE_CHECKING

from opengeodeweb_viewer.rpc.mesh.cells.attribute.cell.cells_attribute_cell_protocols import (
VtkMeshCellsAttributeCellView,
Expand All @@ -9,7 +10,11 @@
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView

# Local application imports
from tests.conftest import ServerMonitor

if TYPE_CHECKING:
from collections.abc import Callable

from tests.conftest import ServerMonitor

# Local constants
mesh_id = "12345678901234567890123456789012"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Standard library imports
from collections.abc import Callable

from typing import TYPE_CHECKING

from opengeodeweb_viewer.rpc.mesh.cells.attribute.vertex.cells_attribute_vertex_protocols import (
VtkMeshCellsAttributeVertexView,
Expand All @@ -9,7 +10,11 @@
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView

# Local application imports
from tests.conftest import ServerMonitor

if TYPE_CHECKING:
from collections.abc import Callable

from tests.conftest import ServerMonitor

# Local constants
mesh_id = "12345678901234567890123456789012"
Expand Down
9 changes: 7 additions & 2 deletions tests/mesh/cells/test_mesh_cells_protocols.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Standard library imports
from collections.abc import Callable

from typing import TYPE_CHECKING

from opengeodeweb_viewer.rpc.mesh.cells.cells_protocols import VtkMeshCellsView

Expand All @@ -8,7 +9,11 @@
from opengeodeweb_viewer.rpc.viewer.viewer_protocols import VtkViewerView

# Local application imports
from tests.conftest import ServerMonitor

if TYPE_CHECKING:
from collections.abc import Callable

from tests.conftest import ServerMonitor

# Local constants
mesh_id = "12345678901234567890123456789012"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Standard library imports
from collections.abc import Callable

from typing import TYPE_CHECKING

from opengeodeweb_viewer.rpc.mesh.edges.attribute.edge.edges_attribute_edge_protocols import (
VtkMeshEdgesAttributeEdgeView,
Expand All @@ -9,7 +10,11 @@
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView

# Local application imports
from tests.conftest import ServerMonitor

if TYPE_CHECKING:
from collections.abc import Callable

from tests.conftest import ServerMonitor

# Local constants
mesh_id = "12345678901234567890123456789012"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Standard library imports
from collections.abc import Callable

from typing import TYPE_CHECKING

from opengeodeweb_viewer.rpc.mesh.edges.attribute.vertex.edges_attribute_vertex_protocols import (
VtkMeshEdgesAttributeVertexView,
Expand All @@ -9,7 +10,11 @@
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView

# Local application imports
from tests.conftest import ServerMonitor

if TYPE_CHECKING:
from collections.abc import Callable

from tests.conftest import ServerMonitor

# Local constants
mesh_id = "12345678901234567890123456789012"
Expand Down
Loading
Loading