GithubHelp home page GithubHelp logo

Comments (22)

laserman781 avatar laserman781 commented on July 18, 2024 1

Plotter

It seems to work fine this way

from pyvista-support.

rgangrade avatar rgangrade commented on July 18, 2024 1

I was experiencing the same issue. Tried researching a bit and used %matplotlib qt before the scene. Works fine for me. I am quite new to Python so this may not be a great solution, but it works fine!

from pyvista-support.

GuillaumeFavelier avatar GuillaumeFavelier commented on July 18, 2024 1

I'll close this since it has been taken care of by pyvista/pyvista#502

The fix is now available in the version 0.23.0 of pyvista !

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

Can you provide code to reproduce this?

Sent with GitHawk

from pyvista-support.

laserman781 avatar laserman781 commented on July 18, 2024

This is the code producing the error:
I tired restarting the kernal and the same thing happens every time...

@interact_calc(holes='Enter file path', blocks='Enter file path')
def selection(holes, blocks):
    with out:
        clear_output()
        if blocks != 'Enter file path':
            grid = pv.read(blocks+'.vtk')
        H = pv.read(holes+'.vtk')
        h = widgets.SelectMultiple(options=DH['Name'],description='Drillholes',disabled=False)
        print('Specific Query')
    @interact_calc(select=dh,regex='Enter selection')
    def plot(select,regex):
        with out:
            clear_output()
            if regex != 'Enter selection':
                extracted = query(H,'Name',regex)
            else:
                extracted = query(H,'Name',select)
            print(extracted)
        @interact_calc(savename = 'Enter extracted drillholes name')
        def plot(savename):
            with out:
                clear_output()
                extracted.save(savename+'.vtk')
                print('saved')
                p = pv.Plotter() 
                surface = extracted.extract_surface()  # Extract the outer surface
                cells = surface.cell_centers()   # Grabb the cell centers
                p.add_mesh(extracted, show_edges=True)
                p.add_point_labels(cells, cells.active_scalar_name)
                p.remove_scalar_bar()
                if blocks != 'Enter file path':
                    p.add_mesh(grid)
                p.show()

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

I have a feeling this has to do with the fact that you have two plot functions in your namespace... try renaming the second one.

from pyvista-support.

laserman781 avatar laserman781 commented on July 18, 2024

So I fixed this, and still the same issue...

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

I cannot reproduce anything from what you shared... can you provide a simplified, reproducible example?

Also, maybe screen captures of what you're experiencing? And a more detailed explanation of this phenomena...

from pyvista-support.

laserman781 avatar laserman781 commented on July 18, 2024

Here is a more simplified code where I receive the same issue...
I have attached a screen capture of the issue I am seeing. (I just realized)
Plotter-Issue

import pyvista as pv
DH = pv.read('sample_drillholes.vtk')
p = pv.Plotter(notebook = False)
p.add_mesh(DH, show_edges=True)
p.remove_scalar_bar()
p.show()

from pyvista-support.

laserman781 avatar laserman781 commented on July 18, 2024

I just realized my gif didn't come out right...

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

Huh that’s very strange. Can you share a report from that same notebook:

import pyvista as pv
print(pv.Report())

Sent with GitHawk

from pyvista-support.

laserman781 avatar laserman781 commented on July 18, 2024

See below:

--------------------------------------------------------------------------------
  Date: Thu Aug 22 10:40:16 2019 Eastern Daylight Time

           Windows : OS
                 4 : CPU(s)
             AMD64 : Machine
             64bit : Architecture
           11.7 GB : RAM
           Jupyter : Environment

  Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]

            0.22.0 : pyvista
             8.1.2 : vtk
            1.16.4 : numpy
             2.5.0 : imageio
             1.4.3 : appdirs
             0.4.3 : scooby
             3.1.0 : matplotlib
   Version unknown : PyQt5
             7.6.1 : IPython
             7.5.0 : ipywidgets
             1.0.0 : colorcet

  Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for
  Intel(R) 64 architecture applications

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

And you noticed this only after upgrading to version 0.22.0?

Sent with GitHawk

from pyvista-support.

laserman781 avatar laserman781 commented on July 18, 2024

This was never an issue until just recently...

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

Would you please also run the same code from a Python interpreter on the command line to see if it happens there too?

Sent with GitHawk

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

That's good to hear it is at least working from the command line.

I'll investigate a bit further to see if I can reproduce this - currently I have no idea why you are experiencing this issue in Jupyter notebooks.

In that same notebook where the issue appears, could you print the following:

import pyvista as pv
print('OFF_SCREEN: ', pv.OFF_SCREEN)

from pyvista-support.

laserman781 avatar laserman781 commented on July 18, 2024

I receive this:
OFF_SCREEN: False

I've tried creating new notebooks, reinstalling PyVista and I get the same issue every time

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

very, very strange. Try this snippet as well just in case...

import pyvista as pv
DH = pv.read('sample_drillholes.vtk')
p = pv.Plotter(notebook=False, off_screen=False)
p.add_mesh(DH, show_edges=True)
p.remove_scalar_bar()
p.show()

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

And then try this.... with the auto_close flag

import pyvista as pv
DH = pv.read('sample_drillholes.vtk')
p = pv.Plotter(notebook=False, off_screen=False)
p.add_mesh(DH, show_edges=True)
p.remove_scalar_bar()
p.show(auto_close=False)

from pyvista-support.

laserman781 avatar laserman781 commented on July 18, 2024

In the first one, the same things happen. The second one works fine, although if I run the first one, and then run the second one after it crashes and the kernel dies.

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

@laserman781, are you still experiencing this issue?

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024

Thanks, @rgangrade! That's a weird fix, so I'll have to take a look at what's going on there

from pyvista-support.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.