malcolmw / pykonal

Travel-time calculator based on the fast-marching method solution to the Eikonal equation.
https://malcolmw.github.io/pykonal-docs/
GNU General Public License v3.0
147 stars 54 forks source link

Error in pykonal.solver.EikonalSolver(coord_sys="cartesian").trial.push(*idx) #7

Closed hatsyim closed 3 years ago

hatsyim commented 3 years ago

I tried the notebooks provided under this link. I am running on Windows 10 with Python 3.7.7 and Pykonal 0.3.2b1 package.

ValueError Traceback (most recent call last)

in 15 solver.unknown[src_idx] = False 16 # Add source node to *Trial*. ---> 17 solver.trial.push(*src_idx) 18 # Solve the system. 19 solver.solve() pykonal\solver.pyx in pykonal.solver.EikonalSolver.trial.__get__() pykonal\heapq.pyx in pykonal.heapq.Heap.__init__() ValueError: Buffer dtype mismatch, expected 'Py_ssize_t' but got 'long'
malcolmw commented 3 years ago

@hatsyim Thanks for reporting this bug.

This is a Windows-specific bug that has to do with the internal representations of the int data type in Python and Py_ssize_t data type in the C API. The type casting is handled automatically on Linux and OSX but fails on Windows. I am looking into the proper solution to this problem.

Thanks again for reporting.

malcolmw commented 3 years ago

This is a peculiar bug, the fix for which on Windows—at least the one that I tried—breaks the code on Linux. Fixing this is low priority until this is a larger base of users on Windows, so I am closing this as not going to fix until then.