Skip to content

Commit

Permalink
Use numpy.intc for indexes, not int32
Browse files Browse the repository at this point in the history
We use 'int' internally for particle indexes,
not int32_t, so use numpy.intc in Python.
This *should* fix usage of ParticleIndex in
Windows builds.
  • Loading branch information
benmwebb committed Dec 17, 2024
1 parent 3c5c844 commit a09771d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/kernel/pyext/IMP_kernel.numpy.i
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ PyObject *_get_sphere_derivatives_numpy(IMP::Model *m, PyObject *m_pyobj)
%}
}

// Always treat particle indexes as numpy.int32 when using numpy
// Always treat particle indexes as numpy.intc when using numpy
#if IMP_KERNEL_HAS_NUMPY
%pythoncode %{
try:
import numpy
ParticleIndex = numpy.int32
ParticleIndex = numpy.intc
except ImportError:
pass
%}
Expand Down

0 comments on commit a09771d

Please sign in to comment.