diff --git a/package/MDAnalysis/analysis/encore/clustering/affinityprop.pyx b/package/MDAnalysis/analysis/encore/clustering/affinityprop.pyx index 9e2642cf755..cd4ba3cf756 100644 --- a/package/MDAnalysis/analysis/encore/clustering/affinityprop.pyx +++ b/package/MDAnalysis/analysis/encore/clustering/affinityprop.pyx @@ -32,6 +32,8 @@ import numpy cimport numpy cimport cython +numpy.import_array() + cdef extern from "ap.h": int CAffinityPropagation(float*, int, float, int, int, bint, long*) diff --git a/package/MDAnalysis/analysis/encore/cutils.pyx b/package/MDAnalysis/analysis/encore/cutils.pyx index c05f6df104b..94b006a64c9 100644 --- a/package/MDAnalysis/analysis/encore/cutils.pyx +++ b/package/MDAnalysis/analysis/encore/cutils.pyx @@ -36,6 +36,7 @@ cimport numpy as np import cython from libc.math cimport sqrt +np.import_array() @cython.boundscheck(False) @cython.wraparound(False) diff --git a/package/MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.pyx b/package/MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.pyx index 43851d5b822..a65eb492a05 100644 --- a/package/MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.pyx +++ b/package/MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.pyx @@ -32,6 +32,7 @@ import logging import numpy cimport numpy +numpy.import_array() cimport cython cdef extern from "spe.h": diff --git a/package/MDAnalysis/lib/_augment.pyx b/package/MDAnalysis/lib/_augment.pyx index 8a906548393..2fee30ce297 100644 --- a/package/MDAnalysis/lib/_augment.pyx +++ b/package/MDAnalysis/lib/_augment.pyx @@ -31,6 +31,8 @@ from MDAnalysis.lib._cutil cimport _dot ,_norm, _cross from libcpp.vector cimport vector +np.import_array() + __all__ = ['augment_coordinates', 'undo_augment'] diff --git a/package/MDAnalysis/lib/_cutil.pyx b/package/MDAnalysis/lib/_cutil.pyx index 4831ba14d8f..fb7ba906279 100644 --- a/package/MDAnalysis/lib/_cutil.pyx +++ b/package/MDAnalysis/lib/_cutil.pyx @@ -35,6 +35,7 @@ from libcpp.vector cimport vector from libcpp.utility cimport pair from cython.operator cimport dereference as deref +np.import_array() __all__ = ['unique_int_1d', 'make_whole', 'find_fragments', '_sarrus_det_single', '_sarrus_det_multiple'] diff --git a/package/MDAnalysis/lib/c_distances.pyx b/package/MDAnalysis/lib/c_distances.pyx index a3b285f561c..53ad25a671f 100644 --- a/package/MDAnalysis/lib/c_distances.pyx +++ b/package/MDAnalysis/lib/c_distances.pyx @@ -32,6 +32,7 @@ Serial versions of all distance calculations cimport cython import numpy cimport numpy +numpy.import_array() cdef extern from "string.h": void* memcpy(void* dst, void* src, int len) diff --git a/package/MDAnalysis/lib/c_distances_openmp.pyx b/package/MDAnalysis/lib/c_distances_openmp.pyx index e831eadd09b..e3b6546bd22 100644 --- a/package/MDAnalysis/lib/c_distances_openmp.pyx +++ b/package/MDAnalysis/lib/c_distances_openmp.pyx @@ -32,6 +32,7 @@ Contains OpenMP versions of the contents of "calc_distances.h" import numpy cimport numpy +numpy.import_array() cdef extern from "string.h": void* memcpy(void* dst, void* src, int len) diff --git a/package/MDAnalysis/lib/formats/cython_util.pxd b/package/MDAnalysis/lib/formats/cython_util.pxd index 0187a243506..9478317f16e 100644 --- a/package/MDAnalysis/lib/formats/cython_util.pxd +++ b/package/MDAnalysis/lib/formats/cython_util.pxd @@ -21,4 +21,5 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # cimport numpy as np +np.import_array() cdef np.ndarray ptr_to_ndarray(void* data_ptr, np.int64_t[:] dim, int data_type) diff --git a/package/MDAnalysis/lib/formats/libdcd.pyx b/package/MDAnalysis/lib/formats/libdcd.pyx index 03864d90f72..689e5500edd 100644 --- a/package/MDAnalysis/lib/formats/libdcd.pyx +++ b/package/MDAnalysis/lib/formats/libdcd.pyx @@ -73,6 +73,8 @@ from libc.stdio cimport SEEK_SET, SEEK_CUR, SEEK_END from libc.stdint cimport uintptr_t from libc.stdlib cimport free +np.import_array() + _whence_vals = {"FIO_SEEK_SET": SEEK_SET, "FIO_SEEK_CUR": SEEK_CUR, "FIO_SEEK_END": SEEK_END} diff --git a/package/MDAnalysis/lib/qcprot.pyx b/package/MDAnalysis/lib/qcprot.pyx index af30f1238e8..951aa481996 100644 --- a/package/MDAnalysis/lib/qcprot.pyx +++ b/package/MDAnalysis/lib/qcprot.pyx @@ -138,6 +138,7 @@ Users will typically use the :func:`CalcRMSDRotationalMatrix` function. import numpy as np cimport numpy as np +np.import_array() from ..due import due, BibTeX, Doi