Skip to content

Commit d31eeb2

Browse files
committed
remove direct support for complex
1 parent 274b37a commit d31eeb2

File tree

1 file changed

+2
-82
lines changed

1 file changed

+2
-82
lines changed

src/_arraykit.c

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -6241,7 +6241,6 @@ AK_TM_transfer(TriMapObject* tm,
62416241
case NPY_UINT8:
62426242
TRANSFER_SCALARS(npy_uint8, npy_uint8); // to, from
62436243
break;
6244-
62456244
case NPY_FLOAT64:
62466245
switch (PyArray_TYPE(array_from)) {
62476246
case NPY_FLOAT64:
@@ -6279,7 +6278,6 @@ AK_TM_transfer(TriMapObject* tm,
62796278
break;
62806279
}
62816280
break;
6282-
62836281
case NPY_FLOAT32:
62846282
switch (PyArray_TYPE(array_from)) {
62856283
case NPY_FLOAT32:
@@ -6302,7 +6300,6 @@ AK_TM_transfer(TriMapObject* tm,
63026300
break;
63036301
}
63046302
break;
6305-
63066303
case NPY_FLOAT16:
63076304
switch (PyArray_TYPE(array_from)) {
63086305
case NPY_FLOAT16:
@@ -6319,85 +6316,6 @@ AK_TM_transfer(TriMapObject* tm,
63196316
break;
63206317
}
63216318
break;
6322-
6323-
// NOTE: full support for scalar to complex requires assigning within complex struct
6324-
case NPY_COMPLEX128:
6325-
switch (PyArray_TYPE(array_from)) {
6326-
case NPY_COMPLEX128:
6327-
TRANSFER_SCALARS(npy_complex128, npy_complex128); // to, from
6328-
break;
6329-
// case NPY_COMPLEX64:
6330-
// TRANSFER_SCALARS(npy_complex128, npy_complex64); // to, from
6331-
// break;
6332-
// case NPY_FLOAT64:
6333-
// TRANSFER_SCALARS(npy_complex128, npy_float64); // to, from
6334-
// break;
6335-
// case NPY_FLOAT32:
6336-
// TRANSFER_SCALARS(npy_complex128, npy_float32); // to, from
6337-
// break;
6338-
// case NPY_FLOAT16:
6339-
// TRANSFER_SCALARS(npy_complex128, npy_float16); // to, from
6340-
// break;
6341-
// case NPY_INT64:
6342-
// TRANSFER_SCALARS(npy_complex128, npy_int64); // to, from
6343-
// break;
6344-
// case NPY_INT32:
6345-
// TRANSFER_SCALARS(npy_complex128, npy_int32); // to, from
6346-
// break;
6347-
// case NPY_INT16:
6348-
// TRANSFER_SCALARS(npy_complex128, npy_int16); // to, from
6349-
// break;
6350-
// case NPY_INT8:
6351-
// TRANSFER_SCALARS(npy_complex128, npy_int8); // to, from
6352-
// break;
6353-
// case NPY_UINT64:
6354-
// TRANSFER_SCALARS(npy_complex128, npy_uint64); // to, from
6355-
// break;
6356-
// case NPY_UINT32:
6357-
// TRANSFER_SCALARS(npy_complex128, npy_uint32); // to, from
6358-
// break;
6359-
// case NPY_UINT16:
6360-
// TRANSFER_SCALARS(npy_complex128, npy_uint16); // to, from
6361-
// break;
6362-
// case NPY_UINT8:
6363-
// TRANSFER_SCALARS(npy_complex128, npy_uint8); // to, from
6364-
// break;
6365-
}
6366-
break;
6367-
6368-
case NPY_COMPLEX64:
6369-
switch (PyArray_TYPE(array_from)) {
6370-
case NPY_COMPLEX64:
6371-
TRANSFER_SCALARS(npy_complex64, npy_complex64); // to, from
6372-
break;
6373-
// case NPY_FLOAT32:
6374-
// TRANSFER_SCALARS(npy_complex64, npy_float32); // to, from
6375-
// break;
6376-
// case NPY_FLOAT16:
6377-
// TRANSFER_SCALARS(npy_complex64, npy_float16); // to, from
6378-
// break;
6379-
// case NPY_INT32:
6380-
// TRANSFER_SCALARS(npy_complex64, npy_int32); // to, from
6381-
// break;
6382-
// case NPY_INT16:
6383-
// TRANSFER_SCALARS(npy_complex64, npy_int16); // to, from
6384-
// break;
6385-
// case NPY_INT8:
6386-
// TRANSFER_SCALARS(npy_complex64, npy_int8); // to, from
6387-
// break;
6388-
// case NPY_UINT32:
6389-
// TRANSFER_SCALARS(npy_complex64, npy_uint32); // to, from
6390-
// break;
6391-
// case NPY_UINT16:
6392-
// TRANSFER_SCALARS(npy_complex64, npy_uint16); // to, from
6393-
// break;
6394-
// case NPY_UINT8:
6395-
// TRANSFER_SCALARS(npy_complex64, npy_uint8); // to, from
6396-
// break;
6397-
}
6398-
break;
6399-
6400-
// unicode
64016319
case NPY_UNICODE: {
64026320
TRANSFER_FLEXIBLE(Py_UCS4);
64036321
break;
@@ -6468,6 +6386,8 @@ AK_TM_transfer(TriMapObject* tm,
64686386
break;
64696387
}
64706388
default:
6389+
// NOTE: full support for scalar to complex requires assigning within complex struct
6390+
// better to use PyArray_CastToType
64716391
PyErr_SetString(PyExc_TypeError, "No handling for types");
64726392
return -1;
64736393
}

0 commit comments

Comments
 (0)