liedllab / gisttools

Post-processing of data generated by the GIST (Grid Inhomogeneous Solvation Theory) action in cpptraj
GNU General Public License v3.0
6 stars 4 forks source link

Numba typing errror in projection_mean #10

Closed askamenik closed 1 year ago

askamenik commented 1 year ago

Hi guys, I am using cpptraj AmberTools23 and the latest gisttools version and I get the typing error below. Using the example files with the current gisttools version raises the same error. Any Idea how to fix it?

XOXO A

TypingError: Failed in nopython mode pipeline (step: nopython frontend) Failed in nopython mode pipeline (step: nopython frontend) Invalid use of Function() with argument(s) of type(s): (int64, int64, dtype=class(int64))

File "gisttools/grid.py", line 843: def _surrounding_box_edges(shape, delta, origin, center, radius):

xyz_max = _minimum(xyz_max.astype(np.int_), shape - 1)
x_ind = np.arange(xyz_min[0], xyz_max[0] + 1, dtype=np.int_)
^

[1] During: resolving callee type: type(CPUDispatcher(<function _surrounding_box_edges at 0x2b139c34c510>)) [2] During: typing of call at /home/s1165102/Quail/dG_solv/GIST/CSAA470166_funi/05_analysis/gisttools/grid.py (867)

File "gisttools/grid.py", line 867: def _surrounding_sphere(

# surrounding_box_edges tests that shape is int
x_indices, y_indices, z_indices = _surrounding_box_edges(shape, delta, origin, center, radius)
^
fwaibl commented 1 year ago

Hi,

sadly, I don't know this error, but I would like to have a look at it. Could you check which version of numba you have installed, so that I can try to reproduce it?

Best, Franz

askamenik commented 1 year ago

Thanks franz, much appreciated! numba 0.43.1

Best, Anna

fwaibl commented 1 year ago

I ran some tests, and it seems that everything works fine with numba 0.51 or newer, and fails with older versions. Would it be ok for you to update to a newer version?

There is also a numpy version of the grid searching functions, I just never implemented a way to switch between them...

askamenik commented 1 year ago

wonderful, upgrading numba did the trick! Thank you for saving the day Franz :)

fwaibl commented 1 year ago

Thanks for bringing this up, I updated the requirements accordingly.

Note that the CI is currently failing due to a mdtraj/Cython incompatibility. I hope that this will be fixed soon. Meanwhile, if you want to install it, you can install the dependencies manually via conda and then run python setup.py install