From 9facfdd4fc7ef4fd9dbcfc4a94134ff8ae318aef Mon Sep 17 00:00:00 2001 From: German Date: Fri, 7 Jul 2023 14:49:43 +0200 Subject: [PATCH 1/3] fixing import warning --- ansys/mapdl/reader/__init__.py | 8 +++++++- ansys/mapdl/reader/misc.py | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ansys/mapdl/reader/__init__.py b/ansys/mapdl/reader/__init__.py index d3dd2ebb..cde0fac4 100644 --- a/ansys/mapdl/reader/__init__.py +++ b/ansys/mapdl/reader/__init__.py @@ -3,7 +3,13 @@ import appdirs # Per contract with Sphinx-Gallery, this method must be available at top level -from pyvista.utilities.sphinx_gallery import _get_sg_image_scraper +try: + # for pyvista >= 0.40 + from pyvista.plotting.utilities import _get_sg_image_scraper +except ImportError: + from pyvista.utilities.sphinx_gallery import _get_sg_image_scraper + + from ansys.mapdl.reader import examples from ansys.mapdl.reader._version import __version__ diff --git a/ansys/mapdl/reader/misc.py b/ansys/mapdl/reader/misc.py index 7d3f99d4..b6cb5a0c 100644 --- a/ansys/mapdl/reader/misc.py +++ b/ansys/mapdl/reader/misc.py @@ -6,7 +6,15 @@ import numpy as np import pyvista -from pyvista.utilities.errors import GPUInfo + +from pyvista import PyVistaDeprecationWarning + +try: + # for pyvista >= 0.40 + from pyvista.report import GPUInfo +except ImportError: + from pyvista.utilities.errors import GPUInfo + import scooby From 8c819098beb8e9557699c605e474d31886db846b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 12:53:05 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- ansys/mapdl/reader/__init__.py | 1 - ansys/mapdl/reader/misc.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ansys/mapdl/reader/__init__.py b/ansys/mapdl/reader/__init__.py index cde0fac4..db498d6c 100644 --- a/ansys/mapdl/reader/__init__.py +++ b/ansys/mapdl/reader/__init__.py @@ -10,7 +10,6 @@ from pyvista.utilities.sphinx_gallery import _get_sg_image_scraper - from ansys.mapdl.reader import examples from ansys.mapdl.reader._version import __version__ from ansys.mapdl.reader.archive import ( diff --git a/ansys/mapdl/reader/misc.py b/ansys/mapdl/reader/misc.py index b6cb5a0c..a2b01864 100644 --- a/ansys/mapdl/reader/misc.py +++ b/ansys/mapdl/reader/misc.py @@ -6,7 +6,6 @@ import numpy as np import pyvista - from pyvista import PyVistaDeprecationWarning try: @@ -14,7 +13,7 @@ from pyvista.report import GPUInfo except ImportError: from pyvista.utilities.errors import GPUInfo - + import scooby From 8178ac84240355865fb030a7de926b71e421b0ca Mon Sep 17 00:00:00 2001 From: German Date: Fri, 7 Jul 2023 15:10:43 +0200 Subject: [PATCH 3/3] Removing unused import --- ansys/mapdl/reader/misc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ansys/mapdl/reader/misc.py b/ansys/mapdl/reader/misc.py index a2b01864..fc84ca22 100644 --- a/ansys/mapdl/reader/misc.py +++ b/ansys/mapdl/reader/misc.py @@ -6,7 +6,6 @@ import numpy as np import pyvista -from pyvista import PyVistaDeprecationWarning try: # for pyvista >= 0.40