question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PVGeo + python, ErrorObserver not muting vtk

See original GitHub issue

Bug description I’m running in Python outside of Paraview.

When a vtk error occurs, a python exception is successfully raised by the ErrorObserver but the original vtk raw error is still printed.

To Reproduce I used a slighty modified version of the code snippet provided in PVGeo._helpers.errors

#!/usr/bin/env python3
import PVGeo

def main():
	f = PVGeo.AlgorithmBase()
	f.Update()
	if f.error_occurred():
		print("PVGeo Error message ==>", f.get_error_message())


if __name__ == "__main__":
    main()

The output: image

  1. First error is the raw vtk error
  2. Next is the error printed by the helper
  3. Third is the error manually printed by the code snippet

The part that is bothering me is the raw vtk error. From what I understand adding an error observer was supposed to catch the vtk error and make it “transparent”. Also the vtk raw error is not outputting in stdout.

Consequently if the error management is working (exceptions still fired) the terminal output is messy.

Concerned installation

  • MacOS
  • Python 3.7.4
  • Packages :
appdirs==1.4.4
espatools==0.1.0
imageio==2.9.0
importlib-metadata==1.7.0
meshio==4.0.16
numpy==1.19.0
pandas==1.0.5
Pillow==7.2.0
properties==0.6.1
PVGeo==2.1.0
python-dateutil==2.8.1
pytz==2020.1
pyvista==0.25.3
scipy==1.5.1
scooby==0.5.6
six==1.15.0
vectormath==0.2.2
vtk==9.0.1
xmltodict==0.12.0
zipp==3.1.0

(only PVGeo was installed through pip)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
FlorianFSAcommented, Jul 14, 2020
1reaction
FlorianFSAcommented, Jul 14, 2020

Thanks for the confirmation of the expected behavior !

For information, if this issue is bothering someone else, I tried to fiddle around within the source of PVGeo searching for a magical vtk option with no luck. I tried a lot of things with vtkOutputWindow but non of them worked.

I only managed to completely shut down all form of error management by calling the ‘’‘[vtkObject].GlobalWarningDisplayOff()’‘’ function (for a specific object or globally).

But this function prevent the triggering of the ErrorObserver and thus break the exception handling, which actually makes sense. It can be used but must be used knowingly.

Since the exception handling is working perfectly well as is, I chose to ignore these unwanted outputs and wait for a fix from vtk.

From what I understand this is a known issue ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VTK 9 Python observer fired on ErrorEvent not muting ... - GitLab
Since VTK 9, using an observer no longer mute the original raw error from VTK ... Here is a short simplified code snippet...
Read more >
problem with VTK on Windows · Issue #59 · OpenGeoVis/PVGeo
Hello, I have Anaconda on Windows 10 and I have problems installing PVGeo. Anaconda is up-to-date: Anaconda 3 2019.10 with Python 3.7.4.
Read more >
Getting Started — PVGeo documentation
Python package of VTK-based algorithms to analyze geoscientific data and models.
Read more >
[RemoteView] vtk_server.py not works because vtk.web ...
Hi,. I am a front-end developer. And not know much about vtk C++. I get started by follow the doc of Getting Started...
Read more >
Current status of PVGeo and Paraview
I tried setting up a similar Anaconda environment with Python 3.7.4 but it did not work, possibly because I had trouble getting VTK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found