Skip to content

Commit

Permalink
fixing import statements
Browse files Browse the repository at this point in the history
  • Loading branch information
SwayamInSync committed Sep 16, 2024
1 parent 25dd6b3 commit b719ba4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions quaddtype/numpy_quaddtype/src/umath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ static int
quad_ufunc_promoter(PyUFuncObject *ufunc, PyArray_DTypeMeta *op_dtypes[],
PyArray_DTypeMeta *signature[], PyArray_DTypeMeta *new_op_dtypes[])
{
printf("calling promoter for ufunc %s\n", ufunc->name);
int nin = ufunc->nin;
int nargs = ufunc->nargs;
PyArray_DTypeMeta *common = NULL;
Expand Down Expand Up @@ -560,7 +561,6 @@ create_quad_comparison_ufunc(PyObject *numpy, const char *ufunc_name)
PyArray_DTypeMeta *dtypes[3] = {&QuadPrecDType, &QuadPrecDType, &PyArray_BoolDType};

PyType_Slot slots[] = {
{NPY_METH_resolve_descriptors, (void *)&quad_binary_op_resolve_descriptors},
{NPY_METH_strided_loop, (void *)&quad_generic_comp_strided_loop<sleef_comp, ld_comp>},
{0, NULL}};

Expand All @@ -579,7 +579,7 @@ create_quad_comparison_ufunc(PyObject *numpy, const char *ufunc_name)
}

PyObject *promoter_capsule =
PyCapsule_New((void *)&quad_ufunc_promoter, "numpy._ufunc_promoter", NULL);
PyCapsule_New((void *)&comparison_ufunc_promoter, "numpy._ufunc_promoter", NULL);
if (promoter_capsule == NULL) {
return -1;
}
Expand Down
8 changes: 1 addition & 7 deletions quaddtype/tests/test_quaddtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import operator

from quaddtype import QuadPrecDType, QuadPrecision
from numpy_quaddtype import QuadPrecDType, QuadPrecision


def test_create_scalar_simple():
Expand All @@ -17,12 +17,6 @@ def test_basic_equality():
"12.0") == QuadPrecision("12.00")


@pytest.mark.parametrize("val", ["123532.543", "12893283.5"])
def test_scalar_repr(val):
expected = f"QuadPrecision('{str(QuadPrecision(val))}')"
assert repr(QuadPrecision(val)) == expected


@pytest.mark.parametrize("op", ["add", "sub", "mul", "truediv", "pow"])
@pytest.mark.parametrize("other", ["3.0", "12.5", "100.0"])
def test_binary_ops(op, other):
Expand Down

0 comments on commit b719ba4

Please sign in to comment.