Skip to content

Commit

Permalink
Make numpy2 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettSJohnson committed Aug 28, 2024
1 parent 0a41392 commit 758cec3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions layer2/ObjectMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5596,6 +5596,7 @@ static int ObjectMapNumPyArrayToMapState(PyMOLGlobals * G, ObjectMapState * ms,
void * ptr;

#ifdef _PYMOL_NUMPY
import_array1(0);
PyArrayObject * pao = (PyArrayObject *) ary;
const int itemsize = PyArray_ITEMSIZE(pao);
#endif
Expand Down
2 changes: 1 addition & 1 deletion modules/chempy/brick.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def from_numpy(cls, data, grid, origin=(0.0, 0.0, 0.0)):
@param range: 3f sequence
@param origin: 3f sequence
'''
data = numpy.asfarray(data)
data = numpy.asarray(data, dtype=numpy.float64)
assert len(data.shape) == 3

self = cls()
Expand Down

0 comments on commit 758cec3

Please sign in to comment.