2020class FullTypeDescr (object ):
2121 pass
2222
23+ class FuncNameSuffix (object ):
24+ """Stores the suffix to append when generating functions names.
25+ """
26+ def __init__ (self , suffix ):
27+ self .suffix = suffix
28+
2329class TypeDescription (object ):
2430 """Type signature for a ufunc.
2531
@@ -795,6 +801,30 @@ def english_upper(s):
795801 None ,
796802 TD (flts ),
797803 ),
804+ 'ldexp' :
805+ Ufunc (2 , 1 , None ,
806+ docstrings .get ('numpy.core.umath.ldexp' ),
807+ None ,
808+ [TypeDescription ('e' , None , 'ei' , 'e' ),
809+ TypeDescription ('f' , None , 'fi' , 'f' ),
810+ TypeDescription ('e' , FuncNameSuffix ('long' ), 'el' , 'e' ),
811+ TypeDescription ('f' , FuncNameSuffix ('long' ), 'fl' , 'f' ),
812+ TypeDescription ('d' , None , 'di' , 'd' ),
813+ TypeDescription ('d' , FuncNameSuffix ('long' ), 'dl' , 'd' ),
814+ TypeDescription ('g' , None , 'gi' , 'g' ),
815+ TypeDescription ('g' , FuncNameSuffix ('long' ), 'gl' , 'g' ),
816+ ],
817+ ),
818+ 'frexp' :
819+ Ufunc (1 , 2 , None ,
820+ docstrings .get ('numpy.core.umath.frexp' ),
821+ None ,
822+ [TypeDescription ('e' , None , 'e' , 'ei' ),
823+ TypeDescription ('f' , None , 'f' , 'fi' ),
824+ TypeDescription ('d' , None , 'd' , 'di' ),
825+ TypeDescription ('g' , None , 'g' , 'gi' ),
826+ ],
827+ )
798828}
799829
800830if sys .version_info [0 ] >= 3 :
@@ -854,7 +884,7 @@ def make_arrays(funcdict):
854884 thedict = chartotype1 # one input and one output
855885
856886 for t in uf .type_descriptions :
857- if t .func_data not in (None , FullTypeDescr ):
887+ if t .func_data not in (None , FullTypeDescr ) and not isinstance ( t . func_data , FuncNameSuffix ) :
858888 funclist .append ('NULL' )
859889 astype = ''
860890 if not t .astype is None :
@@ -880,6 +910,10 @@ def make_arrays(funcdict):
880910 tname = english_upper (chartoname [t .type ])
881911 datalist .append ('(void *)NULL' )
882912 funclist .append ('%s_%s_%s_%s' % (tname , t .in_ , t .out , name ))
913+ elif isinstance (t .func_data , FuncNameSuffix ):
914+ datalist .append ('(void *)NULL' )
915+ tname = english_upper (chartoname [t .type ])
916+ funclist .append ('%s_%s_%s' % (tname , name , t .func_data .suffix ))
883917 else :
884918 datalist .append ('(void *)NULL' )
885919 tname = english_upper (chartoname [t .type ])
0 commit comments