Skip to content

Commit

Permalink
add support for UGrid name change
Browse files Browse the repository at this point in the history
  • Loading branch information
j042 committed Jan 11, 2024
1 parent 762d449 commit 78e0d15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions gustaf/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
# @linux it raises error if vedo is imported inside the function.
try:
import vedo

# class name UGrid is deprecated since 2023.5.0
# After *.5.1 release, we could remove this part by bumping min. version
# requirement
if vedo.__version__ < "2023.5.0":
vedoUGrid = vedo.UGrid
else:
vedoUGrid = vedo.UnstructuredGrid
except ImportError as err:
# overwrites the vedo module with an object which will throw an error
# as soon as it is used the first time. This means that any non vedo
Expand All @@ -20,6 +28,7 @@
from gustaf.helpers.raise_if import ModuleImportRaiser

vedo = ModuleImportRaiser("vedo", err)
vedoUGrid = vedo


# enable `gus.show()`
Expand Down
2 changes: 1 addition & 1 deletion gustaf/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _initialize_showable(self):

to_vtktype = {"tet": frau_tetra, "hexa": herr_hexa}
grid_type = to_vtktype[self._helpee.whatami]
u_grid = show.vedo.UGrid(
u_grid = show.vedoUGrid(
[
self._helpee.const_vertices,
self._helpee.const_volumes,
Expand Down

0 comments on commit 78e0d15

Please sign in to comment.