File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: Apache-2.0
2+ # SPDX-FileCopyrightText: Copyright 2023-2024 TotalEnergies.
3+ # SPDX-FileContributor: Kitware
4+ # ruff: noqa
5+ import pyvista as pv
6+ from pathlib import Path
7+
8+ from trame_server import Server
9+ from trame_server .state import State
10+ from trame_vuetify .ui .vuetify3 import VAppLayout
11+
12+ from geos .trame .app .core import GeosTrame
13+ from tests .trame_fixtures import trame_server_layout , trame_state
14+
15+
16+ def test_data_loader ( trame_server_layout : tuple [ Server , VAppLayout ], trame_state : State ) -> None :
17+ root_path = Path ( __file__ ).parent .absolute ().__str__ ()
18+ file_name = root_path + "/data/geosDeck/geosDeck.xml"
19+
20+ geos_trame = GeosTrame ( trame_server_layout [ 0 ], file_name )
21+
22+ geos_trame .data_loader .load_vtkmesh_from_id ( "Problem/Mesh/0/VTKMesh/0" )
23+ ug : pv .UnstructuredGrid = geos_trame .data_loader .region_viewer .input
24+ assert ug .GetCellData ().HasArray ( "attribute" )
25+ assert ug .GetPointData ().HasArray ( "RandomPointScalars" )
26+ assert not ug .GetPointData ().HasArray ( "RandomPointVectors" )
27+ assert ug .GetPointData ().HasArray ( "RandomPointVectors_0" )
28+ assert ug .GetPointData ().HasArray ( "RandomPointVectors_1" )
29+ assert ug .GetPointData ().HasArray ( "RandomPointVectors_2" )
30+ assert not ug .GetPointData ().HasArray ( "RandomPointVectors_3" )
You can’t perform that action at this time.
0 commit comments