Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/distances.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ HaversineUnrolledWrapper(PyObject* self, PyObject* args)
&mAltEnd,
&mRadiusSphere))
return NULL;
if (((radLatStart = get_numpy_array(radLatStart)) == NULL) || ((radLonStart = get_numpy_array(radLonStart)) == NULL) || ((mAltStart = get_numpy_array(mAltStart)) == NULL) || ((radLatEnd = get_numpy_array(radLatEnd)) == NULL) || ((radLonEnd = get_numpy_array(radLonEnd)) == NULL) || ((mAltEnd = get_numpy_array(mAltEnd)) == NULL))
if (((radLatStart = get_numpy_array((PyObject*)radLatStart)) == NULL) || ((radLonStart = get_numpy_array((PyObject*)radLonStart)) == NULL) || ((mAltStart = get_numpy_array((PyObject*)mAltStart)) == NULL) || ((radLatEnd = get_numpy_array((PyObject*)radLatEnd)) == NULL) || ((radLonEnd = get_numpy_array((PyObject*)radLonEnd)) == NULL) || ((mAltEnd = get_numpy_array((PyObject*)mAltEnd)) == NULL))
return NULL;
PyArrayObject *arrays[] = {radLatStart, radLonStart, mAltStart, radLatEnd, radLonEnd, mAltEnd};
if (check_arrays_same_float_dtype(6, arrays) == 0) {
Expand Down Expand Up @@ -199,8 +199,8 @@ HaversineRolledWrapper(PyObject* self, PyObject* args)
// checks
if (!PyArg_ParseTuple(args, "OOd", &rrmStart, &rrmEnd, &mRadiusSphere))
return NULL;
rrmStart = get_numpy_array(rrmStart);
rrmEnd = get_numpy_array(rrmEnd);
rrmStart = get_numpy_array((PyObject*)rrmStart);
rrmEnd = get_numpy_array((PyObject*)rrmEnd);
if (PyErr_Occurred())
return NULL;
if (check_arrays_same_float_dtype(2, (PyArrayObject *[]){rrmStart, rrmEnd}) == 0) {
Expand Down
18 changes: 9 additions & 9 deletions include/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ WrapWrapper(PyObject* self, PyObject* args)
return NULL;

// convert inputs to numpy arrays
PyArrayObject *val = get_numpy_array(arg1);
PyArrayObject *minVal = get_numpy_array(arg2);
PyArrayObject *maxVal = get_numpy_array(arg3);
PyArrayObject *val = get_numpy_array((PyObject*)arg1);
PyArrayObject *minVal = get_numpy_array((PyObject*)arg2);
PyArrayObject *maxVal = get_numpy_array((PyObject*)arg3);
if (val == NULL || minVal == NULL || maxVal == NULL)
return NULL;
PyArrayObject *arrays[] = {val, minVal, maxVal};
Expand Down Expand Up @@ -305,8 +305,8 @@ RadAngularDifferenceWrapper(PyObject* self, PyObject* args)
}

// convert to numpy array
PyArrayObject* radAngleStart = get_numpy_array(arg1);
PyArrayObject* radAngleEnd = get_numpy_array(arg2);
PyArrayObject* radAngleStart = get_numpy_array((PyObject*)arg1);
PyArrayObject* radAngleEnd = get_numpy_array((PyObject*)arg2);
PyArrayObject *arrays[] = {radAngleStart, radAngleEnd};
if (radAngleStart == NULL || radAngleEnd == NULL)
return NULL;
Expand Down Expand Up @@ -363,8 +363,8 @@ DegAngularDifferenceWrapper(PyObject* self, PyObject* args)
}

// convert to numpy array
PyArrayObject* degAngleStart = get_numpy_array(arg1);
PyArrayObject* degAngleEnd = get_numpy_array(arg2);
PyArrayObject* degAngleStart = get_numpy_array((PyObject*)arg1);
PyArrayObject* degAngleEnd = get_numpy_array((PyObject*)arg2);
if (degAngleStart == NULL || degAngleEnd == NULL)
return NULL;
PyArrayObject *arrays[] = {degAngleStart, degAngleEnd};
Expand Down Expand Up @@ -413,7 +413,7 @@ RRM2DDMWrapper(PyObject* self, PyObject* args)
if (!PyArg_ParseTuple(args, "O!", &PyArray_Type, &rrmPoint))
return NULL;

rrmPoint = get_numpy_array(rrmPoint);
rrmPoint = get_numpy_array((PyObject*)rrmPoint);
if (check_arrays_same_float_dtype(1, (PyArrayObject *[]){rrmPoint}) == 0)
rrmPoint = (PyArrayObject *)PyArray_CastToType(rrmPoint, PyArray_DescrFromType(NPY_FLOAT64), 0);
PyArrayObject* result_array = (PyArrayObject*)PyArray_SimpleNew(PyArray_NDIM(rrmPoint),
Expand Down Expand Up @@ -449,7 +449,7 @@ DDM2RRMWrapper(PyObject* self, PyObject* args)
if (!PyArg_ParseTuple(args, "O!", &PyArray_Type, &ddmPoint))
return NULL;

ddmPoint = get_numpy_array(ddmPoint);
ddmPoint = get_numpy_array((PyObject*)ddmPoint);
if (check_arrays_same_float_dtype(1, (PyArrayObject *[]){ddmPoint}) == 0)
ddmPoint = (PyArrayObject *)PyArray_CastToType(ddmPoint, PyArray_DescrFromType(NPY_FLOAT64), 0);
PyArrayObject* result_array = (PyArrayObject*)PyArray_SimpleNew(PyArray_NDIM(ddmPoint),
Expand Down
Loading
Loading