Comments (11)
Hi and thanks for reporting your issue. It's definitely a strange one and since it is really related to memory, I'll take this chance to say that #66 really helps to track VTK objects remaining in memory ๐
This is the first time I see this error and after diving into C++ code, I can only assume it happens because Delete()
is called twice? Sadly, this is all theory and I can't confirm it but this is the only thing I could see going wrong in SetInstance()
. Sorry for not being of much help.
Reference: https://gitlab.kitware.com/vtk/vtk/-/blob/master/Common/Core/vtkOutputWindow.cxx#L177-189
from pyvistaqt.
Oh bummer, will give vedo a go, anticipating similar results then likely do the same as you.
Appreciate the quick response and tip!
from pyvistaqt.
vedo works without issue leading me to believe it's not a vtk issue. Will try to track down why it works and why pyvista is crashing.
Let me rephrase that, obviously it's not a vtk issue at the root as importing vtk alone works... but rather a vtk issue in the context of vedo / pyvista.
from pyvistaqt.
Thanks for the insight !
If multiple call to Delete()
is an issue I'll look into it since it's highly probable that I wrongly managed deletions...
Will close if it sloves :)
from pyvistaqt.
After some try/die investigations ... it seems to be linked with the interaction between pyvista
/vtk
and QGIS ! ...
how to reproduce (inside QGIS Python console):
import subprocess
from qgis.PyQt.QtCore import QStandardPaths
interpreter = QStandardPaths.findExecutable("python")
command = (
f"{interpreter} -m pip install pyvista --user" # --user so it works even without admin rights (default windows install)
)
# run qgis-python pip
subprocess.check_call(command, shell=True)
import pyvista as pv
then quit QGIS, it should crash ...
from pyvistaqt.
should add that import vtk
works fine
from pyvistaqt.
@T4mmi - Running into this issue in QGIS as well, any luck?
from pyvistaqt.
Actually we didn't ... ๐
So we got rid of pyvista
layer and manage to directly wrap a vtkRenderer
inside QGIS ...
from pyvistaqt.
Just to leave some potentially helpful ideas: rather than skipping pyvista entirely, it's not too difficult to communicate between two Python interpreters: just use a socketserver and communicate. This requires starting a separate Python interpreter, but this is not too difficult to manage (once you've figured out all the subtleties with environmental variables, and how (not) to inherit them).
On the QGIS side:
https://gitlab.com/deltares/imod/qgis-tim/-/blob/master/plugin/qgistim/server_handler.py
On the external interpreter side:
https://gitlab.com/deltares/imod/qgis-tim/-/blob/master/gistim/tim_server.py
Basic idea: you start the interpreter, then the buttons in QGIS just send commands.
This is not great on one side: you can't easily share data in memory. On the other side, fetching data via QGIS and getting it into numpy array form is often inconvenient or slow (non-vectorized). So you have to duplicate the data anyway...
For small bits of data, just serialize everything into json and send that.
The upside is that you can go as crazy as you want with dependencies, as you can rely on a conda/mamba environment with complex binaries, rather than the somewhat dependency-handicapped QGIS Python interpreter.
from pyvistaqt.
Hi,
thanks for the feedback ... but in our end, the point is to bring (a rather small part of) paraview functionnalities to QGIS for end users that are somehow 'allergic' to cmd lines ๐
Anyway with the efforts of vtk
to wrap everything in python we really feel that pyvista
is no longer a good adding since it brings too much complexity in code maintaing.
BUT we still use it for 'power users' coupled with advanced (...) jupyter notebooks.
And BTW thanks @dephora for introducing vedo, i didn't knew it ... is there any link with pyvista ?
from pyvistaqt.
@T4mmi As for the vedo link with pyvista - not that I know of. Funny you mention Paraview as we plan on using it and others which is one of the reasons I'd rather stay with pyvista as it's created / maintained by Kitware employees (or at least one).
from pyvistaqt.
Related Issues (20)
- only one of the subplots work on 4k monitor
- Online documentation not up to date HOT 1
- Lingering references prevent garbage collection
- Segmentation fault on Mac with PyQt5 HOT 2
- Race condition: BackgroundPlotter has no attribute named image HOT 3
- Running pyvistaqt project in Github Action HOT 2
- Inconsistent plotting results with PyVistaQT versus Jupyter (Trame) backends HOT 3
- Issue using pyvistaqt QtInteractor on Windows 10
- MAINT: Deploy docs HOT 7
- solicitud para agregar caracterรญstica, para guardar los modelos en formato obj
- Stage release for PyVista 0.40 HOT 3
- Update GC testing fixture
- MAINT: Remove Azure
- Make the canvas background transparent HOT 1
- X Error of failed request: BadWindow (invalid Window parameter) HOT 3
- Border glitch during resize HOT 6
- macOS `pvqt.BackgroundPlotter` never opens window HOT 1
- DOC: MultiPlotter vs BackgroundPlotter
- no mouse interactivity with BackgroundPlotter HOT 1
- Consider adding `.git_archival.txt` to include version number in git archive
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvistaqt.