Skip to content

Commit

Permalink
Fix numpy's new behavior in np.sum of passing int(0) for some reason. (
Browse files Browse the repository at this point in the history
…#212)

Also, don't use `@jit` any more; just `@njit`.
Fixes #209
Fixes #211
  • Loading branch information
moble authored Feb 13, 2023
1 parent b23734f commit e294cc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/numpy_quaternion.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,16 @@ static int QUATERNION_setitem(PyObject* item, quaternion* qp, void* NPY_UNUSED(a
if(element == NULL) { return -1; } /* Not a sequence, or other failure */
qp->z = PyFloat_AsDouble(element);
Py_DECREF(element);
} else if(PyFloat_Check(item)) {
qp->w = PyFloat_AS_DOUBLE(item);
qp->x = 0.0;
qp->y = 0.0;
qp->z = 0.0;
} else if(PyLong_Check(item)) {
qp->w = PyLong_AsDouble(item);
qp->x = 0.0;
qp->y = 0.0;
qp->z = 0.0;
} else {
PyErr_SetString(PyExc_TypeError,
"Unknown input to QUATERNION_setitem");
Expand Down
2 changes: 1 addition & 1 deletion src/quaternion/calculus.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _derivative_3d(f, t, dfdt):
return


@jit
@njit
def fd_indefinite_integral(f, t):
Sfdt = np.empty_like(f)
Sfdt[0] = 0.0
Expand Down

0 comments on commit e294cc9

Please sign in to comment.