This warning message is shown
C:\Python37\lib\site-packages\pyvista\plotting\plotting.py:3909: UserWarning: `auto_close` ignored: by clicking the exit button, you have destroyed the render window and we have to close it out.
when I close the window created by this code:
import pyvista as pv
grid = pv.UniformGrid((10, 20, 5))
grid.plot(show_edges=True)
However, this same message is not shown when I close the window created by this other code, which uses the Plotter class:
import pyvista as pv
grid = pv.UniformGrid((10, 20, 5))
plotter = pv.Plotter()
plotter.add_mesh(grid, show_edges=True)
plotter.show()
The scooby report:
--------------------------------------------------------------------------------
Date: Wed Jun 10 13:38:30 2020 Hora oficial do Brasil
OS : Windows
CPU(s) : 4
Machine : AMD64
Architecture : 64bit
RAM : 7.9 GB
Environment : Python
Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64
bit (AMD64)]
pyvista : 0.25.2
vtk : 9.0.0
PyQt5 : 5.15.0
pyvistaqt : 0.1.0
numpy : 1.17.3
scipy : 1.4.1
IPython : 7.15.0
matplotlib : 3.2.1
scooby : 0.5.2
--------------------------------------------------------------------------------
Attention: the PyVista version 0.22.0 doesn't produce the warning message in question.
Hi and welcome! Thanks for posting your first issue in the PyVista project! Someone from @pyvista/developers will chime in before too long. If your question is support related, it may be automatically transferred to https://github.com/pyvista/pyvista-support
Looks like auto_close=False is set to False somewhere along the way. For the time being, pass auto_close=False to grid.plot. Did you change your rcParms?
auto_close=False in grid.plot:>>> import pyvista as pv
>>> grid = pv.UniformGrid((10, 20, 5))
>>> grid.plot(show_edges=True, auto_close=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python37\lib\site-packages\pyvista\plotting\helpers.py", line 111, in plot
plotter.add_mesh(var_item, **kwargs)
File "C:\Python37\lib\site-packages\pyvista\plotting\plotting.py", line 1311, in add_mesh
assert_empty_kwargs(**kwargs)
File "C:\Python37\lib\site-packages\pyvista\utilities\errors.py", line 255, in assert_empty_kwargs
raise TypeError(message)
TypeError: "auto_close" is an invalid keyword argument for `add_mesh`
auto_close=False in rcParams:>>> import pyvista as pv
>>> pv.rcParams['auto_close'] = False
>>> grid = pv.UniformGrid((10, 20, 5))
>>> grid.plot(show_edges=True)
C:\Python37\lib\site-packages\pyvista\plotting\plotting.py:3909: UserWarning: `auto_close` ignored: by clicking the exit button, you have destroyed the render window and we have to close it out.
warnings.warn("`auto_close` ignored: by clicking the exit button, you have destroyed the render window and we have to close it out.")
[(28.369640898475662, 33.369640898475666, 25.869640898475662),
(4.5, 9.5, 2.0),
(0.0, 0.0, 1.0)]
We're going to look into this. Thanks for reporting it!
Most helpful comment
We're going to look into this. Thanks for reporting it!