@@ -22,20 +22,20 @@ namespace detail
2222ndarray::bitflag numpy_to_bitflag (int const f)
2323{
2424 ndarray::bitflag r = ndarray::NONE;
25- if (f & NPY_C_CONTIGUOUS ) r = (r | ndarray::C_CONTIGUOUS);
26- if (f & NPY_F_CONTIGUOUS ) r = (r | ndarray::F_CONTIGUOUS);
27- if (f & NPY_ALIGNED ) r = (r | ndarray::ALIGNED);
28- if (f & NPY_WRITEABLE ) r = (r | ndarray::WRITEABLE);
25+ if (f & NPY_ARRAY_C_CONTIGUOUS ) r = (r | ndarray::C_CONTIGUOUS);
26+ if (f & NPY_ARRAY_F_CONTIGUOUS ) r = (r | ndarray::F_CONTIGUOUS);
27+ if (f & NPY_ARRAY_ALIGNED ) r = (r | ndarray::ALIGNED);
28+ if (f & NPY_ARRAY_WRITEABLE ) r = (r | ndarray::WRITEABLE);
2929 return r;
3030}
3131
3232int bitflag_to_numpy (ndarray::bitflag f)
3333{
3434 int r = 0 ;
35- if (f & ndarray::C_CONTIGUOUS) r |= NPY_C_CONTIGUOUS ;
36- if (f & ndarray::F_CONTIGUOUS) r |= NPY_F_CONTIGUOUS ;
37- if (f & ndarray::ALIGNED) r |= NPY_ALIGNED ;
38- if (f & ndarray::WRITEABLE) r |= NPY_WRITEABLE ;
35+ if (f & ndarray::C_CONTIGUOUS) r |= NPY_ARRAY_C_CONTIGUOUS ;
36+ if (f & ndarray::F_CONTIGUOUS) r |= NPY_ARRAY_F_CONTIGUOUS ;
37+ if (f & ndarray::ALIGNED) r |= NPY_ARRAY_ALIGNED ;
38+ if (f & ndarray::WRITEABLE) r |= NPY_ARRAY_WRITEABLE ;
3939 return r;
4040}
4141
@@ -119,10 +119,10 @@ ndarray from_data_impl(void * data,
119119 }
120120 int itemsize = dt.get_itemsize ();
121121 int flags = 0 ;
122- if (writeable) flags |= NPY_WRITEABLE ;
123- if (is_c_contiguous (shape, strides, itemsize)) flags |= NPY_C_CONTIGUOUS ;
124- if (is_f_contiguous (shape, strides, itemsize)) flags |= NPY_F_CONTIGUOUS ;
125- if (is_aligned (strides, itemsize)) flags |= NPY_ALIGNED ;
122+ if (writeable) flags |= NPY_ARRAY_WRITEABLE ;
123+ if (is_c_contiguous (shape, strides, itemsize)) flags |= NPY_ARRAY_C_CONTIGUOUS ;
124+ if (is_f_contiguous (shape, strides, itemsize)) flags |= NPY_ARRAY_F_CONTIGUOUS ;
125+ if (is_aligned (strides, itemsize)) flags |= NPY_ARRAY_ALIGNED ;
126126 ndarray r (python::detail::new_reference
127127 (PyArray_NewFromDescr (&PyArray_Type,
128128 incref_dtype (dt),
@@ -243,13 +243,13 @@ ndarray empty(int nd, Py_intptr_t const * shape, dtype const & dt)
243243ndarray array (python::object const & obj)
244244{
245245 return ndarray (python::detail::new_reference
246- (PyArray_FromAny (obj.ptr (), NULL , 0 , 0 , NPY_ENSUREARRAY , NULL )));
246+ (PyArray_FromAny (obj.ptr (), NULL , 0 , 0 , NPY_ARRAY_ENSUREARRAY , NULL )));
247247}
248248
249249ndarray array (python::object const & obj, dtype const & dt)
250250{
251251 return ndarray (python::detail::new_reference
252- (PyArray_FromAny (obj.ptr (), detail::incref_dtype (dt), 0 , 0 , NPY_ENSUREARRAY , NULL )));
252+ (PyArray_FromAny (obj.ptr (), detail::incref_dtype (dt), 0 , 0 , NPY_ARRAY_ENSUREARRAY , NULL )));
253253}
254254
255255ndarray from_object (python::object const & obj, dtype const & dt, int nd_min, int nd_max, ndarray::bitflag flags)
0 commit comments