-
Notifications
You must be signed in to change notification settings - Fork 25
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
Result._plot_point_scalars: Use argument return_cpos in any case and fix screenshot function on Windows OS #73
Conversation
... before, it was used only, when `if animate`. Now, it used in any case of the call `plotter.show`.
pyvista\plotting\plotting.py:4882: On Windows OS "in the event that the user hits the exit-button on the GUI then it must be finalized and deleted as accessing it will kill the kernel... proper screenshots cannot be saved if this happens" Therefore, when you used ´_plot_point_scalars(..., screenshot=...)´, you got at ansys\mapdl\reader\rst.py:2830: ´RuntimeError: This plotter is closed and unable to save a screenshot.´ The only solution is, to pass the ´screenshot´ argument to ´plotter.show´ as done in this patch.
... the old version would break with version 1.0.0. I used the same compare operation as in <https://github.com/rbarrois/python-semanticversion/blob/master/semantic_version/base.py> tested manually.
elif screenshot is True: | ||
cpos, img = plotter.show(interactive=interactive, | ||
window_size=window_size, | ||
full_screen=full_screen, | ||
screenshot=screenshot, | ||
**show_kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cleaner. Thanks!
This still needs to be fixed upstream in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with all the changes.
@beppo-dd, do you need this out soon in a patch release?
@akaszynski, Thank you for your kind and fast responses! No, I do not need a soon patch release. For me my local patch is sufficient. |
Was this issue fixed finally ? I am having the same problem that python crashes once i close the plot. I work on Mac (macOS Sonoma 14.4.1 ) . Thank you |
@cecidip Yes, this issue was fixed finally. It was merged to the main branch with commit 827437a. This fix was released with v0.53.0. |
if animate
. Now, it used in any case of the callplotter.show
. I tested the changes of 56f38f1 on Windows 10._plot_point_scalars(..., screenshot=...)
, you got at ansys\mapdl\reader\rst.py:2830:RuntimeError: This plotter is closed and unable to save a screenshot.
The only solution is, to pass the
screenshot
argument toplotter.show
as done in the commit d5ad42d.