Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for UGrid name change #180

Merged
merged 1 commit into from
Jan 23, 2024
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
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
Loading