Skip to content

Commit bbd5125

Browse files
PProfiziakaszynski
andauthored
Remove restraint of vtk<9.1.0 (#132)
* Remove restrain on vtk<9.1.0 * Use the new DpfPlotter instead of the old. * Revert "Use the new DpfPlotter instead of the old." This reverts commit 8abdec8. * Remove problematic line to test the rest * Output info on renderer * Force renderer info * Comment out other plotting tests * revert changes * conditional VTK version for testing * fix python_requires * conditionally disable lighting * Fix naming error * Remove matplotlib requirements as well since a dependency of PyVista * Remove doctest +SKIP * Add a global conftest for doctest * Revert "Add a global conftest for doctest" This reverts commit 078b647. * Revert "Remove doctest +SKIP" This reverts commit 0534ef7. Co-authored-by: Alex Kaszynski <[email protected]>
1 parent 93d6fa9 commit bbd5125

File tree

6 files changed

+31
-9
lines changed

6 files changed

+31
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
strategy:
122122
fail-fast: false
123123
matrix:
124-
python-version: ["3.8", "3.9"]
124+
python-version: ["3.8", "3.9", "3.10"]
125125
os: ["windows-latest", "ubuntu-latest"]
126126

127127
steps:

ansys/dpf/post/result_data.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
user will be able to use to compute through the DPF Post API.
33
44
This is a fields container wrapper."""
5-
65
from textwrap import wrap
76

87
from ansys.dpf.core import FieldsContainer, Operator
@@ -296,7 +295,7 @@ def plot_contour(
296295
>>> solution = post.load_solution(examples.download_all_kinds_of_complexity())
297296
>>> stress = solution.stress(location=post.locations.nodal)
298297
>>> sx = stress.xx
299-
>>> pl = sx.plot_contour("time", [1], off_screen=True)
298+
>>> pl = sx.plot_contour("time", [1], off_screen=True) # doctest: +SKIP
300299
301300
The labels can be obtained using:
302301
@@ -348,7 +347,7 @@ def plot_contour(
348347
else:
349348
# sorts and creates a new fields_container with only the desired labels
350349
fc = self._sort_fields_container_with_labels(option_id, display_option)
351-
# Call Plotter.plot_contour (to change for use of DpfPlotter
350+
352351
pl.plot_contour(fc, **kwargs)
353352

354353
def _plot_chart(self):

requirements/requirements_docs.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
pypandoc==1.8.1
2-
matplotlib==3.5.3
32
imageio==2.21.1
43
imageio-ffmpeg==0.4.7
54
Sphinx==5.1.1

requirements/requirements_test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pytest==7.1.2
1+
coverage==6.4.4
22
pytest-cov==3.0.0
33
pytest-rerunfailures==10.2
4-
coverage==6.4.4
4+
pytest==7.1.2

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@
3737
"Programming Language :: Python :: 3.7",
3838
"Programming Language :: Python :: 3.8",
3939
"Programming Language :: Python :: 3.9",
40+
"Programming Language :: Python :: 3.10",
4041
],
41-
python_requires=">=3.7.*,!=3.10.*",
42+
python_requires=">=3.7.*,<4.0",
4243
extras_require={
43-
"plotting": ["vtk<9.1.0", "pyvista>=0.24.0", "matplotlib"],
44+
"plotting": ["pyvista>=0.24.0"],
4445
},
4546
install_requires=install_requires,
4647
license='MIT',

tests/conftest.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Launch or connect to a persistent local DPF service to be shared in
44
pytest as a sesson fixture
55
"""
6+
import re
67
import os
78

89
import pytest
@@ -16,6 +17,28 @@
1617
pv.OFF_SCREEN = True
1718
mpl.use("Agg")
1819

20+
21+
def get_lighting():
22+
"""Get lighting configuration.
23+
24+
Disable lighting when using OSMesa on Windows. See:
25+
https://github.com/pyvista/pyvista/issues/3185
26+
27+
"""
28+
pl = pv.Plotter(notebook=False, off_screen=True)
29+
pl.add_mesh(pv.Sphere())
30+
pl.show(auto_close=False)
31+
gpu_info = pl.ren_win.ReportCapabilities();
32+
pl.close()
33+
34+
regex = re.compile("OpenGL version string:(.+)\n")
35+
version = regex.findall(gpu_info)[0]
36+
return not(os.name == 'nt' and 'Mesa' in version)
37+
38+
39+
pv.global_theme.lighting = get_lighting()
40+
41+
1942
# currently running dpf on docker. Used for testing on CI
2043
running_docker = os.environ.get("DPF_DOCKER", False)
2144

0 commit comments

Comments
 (0)