[yt-users] Type issues with grids

Steve Spicklemire spicklemire at uindy.edu
Fri Jun 24 03:36:46 PDT 2016


Hi YT folks,

I’m trying to help a colleague who has encountered a problem on Windows. I’ve used the same code on my mac and it’s OK. ;-(

The traceback is below. 

He’s following an intro tutorial, but using his own data. He’s using an anaconda install but he’s updated yt to 3.2.3. It seems when he calls ‘cam.draw_grids(im)’ the grid drawing process fails when it hits the cython function ‘lines’:

        px, py, dz = self.project_to_plane(vertices, res=im.shape[:2])
        
        # Must normalize the image
        nim = im.rescale(inline=False)
        enhance_rgba(nim)
        nim.add_background_color('black', inline=True)

        # we flipped it in snapshot to get the orientation correct, so
        # flip the lines
        lines(nim.d, px.d, py.d, colors, 24, flip=1)

I think px.d, py.d are somehow ending up as ‘long’ rather than ‘int64’. I guess on my system those may be the same type. Maybe on his, they are not?

Thoughts? Thanks!

Here’s the traceback:

 File "<ipython-input-7-6167d268a46c>", line 1, in <module>
    runfile('C:/Users/UIndyUser/Documents/Research/Haverhals/multiple_slice_vis.py', wdir='C:/Users/UIndyUser/Documents/Research/Haverhals')

  File "C:\Users\UIndyUser\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile
    execfile(filename, namespace)

  File "C:\Users\UIndyUser\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "C:/Users/UIndyUser/Documents/Research/Haverhals/multiple_slice_vis.py", line 111, in <module>
    nim = cam.draw_grids(im)

  File "C:\Users\UIndyUser\Anaconda2\lib\site-packages\yt\visualization\volume_rendering\camera.py", line 326, in draw_grids
    lines(nim.d, px.d, py.d, colors, 24, flip=1)

  File "yt\utilities\lib\misc_utilities.pyx", line 215, in yt.utilities.lib.misc_utilities.lines (build\src.win-amd64-2.7\yt\utilities\lib\misc_utilities.c:4881)

ValueError: Buffer dtype mismatch, expected 'int64_t' but got ‘long'

thanks,
-steve

Steve Spicklemire
University of Indianapolis
Lilly Science Hall 232B
Dept. of Physics and Earth Space Sciences
Shaheen College of Arts and Sciences
spicklemire at uindy.edu  (317) 788-3313

Confidentiality Notice: This communication and/or its content are for the sole use of the intended recipient,and may be privileged, confidential, or otherwise protected from disclosure by law.  If you are not the intended recipient, please notify the sender and then delete all copies of it.  Unless you are the intended recipient, your use or dissemination of the information contained in this communication may be illegal.



More information about the yt-users mailing list