@@ -531,26 +531,8 @@ static void *PyTimeToJSON(JSOBJ _obj, JSONTypeContext *tc, void *outValue,
531
531
static int NpyTypeToJSONType (PyObject * obj , JSONTypeContext * tc , int npyType ,
532
532
void * value ) {
533
533
PyArray_VectorUnaryFunc * castfunc ;
534
- npy_double doubleVal ;
535
534
npy_int64 longVal ;
536
535
537
- if (PyTypeNum_ISFLOAT (npyType )) {
538
- PRINTMARK ();
539
- castfunc =
540
- PyArray_GetCastFunc (PyArray_DescrFromType (npyType ), NPY_DOUBLE );
541
- if (!castfunc ) {
542
- PyErr_Format (PyExc_ValueError ,
543
- "Cannot cast numpy dtype %d to double" , npyType );
544
- }
545
- castfunc (value , & doubleVal , 1 , NULL , NULL );
546
- if (npy_isnan (doubleVal ) || npy_isinf (doubleVal )) {
547
- PRINTMARK ();
548
- return JT_NULL ;
549
- }
550
- GET_TC (tc )-> doubleValue = (double )doubleVal ;
551
- return JT_DOUBLE ;
552
- }
553
-
554
536
if (PyTypeNum_ISDATETIME (npyType )) {
555
537
PRINTMARK ();
556
538
castfunc =
@@ -581,24 +563,6 @@ static int NpyTypeToJSONType(PyObject *obj, JSONTypeContext *tc, int npyType,
581
563
}
582
564
}
583
565
584
- if (PyTypeNum_ISINTEGER (npyType )) {
585
- PRINTMARK ();
586
- castfunc =
587
- PyArray_GetCastFunc (PyArray_DescrFromType (npyType ), NPY_INT64 );
588
- if (!castfunc ) {
589
- PyErr_Format (PyExc_ValueError , "Cannot cast numpy dtype %d to long" ,
590
- npyType );
591
- }
592
- castfunc (value , & longVal , 1 , NULL , NULL );
593
- GET_TC (tc )-> longValue = (JSINT64 )longVal ;
594
- return JT_LONG ;
595
- }
596
-
597
- if (PyTypeNum_ISBOOL (npyType )) {
598
- PRINTMARK ();
599
- return * ((npy_bool * )value ) == NPY_TRUE ? JT_TRUE : JT_FALSE ;
600
- }
601
-
602
566
PRINTMARK ();
603
567
return JT_INVALID ;
604
568
}
0 commit comments