@@ -167,6 +167,10 @@ def make_or(x, y):
167167 'args' : ('_' , 'axis' ),
168168 'defaults' : (0 ,),
169169 },
170+ "concat" : {
171+ 'args' : ('_' , 'axis' ),
172+ 'defaults' : (0 ,),
173+ },
170174 "empty" : {
171175 'args' : ('shape' , 'dtype' ),
172176 'defaults' : ("numpy.float64" ,),
@@ -2046,6 +2050,173 @@ def update_effects(self, node):
20462050 Iterable [Iterable [complex ]]], NDArray [complex , :, :]],
20472051]
20482052
2053+ _numpy_concat_signature = Union [
2054+ # 1D
2055+ Fun [[Iterable [Iterable [bool ]]], NDArray [bool , :]],
2056+ Fun [[Tuple [Iterable [bool ]]], NDArray [bool , :]],
2057+ Fun [[Tuple [Iterable [bool ], int ]], NDArray [bool , :]],
2058+ Fun [[Tuple [Iterable [bool ], Iterable [bool ]]], NDArray [bool , :]],
2059+ Fun [[Tuple [Iterable [bool ], Iterable [bool ], int ]],
2060+ NDArray [bool , :]],
2061+ Fun [[Tuple [Iterable [bool ], Iterable [bool ],
2062+ Iterable [bool ]]], NDArray [bool , :]],
2063+ Fun [[Tuple [Iterable [bool ], Iterable [bool ],
2064+ Iterable [bool ], int ]], NDArray [bool , :]],
2065+ Fun [[Tuple [Iterable [bool ], Iterable [bool ], Iterable [
2066+ bool ], Iterable [bool ]]], NDArray [bool , :]],
2067+ Fun [[Tuple [Iterable [bool ], Iterable [bool ], Iterable [
2068+ bool ], Iterable [bool ], int ]], NDArray [bool , :]],
2069+
2070+ Fun [[Iterable [Iterable [int ]]], NDArray [int , :]],
2071+ Fun [[Tuple [Iterable [int ]]], NDArray [int , :]],
2072+ Fun [[Tuple [Iterable [int ], int ]], NDArray [int , :]],
2073+ Fun [[Tuple [Iterable [int ], Iterable [int ]]], NDArray [int , :]],
2074+ Fun [[Tuple [Iterable [int ], Iterable [int ], int ]],
2075+ NDArray [int , :]],
2076+ Fun [[Tuple [Iterable [int ], Iterable [int ], Iterable [int ]]],
2077+ NDArray [int , :]],
2078+ Fun [[Tuple [Iterable [int ], Iterable [int ],
2079+ Iterable [int ], int ]], NDArray [int , :]],
2080+ Fun [[Tuple [Iterable [int ], Iterable [int ], Iterable [
2081+ int ], Iterable [int ]]], NDArray [int , :]],
2082+ Fun [[Tuple [Iterable [int ], Iterable [int ], Iterable [
2083+ int ], Iterable [int ], int ]], NDArray [int , :]],
2084+
2085+ Fun [[Iterable [Iterable [float ]]], NDArray [float , :]],
2086+ Fun [[Tuple [Iterable [float ]]], NDArray [float , :]],
2087+ Fun [[Tuple [Iterable [float ], int ]], NDArray [float , :]],
2088+ Fun [[Tuple [Iterable [float ], Iterable [float ]]],
2089+ NDArray [float , :]],
2090+ Fun [[Tuple [Iterable [float ], Iterable [float ], int ]],
2091+ NDArray [float , :]],
2092+ Fun [[Tuple [Iterable [float ], Iterable [float ],
2093+ Iterable [float ]]], NDArray [float , :]],
2094+ Fun [[Tuple [Iterable [float ], Iterable [float ],
2095+ Iterable [float ], int ]], NDArray [float , :]],
2096+ Fun [[Tuple [Iterable [float ], Iterable [float ], Iterable [
2097+ float ], Iterable [float ]]], NDArray [float , :]],
2098+ Fun [[Tuple [Iterable [float ], Iterable [float ], Iterable [
2099+ float ], Iterable [float ], int ]], NDArray [float , :]],
2100+
2101+ Fun [[Iterable [Iterable [complex ]]], NDArray [complex , :]],
2102+ Fun [[Tuple [Iterable [complex ]]], NDArray [complex , :]],
2103+ Fun [[Tuple [Iterable [complex ], int ]], NDArray [complex , :]],
2104+ Fun [[Tuple [Iterable [complex ], Iterable [complex ]]],
2105+ NDArray [complex , :]],
2106+ Fun [[Tuple [Iterable [complex ], Iterable [complex ], int ]],
2107+ NDArray [complex , :]],
2108+ Fun [[Tuple [Iterable [complex ], Iterable [complex ],
2109+ Iterable [complex ]]], NDArray [complex , :]],
2110+ Fun [[Tuple [Iterable [complex ], Iterable [complex ],
2111+ Iterable [complex ], int ]], NDArray [complex , :]],
2112+ Fun [[Tuple [Iterable [complex ], Iterable [complex ], Iterable [
2113+ complex ], Iterable [complex ]]], NDArray [complex , :]],
2114+ Fun [[Tuple [Iterable [complex ], Iterable [complex ], Iterable [
2115+ complex ], Iterable [complex ], int ]], NDArray [complex , :]],
2116+
2117+ # 2D
2118+ Fun [[Iterable [Iterable [Iterable [bool ]]]], NDArray [bool , :, :]],
2119+ Fun [[Tuple [Iterable [Iterable [bool ]]]], NDArray [bool , :, :]],
2120+ Fun [[Tuple [Iterable [Iterable [bool ]], int ]],
2121+ NDArray [bool , :, :]],
2122+ Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [
2123+ Iterable [bool ]]]], NDArray [bool , :, :]],
2124+ Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [
2125+ Iterable [bool ]], int ]], NDArray [bool , :, :]],
2126+ Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [Iterable [bool ]],
2127+ Iterable [Iterable [bool ]]]], NDArray [bool , :, :]],
2128+ Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [Iterable [bool ]],
2129+ Iterable [Iterable [bool ]], int ]],
2130+ NDArray [bool , :, :]],
2131+ Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [Iterable [bool ]],
2132+ Iterable [Iterable [bool ]],
2133+ Iterable [Iterable [bool ]]]],
2134+ NDArray [bool , :, :]],
2135+ Fun [[Tuple [Iterable [Iterable [bool ]],
2136+ Iterable [Iterable [bool ]],
2137+ Iterable [Iterable [bool ]],
2138+ Iterable [Iterable [bool ]], int ]],
2139+ NDArray [bool , :, :]],
2140+
2141+ Fun [[Iterable [Iterable [Iterable [int ]]]], NDArray [int , :, :]],
2142+ Fun [[Tuple [Iterable [Iterable [int ]]]], NDArray [int , :, :]],
2143+ Fun [[Tuple [Iterable [Iterable [int ]], int ]], NDArray [int , :, :]],
2144+ Fun [[Tuple [Iterable [Iterable [int ]], Iterable [
2145+ Iterable [int ]]]], NDArray [int , :, :]],
2146+ Fun [[Tuple [Iterable [Iterable [int ]], Iterable [
2147+ Iterable [int ]], int ]], NDArray [int , :, :]],
2148+ Fun [[Tuple [Iterable [Iterable [int ]], Iterable [Iterable [int ]],
2149+ Iterable [Iterable [int ]]]], NDArray [int , :, :]],
2150+ Fun [[Tuple [Iterable [Iterable [int ]], Iterable [Iterable [int ]],
2151+ Iterable [Iterable [int ]], int ]], NDArray [int , :, :]],
2152+ Fun [[Tuple [Iterable [Iterable [int ]], Iterable [Iterable [int ]],
2153+ Iterable [Iterable [int ]], Iterable [Iterable [int ]]]],
2154+ NDArray [int , :, :]],
2155+ Fun [[Tuple [Iterable [Iterable [int ]], Iterable [Iterable [int ]],
2156+ Iterable [Iterable [int ]], Iterable [Iterable [int ]],
2157+ int ]],
2158+ NDArray [int , :, :]],
2159+
2160+ Fun [[Iterable [Iterable [Iterable [float ]]]],
2161+ NDArray [float , :, :]],
2162+ Fun [[Tuple [Iterable [Iterable [float ]]]], NDArray [float , :, :]],
2163+ Fun [[Tuple [Iterable [Iterable [float ]], int ]],
2164+ NDArray [float , :, :]],
2165+ Fun [[Tuple [Iterable [Iterable [float ]],
2166+ Iterable [Iterable [float ]]]], NDArray [float , :, :]],
2167+ Fun [[Tuple [Iterable [Iterable [float ]],
2168+ Iterable [Iterable [float ]], int ]],
2169+ NDArray [float , :, :]],
2170+ Fun [[Tuple [Iterable [Iterable [float ]],
2171+ Iterable [Iterable [float ]],
2172+ Iterable [Iterable [float ]]]],
2173+ NDArray [float , :, :]],
2174+ Fun [[Tuple [Iterable [Iterable [float ]],
2175+ Iterable [Iterable [float ]],
2176+ Iterable [Iterable [float ]], int ]],
2177+ NDArray [float , :, :]],
2178+ Fun [[Tuple [Iterable [Iterable [float ]],
2179+ Iterable [Iterable [float ]],
2180+ Iterable [Iterable [float ]],
2181+ Iterable [Iterable [float ]]]], NDArray [float , :, :]],
2182+ Fun [[Tuple [Iterable [Iterable [float ]],
2183+ Iterable [Iterable [float ]],
2184+ Iterable [Iterable [float ]],
2185+ Iterable [Iterable [float ]], int ]],
2186+ NDArray [float , :, :]],
2187+
2188+ Fun [[Iterable [Iterable [Iterable [complex ]]]],
2189+ NDArray [complex , :, :]],
2190+ Fun [[Tuple [Iterable [Iterable [complex ]]]],
2191+ NDArray [complex , :, :]],
2192+ Fun [[Tuple [Iterable [Iterable [complex ]], int ]],
2193+ NDArray [complex , :, :]],
2194+ Fun [[Tuple [Iterable [Iterable [complex ]],
2195+ Iterable [Iterable [complex ]]]],
2196+ NDArray [complex , :, :]],
2197+ Fun [[Tuple [Iterable [Iterable [complex ]],
2198+ Iterable [Iterable [complex ]], int ]],
2199+ NDArray [complex , :, :]],
2200+ Fun [[Tuple [Iterable [Iterable [complex ]],
2201+ Iterable [Iterable [complex ]],
2202+ Iterable [Iterable [complex ]]]],
2203+ NDArray [complex , :, :]],
2204+ Fun [[Tuple [Iterable [Iterable [complex ]],
2205+ Iterable [Iterable [complex ]],
2206+ Iterable [Iterable [complex ]], int ]],
2207+ NDArray [complex , :, :]],
2208+ Fun [[Tuple [Iterable [Iterable [complex ]],
2209+ Iterable [Iterable [complex ]],
2210+ Iterable [Iterable [complex ]],
2211+ Iterable [Iterable [complex ]]]],
2212+ NDArray [complex , :, :]],
2213+ Fun [[Tuple [Iterable [Iterable [complex ]],
2214+ Iterable [Iterable [complex ]],
2215+ Iterable [Iterable [complex ]],
2216+ Iterable [Iterable [complex ]], int ]],
2217+ NDArray [complex , :, :]],
2218+ ]
2219+
20492220_numpy_int_binary_op_signature = Union [
20502221 # 1d
20512222 Fun [[bool , bool ], bool ],
@@ -3449,174 +3620,13 @@ def expand_numpy_2_args(args, defaults=None, force=False):
34493620 "ceil" : ConstFunctionIntr (signature = _numpy_float_unary_op_signature ),
34503621 "clip" : ConstMethodIntr (signature = _numpy_ternary_op_signature ),
34513622 "concatenate" : ConstFunctionIntr (
3452- signature = Union [
3453- # 1D
3454- Fun [[Iterable [Iterable [bool ]]], NDArray [bool , :]],
3455- Fun [[Tuple [Iterable [bool ]]], NDArray [bool , :]],
3456- Fun [[Tuple [Iterable [bool ], int ]], NDArray [bool , :]],
3457- Fun [[Tuple [Iterable [bool ], Iterable [bool ]]], NDArray [bool , :]],
3458- Fun [[Tuple [Iterable [bool ], Iterable [bool ], int ]],
3459- NDArray [bool , :]],
3460- Fun [[Tuple [Iterable [bool ], Iterable [bool ],
3461- Iterable [bool ]]], NDArray [bool , :]],
3462- Fun [[Tuple [Iterable [bool ], Iterable [bool ],
3463- Iterable [bool ], int ]], NDArray [bool , :]],
3464- Fun [[Tuple [Iterable [bool ], Iterable [bool ], Iterable [
3465- bool ], Iterable [bool ]]], NDArray [bool , :]],
3466- Fun [[Tuple [Iterable [bool ], Iterable [bool ], Iterable [
3467- bool ], Iterable [bool ], int ]], NDArray [bool , :]],
3468-
3469- Fun [[Iterable [Iterable [int ]]], NDArray [int , :]],
3470- Fun [[Tuple [Iterable [int ]]], NDArray [int , :]],
3471- Fun [[Tuple [Iterable [int ], int ]], NDArray [int , :]],
3472- Fun [[Tuple [Iterable [int ], Iterable [int ]]], NDArray [int , :]],
3473- Fun [[Tuple [Iterable [int ], Iterable [int ], int ]],
3474- NDArray [int , :]],
3475- Fun [[Tuple [Iterable [int ], Iterable [int ], Iterable [int ]]],
3476- NDArray [int , :]],
3477- Fun [[Tuple [Iterable [int ], Iterable [int ],
3478- Iterable [int ], int ]], NDArray [int , :]],
3479- Fun [[Tuple [Iterable [int ], Iterable [int ], Iterable [
3480- int ], Iterable [int ]]], NDArray [int , :]],
3481- Fun [[Tuple [Iterable [int ], Iterable [int ], Iterable [
3482- int ], Iterable [int ], int ]], NDArray [int , :]],
3483-
3484- Fun [[Iterable [Iterable [float ]]], NDArray [float , :]],
3485- Fun [[Tuple [Iterable [float ]]], NDArray [float , :]],
3486- Fun [[Tuple [Iterable [float ], int ]], NDArray [float , :]],
3487- Fun [[Tuple [Iterable [float ], Iterable [float ]]],
3488- NDArray [float , :]],
3489- Fun [[Tuple [Iterable [float ], Iterable [float ], int ]],
3490- NDArray [float , :]],
3491- Fun [[Tuple [Iterable [float ], Iterable [float ],
3492- Iterable [float ]]], NDArray [float , :]],
3493- Fun [[Tuple [Iterable [float ], Iterable [float ],
3494- Iterable [float ], int ]], NDArray [float , :]],
3495- Fun [[Tuple [Iterable [float ], Iterable [float ], Iterable [
3496- float ], Iterable [float ]]], NDArray [float , :]],
3497- Fun [[Tuple [Iterable [float ], Iterable [float ], Iterable [
3498- float ], Iterable [float ], int ]], NDArray [float , :]],
3499-
3500- Fun [[Iterable [Iterable [complex ]]], NDArray [complex , :]],
3501- Fun [[Tuple [Iterable [complex ]]], NDArray [complex , :]],
3502- Fun [[Tuple [Iterable [complex ], int ]], NDArray [complex , :]],
3503- Fun [[Tuple [Iterable [complex ], Iterable [complex ]]],
3504- NDArray [complex , :]],
3505- Fun [[Tuple [Iterable [complex ], Iterable [complex ], int ]],
3506- NDArray [complex , :]],
3507- Fun [[Tuple [Iterable [complex ], Iterable [complex ],
3508- Iterable [complex ]]], NDArray [complex , :]],
3509- Fun [[Tuple [Iterable [complex ], Iterable [complex ],
3510- Iterable [complex ], int ]], NDArray [complex , :]],
3511- Fun [[Tuple [Iterable [complex ], Iterable [complex ], Iterable [
3512- complex ], Iterable [complex ]]], NDArray [complex , :]],
3513- Fun [[Tuple [Iterable [complex ], Iterable [complex ], Iterable [
3514- complex ], Iterable [complex ], int ]], NDArray [complex , :]],
3515-
3516- # 2D
3517- Fun [[Iterable [Iterable [Iterable [bool ]]]], NDArray [bool , :, :]],
3518- Fun [[Tuple [Iterable [Iterable [bool ]]]], NDArray [bool , :, :]],
3519- Fun [[Tuple [Iterable [Iterable [bool ]], int ]],
3520- NDArray [bool , :, :]],
3521- Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [
3522- Iterable [bool ]]]], NDArray [bool , :, :]],
3523- Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [
3524- Iterable [bool ]], int ]], NDArray [bool , :, :]],
3525- Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [Iterable [bool ]],
3526- Iterable [Iterable [bool ]]]], NDArray [bool , :, :]],
3527- Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [Iterable [bool ]],
3528- Iterable [Iterable [bool ]], int ]],
3529- NDArray [bool , :, :]],
3530- Fun [[Tuple [Iterable [Iterable [bool ]], Iterable [Iterable [bool ]],
3531- Iterable [Iterable [bool ]],
3532- Iterable [Iterable [bool ]]]],
3533- NDArray [bool , :, :]],
3534- Fun [[Tuple [Iterable [Iterable [bool ]],
3535- Iterable [Iterable [bool ]],
3536- Iterable [Iterable [bool ]],
3537- Iterable [Iterable [bool ]], int ]],
3538- NDArray [bool , :, :]],
3539-
3540- Fun [[Iterable [Iterable [Iterable [int ]]]], NDArray [int , :, :]],
3541- Fun [[Tuple [Iterable [Iterable [int ]]]], NDArray [int , :, :]],
3542- Fun [[Tuple [Iterable [Iterable [int ]], int ]], NDArray [int , :, :]],
3543- Fun [[Tuple [Iterable [Iterable [int ]], Iterable [
3544- Iterable [int ]]]], NDArray [int , :, :]],
3545- Fun [[Tuple [Iterable [Iterable [int ]], Iterable [
3546- Iterable [int ]], int ]], NDArray [int , :, :]],
3547- Fun [[Tuple [Iterable [Iterable [int ]], Iterable [Iterable [int ]],
3548- Iterable [Iterable [int ]]]], NDArray [int , :, :]],
3549- Fun [[Tuple [Iterable [Iterable [int ]], Iterable [Iterable [int ]],
3550- Iterable [Iterable [int ]], int ]], NDArray [int , :, :]],
3551- Fun [[Tuple [Iterable [Iterable [int ]], Iterable [Iterable [int ]],
3552- Iterable [Iterable [int ]], Iterable [Iterable [int ]]]],
3553- NDArray [int , :, :]],
3554- Fun [[Tuple [Iterable [Iterable [int ]], Iterable [Iterable [int ]],
3555- Iterable [Iterable [int ]], Iterable [Iterable [int ]],
3556- int ]],
3557- NDArray [int , :, :]],
3558-
3559- Fun [[Iterable [Iterable [Iterable [float ]]]],
3560- NDArray [float , :, :]],
3561- Fun [[Tuple [Iterable [Iterable [float ]]]], NDArray [float , :, :]],
3562- Fun [[Tuple [Iterable [Iterable [float ]], int ]],
3563- NDArray [float , :, :]],
3564- Fun [[Tuple [Iterable [Iterable [float ]],
3565- Iterable [Iterable [float ]]]], NDArray [float , :, :]],
3566- Fun [[Tuple [Iterable [Iterable [float ]],
3567- Iterable [Iterable [float ]], int ]],
3568- NDArray [float , :, :]],
3569- Fun [[Tuple [Iterable [Iterable [float ]],
3570- Iterable [Iterable [float ]],
3571- Iterable [Iterable [float ]]]],
3572- NDArray [float , :, :]],
3573- Fun [[Tuple [Iterable [Iterable [float ]],
3574- Iterable [Iterable [float ]],
3575- Iterable [Iterable [float ]], int ]],
3576- NDArray [float , :, :]],
3577- Fun [[Tuple [Iterable [Iterable [float ]],
3578- Iterable [Iterable [float ]],
3579- Iterable [Iterable [float ]],
3580- Iterable [Iterable [float ]]]], NDArray [float , :, :]],
3581- Fun [[Tuple [Iterable [Iterable [float ]],
3582- Iterable [Iterable [float ]],
3583- Iterable [Iterable [float ]],
3584- Iterable [Iterable [float ]], int ]],
3585- NDArray [float , :, :]],
3586-
3587- Fun [[Iterable [Iterable [Iterable [complex ]]]],
3588- NDArray [complex , :, :]],
3589- Fun [[Tuple [Iterable [Iterable [complex ]]]],
3590- NDArray [complex , :, :]],
3591- Fun [[Tuple [Iterable [Iterable [complex ]], int ]],
3592- NDArray [complex , :, :]],
3593- Fun [[Tuple [Iterable [Iterable [complex ]],
3594- Iterable [Iterable [complex ]]]],
3595- NDArray [complex , :, :]],
3596- Fun [[Tuple [Iterable [Iterable [complex ]],
3597- Iterable [Iterable [complex ]], int ]],
3598- NDArray [complex , :, :]],
3599- Fun [[Tuple [Iterable [Iterable [complex ]],
3600- Iterable [Iterable [complex ]],
3601- Iterable [Iterable [complex ]]]],
3602- NDArray [complex , :, :]],
3603- Fun [[Tuple [Iterable [Iterable [complex ]],
3604- Iterable [Iterable [complex ]],
3605- Iterable [Iterable [complex ]], int ]],
3606- NDArray [complex , :, :]],
3607- Fun [[Tuple [Iterable [Iterable [complex ]],
3608- Iterable [Iterable [complex ]],
3609- Iterable [Iterable [complex ]],
3610- Iterable [Iterable [complex ]]]],
3611- NDArray [complex , :, :]],
3612- Fun [[Tuple [Iterable [Iterable [complex ]],
3613- Iterable [Iterable [complex ]],
3614- Iterable [Iterable [complex ]],
3615- Iterable [Iterable [complex ]], int ]],
3616- NDArray [complex , :, :]],
3617- ],
3623+ signature = _numpy_concat_signature ,
36183624 ** _extra_descr ["concatenate" ]
36193625 ),
3626+ "concat" : ConstFunctionIntr (
3627+ signature = _numpy_concat_signature ,
3628+ ** _extra_descr ["concat" ]
3629+ ),
36203630 "complex64" : ConstFunctionIntr (signature = _complex_signature ),
36213631 "complex128" : ConstFunctionIntr (signature = _complex_signature ),
36223632 "complex256" : ConstFunctionIntr (signature = _complex_signature ),
@@ -4578,9 +4588,6 @@ def expand_numpy_2_args(args, defaults=None, force=False):
45784588 },
45794589}
45804590
4581- # numpy alias
4582- MODULES ['numpy' ]['concat' ] = MODULES ['numpy' ]['concatenate' ]
4583-
45844591# PyPy doesn't seem to provide this.
45854592if sys .implementation .name == 'pypy' :
45864593 del MODULES ['array' ]['typecodes' ]
0 commit comments