cupy / cupy

NumPy & SciPy for GPU
https://cupy.dev
MIT License
9.36k stars 843 forks source link

[Tracker] Fix signature mismatch with NumPy/SciPy #6693

Open kmaehashi opened 2 years ago

kmaehashi commented 2 years ago

I found some functions have different signature than NumPy/SciPy (e.g. some arguments are keyword-only in NumPy but not in CuPy). We should check and fix them.

Note: This list is not exhaustive (I'll try to complete the list but may take some time). If you find any functions with different signature leave a comment in this issue.

andfoy commented 2 years ago

NumPy mismatch

After comparing each signature (across all namespaces) between NumPy and CuPy by using this script https://gist.github.com/andfoy/5ad7e4c10fb82e851b5e359ae44d6eba, it is possible to conclude that the following functions' signatures present a mismatch between CuPy and their corresponding counterpart in NumPy.

Notes

  1. The following functions require a manual inspection, since some of them are defined as ufuncs or builtin functions rather than proper functions, which prevent inspect.signature from working: cupy.arange, cupy.array, cupy.asanyarray, cupy.asarray, cupy.ascontiguousarray, cupy.asfortranarray, cupy.empty, cupy.frombuffer, cupy.fromfile, cupy.fromiter, cupy.fromstring, cupy.random.default_rng, cupy.random.ranf, cupy.random.sample, cupy.random.seed, cupy.zeros, numpy.fix, numpy.i0, numpy.sinc, numpy.size. The functions that present a mismatch are included on the table below.
  2. The NumPy version used locally depends on the changes of https://github.com/numpy/numpy/pull/17818 and https://github.com/numpy/numpy/pull/21975

main namespace

Function Observations
all where: extra arg on numpy, is kwarg
alltrue a: extra arg on cupy, is kwarg
axis: extra arg on cupy, is kwarg
out: extra arg on cupy, is kwarg
keepdims: extra arg on cupy, is kwarg
args: extra arg on numpy, is non-kwarg
kwargs: extra arg on numpy, is non-kwarg
amax initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
amin initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
any where: extra arg on numpy, is kwarg
arange like: extra arg on numpy, is kwarg
argmax dtype: extra arg on cupy, is kwarg
argmin dtype: extra arg on cupy, is kwarg
argpartition kind: extra arg on numpy, is kwarg
order: extra arg on numpy, is kwarg
argsort order: extra arg on numpy, is kwarg
array like: extra arg on numpy, is kwarg
array2string max_line_width: extra arg on numpy, is kwarg
args: extra arg on cupy, is kwarg
precision: extra arg on numpy, is kwarg
kwargs: extra arg on cupy, is kwarg
suppress_small: extra arg on numpy, is kwarg
separator: extra arg on numpy, is kwarg
prefix: extra arg on numpy, is kwarg
style: extra arg on numpy, is kwarg
formatter: extra arg on numpy, is kwarg
threshold: extra arg on numpy, is kwarg
edgeitems: extra arg on numpy, is kwarg
sign: extra arg on numpy, is kwarg
floatmode: extra arg on numpy, is kwarg
suffix: extra arg on numpy, is kwarg
legacy: extra arg on numpy, is kwarg
array_str arr: extra arg on cupy, is kwarg
a: extra arg on numpy, is non-kwarg
asanyarray like: extra arg on numpy, is kwarg
asarray like: extra arg on numpy, is kwarg
ascontiguousarray like: extra arg on numpy, is kwarg
asfortranarray like: extra arg on numpy, is kwarg
broadcast_arrays subok: extra arg on numpy, is kwarg
broadcast_to subok: extra arg on numpy, is kwarg
clip kwargs: extra arg on numpy, is non-kwarg
concatenate tup: extra arg on cupy, is kwarg
arrays: extra arg on numpy, is non-kwarg
copy subok: extra arg on numpy, is kwarg
corrcoef a: extra arg on cupy, is kwarg
x: extra arg on numpy, is non-kwarg
count_nonzero keepdims: extra arg on numpy, is kwarg
cov a: extra arg on cupy, is kwarg
m: extra arg on numpy, is non-kwarg
cumproduct a: extra arg on cupy, is kwarg
axis: extra arg on cupy, is kwarg
dtype: extra arg on cupy, is kwarg
out: extra arg on cupy, is kwarg
args: extra arg on numpy, is non-kwarg
kwargs: extra arg on numpy, is non-kwarg
ediff1d arr: extra arg on cupy, is kwarg
ary: extra arg on numpy, is non-kwarg
einsum out: extra arg on numpy, is kwarg
optimize: extra arg on numpy, is kwarg
empty like: extra arg on numpy, is kwarg
empty_like a: extra arg on cupy, is kwarg
prototype: extra arg on numpy, is non-kwarg
extract arr: extra arg on numpy, is non-kwarg
a: extra arg on cupy, is kwarg
eye like: extra arg on numpy, is kwarg
fix out: extra arg on numpy, is kwarg
fix: should be introspectable,
flip a: extra arg on cupy, is kwarg
m: extra arg on numpy, is non-kwarg
fliplr a: extra arg on cupy, is kwarg
m: extra arg on numpy, is non-kwarg
flipud a: extra arg on cupy, is kwarg
m: extra arg on numpy, is non-kwarg
format_float_positional precision: extra arg on numpy, is kwarg
args: extra arg on cupy, is kwarg
unique: extra arg on numpy, is kwarg
kwargs: extra arg on cupy, is kwarg
fractional: extra arg on numpy, is kwarg
trim: extra arg on numpy, is kwarg
sign: extra arg on numpy, is kwarg
pad_left: extra arg on numpy, is kwarg
pad_right: extra arg on numpy, is kwarg
min_digits: extra arg on numpy, is kwarg
format_float_scientific precision: extra arg on numpy, is kwarg
args: extra arg on cupy, is kwarg
unique: extra arg on numpy, is kwarg
kwargs: extra arg on cupy, is kwarg
trim: extra arg on numpy, is kwarg
sign: extra arg on numpy, is kwarg
pad_left: extra arg on numpy, is kwarg
exp_digits: extra arg on numpy, is kwarg
min_digits: extra arg on numpy, is kwarg
frombuffer args: extra arg on cupy, does not declare the full argspec, is non-kwarg
kwargs: extra arg on cupy, does not declare the full kwarg-spec, is kwarg
fromfile args: extra arg on cupy, does not declare the full argspec, is non-kwarg
kwargs: extra arg on cupy, does not declare the full kwarg-spec, is kwarg
fromfunction args: extra arg on cupy, is kwarg
function: extra arg on numpy, is non-kwarg
shape: extra arg on numpy, is non-kwarg
dtype: extra arg on numpy, is kwarg
like: extra arg on numpy, is kwarg
fromiter args: extra arg on cupy, does not declare the full argspec, is non-kwarg
kwargs: extra arg on cupy, does not declare the full kwarg-spec, is kwarg
fromstring args: extra arg on cupy, does not declare the full argspec, is non-kwarg
kwargs: extra arg on cupy, does not declare the full kwarg-spec, is kwarg
full like: extra arg on numpy, is kwarg
genfromtxt args: extra arg on cupy, is kwarg
kwargs: extra arg on cupy, is kwarg
fname: extra arg on numpy, is non-kwarg
dtype: extra arg on numpy, is kwarg
comments: extra arg on numpy, is kwarg
delimiter: extra arg on numpy, is kwarg
skip_header: extra arg on numpy, is kwarg
skip_footer: extra arg on numpy, is kwarg
converters: extra arg on numpy, is kwarg
missing_values: extra arg on numpy, is kwarg
filling_values: extra arg on numpy, is kwarg
usecols: extra arg on numpy, is kwarg
names: extra arg on numpy, is kwarg
excludelist: extra arg on numpy, is kwarg
deletechars: extra arg on numpy, is kwarg
replace_space: extra arg on numpy, is kwarg
autostrip: extra arg on numpy, is kwarg
case_sensitive: extra arg on numpy, is kwarg
defaultfmt: extra arg on numpy, is kwarg
unpack: extra arg on numpy, is kwarg
usemask: extra arg on numpy, is kwarg
loose: extra arg on numpy, is kwarg
invalid_raise: extra arg on numpy, is kwarg
max_rows: extra arg on numpy, is kwarg
encoding: extra arg on numpy, is kwarg
ndmin: extra arg on numpy, is kwarg
like: extra arg on numpy, is kwarg
histogram x: extra arg on cupy, is kwarg
a: extra arg on numpy, is non-kwarg
density: extra arg on numpy, is kwarg
density: extra arg on cupy, is kwarg
histogram2d density: extra arg on numpy, is kwarg
density: extra arg on cupy, is kwarg
histogramdd density: extra arg on numpy, is kwarg
density: extra arg on cupy, is kwarg
hstack dtype: extra arg on numpy, is kwarg
casting: extra arg on numpy, is kwarg
identity like: extra arg on numpy, is kwarg
in1d kind: extra arg on numpy, is kwarg
indices sparse: extra arg on numpy, is kwarg
intersect1d arr1: extra arg on cupy, is kwarg
arr2: extra arg on cupy, is kwarg
ar1: extra arg on numpy, is non-kwarg
ar2: extra arg on numpy, is non-kwarg
isin kind: extra arg on numpy, is kwarg
lexsort axis: extra arg on numpy, is kwarg
load fix_imports: extra arg on numpy, is kwarg
encoding: extra arg on numpy, is kwarg
loadtxt args: extra arg on cupy, is kwarg
kwargs: extra arg on cupy, is kwarg
fname: extra arg on numpy, is non-kwarg
dtype: extra arg on numpy, is kwarg
comments: extra arg on numpy, is kwarg
delimiter: extra arg on numpy, is kwarg
converters: extra arg on numpy, is kwarg
skiprows: extra arg on numpy, is kwarg
usecols: extra arg on numpy, is kwarg
unpack: extra arg on numpy, is kwarg
ndmin: extra arg on numpy, is kwarg
encoding: extra arg on numpy, is kwarg
max_rows: extra arg on numpy, is kwarg
quotechar: extra arg on numpy, is kwarg
like: extra arg on numpy, is kwarg
logspace axis: extra arg on numpy, is kwarg
max initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
mean where: extra arg on numpy, is kwarg
meshgrid copy: extra arg on numpy, is kwarg
kwargs: extra arg on cupy, is kwarg
sparse: extra arg on numpy, is kwarg
indexing: extra arg on numpy, is kwarg
min initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
nanargmax dtype: extra arg on cupy, is kwarg
nanargmin dtype: extra arg on cupy, is kwarg
nanmax initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
nanmean where: extra arg on numpy, is kwarg
nanmin initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
nanprod initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
nanstd where: extra arg on numpy, is kwarg
nansum initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
nanvar where: extra arg on numpy, is kwarg
ones like: extra arg on numpy, is kwarg
partition kind: extra arg on numpy, is kwarg
order: extra arg on numpy, is kwarg
piecewise args: extra arg on numpy, is non-kwarg
kw: extra arg on numpy, is non-kwarg
prod initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
product a: extra arg on cupy, is kwarg
axis: extra arg on cupy, is kwarg
dtype: extra arg on cupy, is kwarg
out: extra arg on cupy, is kwarg
keepdims: extra arg on cupy, is kwarg
args: extra arg on numpy, is non-kwarg
kwargs: extra arg on numpy, is non-kwarg
require like: extra arg on numpy, is kwarg
rot90 a: extra arg on cupy, is kwarg
m: extra arg on numpy, is non-kwarg
row_stack dtype: extra arg on numpy, is kwarg
casting: extra arg on numpy, is kwarg
save fix_imports: extra arg on numpy, is kwarg
savetxt fmt: extra arg on numpy, is kwarg
args: extra arg on cupy, is kwarg
delimiter: extra arg on numpy, is kwarg
kwargs: extra arg on cupy, is kwarg
newline: extra arg on numpy, is kwarg
header: extra arg on numpy, is kwarg
footer: extra arg on numpy, is kwarg
comments: extra arg on numpy, is kwarg
encoding: extra arg on numpy, is kwarg
show_config _full: extra arg on cupy, is kwarg
sometrue a: extra arg on cupy, is kwarg
axis: extra arg on cupy, is kwarg
out: extra arg on cupy, is kwarg
keepdims: extra arg on cupy, is kwarg
args: extra arg on numpy, is non-kwarg
kwargs: extra arg on numpy, is non-kwarg
sort order: extra arg on numpy, is kwarg
stack tup: extra arg on cupy, is kwarg
arrays: extra arg on numpy, is non-kwarg
dtype: extra arg on numpy, is kwarg
casting: extra arg on numpy, is kwarg
std where: extra arg on numpy, is kwarg
sum initial: extra arg on numpy, is kwarg
where: extra arg on numpy, is kwarg
take mode: extra arg on numpy, is kwarg
take_along_axis a: extra arg on cupy, is kwarg
arr: extra arg on numpy, is non-kwarg
tri like: extra arg on numpy, is kwarg
union1d arr1: extra arg on cupy, is kwarg
arr2: extra arg on cupy, is kwarg
ar1: extra arg on numpy, is non-kwarg
ar2: extra arg on numpy, is non-kwarg
unpackbits count: extra arg on numpy, is kwarg
unravel_index shape: extra arg on numpy, is kwarg
dims: extra arg on cupy, is kwarg
var where: extra arg on numpy, is kwarg
vstack dtype: extra arg on numpy, is kwarg
casting: extra arg on numpy, is kwarg
zeros like: extra arg on numpy, is kwarg

linalg namespace

Function Observations
matrix_power M: extra arg on cupy.linalg, is kwarg
a: extra arg on numpy.linalg, is non-kwarg
matrix_rank M: extra arg on cupy.linalg, is kwarg
A: extra arg on numpy.linalg, is non-kwarg
hermitian: extra arg on numpy.linalg, is kwarg
pinv hermitian: extra arg on numpy.linalg, is kwarg
svd hermitian: extra arg on numpy.linalg, is kwarg

testing namespace

Function Observations
assert_allclose equal_nan: extra arg on numpy.testing, is kwarg
assert_array_equal strict: extra arg on numpy.testing, is kwarg
strides_check: extra arg on cupy.testing, is kwarg
assert_warns expected: extra arg on cupy.testing, is kwarg
warning_class: extra arg on numpy.testing, is non-kwarg
args: extra arg on numpy.testing, is non-kwarg
kwargs: extra arg on numpy.testing, is non-kwarg

random namespace

Function Observations
beta size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
binomial size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
chisquare size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
choice size: same position, cupy.random is kwarg, numpy.random is non-kwarg
replace: same position, cupy.random is kwarg, numpy.random is non-kwarg
p: same position, cupy.random is kwarg, numpy.random is non-kwarg
dirichlet size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
exponential size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
f size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
gamma scale: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
geometric size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
gumbel loc: same position, cupy.random is kwarg, numpy.random is non-kwarg
scale: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
hypergeometric size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
laplace loc: same position, cupy.random is kwarg, numpy.random is non-kwarg
scale: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
logistic loc: same position, cupy.random is kwarg, numpy.random is non-kwarg
scale: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
lognormal mean: same position, cupy.random is kwarg, numpy.random is non-kwarg
sigma: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
logseries size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
multinomial size: same position, cupy.random is kwarg, numpy.random is non-kwarg
multivariate_normal mean: extra arg on cupy.random, is kwarg
cov: extra arg on cupy.random, is kwarg
size: extra arg on cupy.random, is kwarg
check_valid: extra arg on cupy.random, is kwarg
tol: extra arg on cupy.random, is kwarg
method: extra arg on cupy.random, is kwarg
dtype: extra arg on cupy.random, is kwarg
mean: extra arg on numpy.random, is non-kwarg
cov: extra arg on numpy.random, is non-kwarg
size: extra arg on numpy.random, is non-kwarg
check_valid: extra arg on numpy.random, is non-kwarg
tol: extra arg on numpy.random, is non-kwarg
negative_binomial size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
noncentral_chisquare size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
noncentral_f size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
normal loc: same position, cupy.random is kwarg, numpy.random is non-kwarg
scale: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
pareto size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
permutation a: extra arg on cupy.random, is kwarg
x: extra arg on numpy.random, is non-kwarg
poisson lam: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
power size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
rand size: extra arg on cupy.random, is kwarg
kwarg: extra arg on cupy.random, is kwarg
args: extra arg on numpy.random, is non-kwarg
randint high: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: same position, cupy.random is kwarg, numpy.random is non-kwarg
randn size: extra arg on cupy.random, is kwarg
kwarg: extra arg on cupy.random, is kwarg
args: extra arg on numpy.random, is non-kwarg
random size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
random_integers high: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
random_sample size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
rayleigh scale: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
shuffle a: extra arg on cupy.random, is kwarg
x: extra arg on numpy.random, is non-kwarg
standard_cauchy size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
standard_exponential size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
standard_gamma size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
standard_normal size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
standard_t size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
triangular size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
uniform low: same position, cupy.random is kwarg, numpy.random is non-kwarg
high: same position, cupy.random is kwarg, numpy.random is non-kwarg
size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
vonmises size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
wald size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
weibull size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg
zipf size: same position, cupy.random is kwarg, numpy.random is non-kwarg
dtype: extra arg on cupy.random, is kwarg

stride_tricks namespace

Function Observations
as_strided subok: extra arg on numpy.lib.stride_tricks, is kwarg
writeable: extra arg on numpy.lib.stride_tricks, is kwarg
andfoy commented 2 years ago

SciPy comparison

The SciPy comparison is analog to the NumPy one, where functions and modules were compared using this script: https://gist.github.com/andfoy/a5acb14a60d7b46f0dd20fd6e0074d7d

Notes

  1. The following functions cannot be compared directly since they are defined as ufunc or builtin_function: cupyx.scipy.fft.dct, cupyx.scipy.fft.dctn, cupyx.scipy.fft.dst, cupyx.scipy.fft.dstn, cupyx.scipy.fft.fft, cupyx.scipy.fft.fft2, cupyx.scipy.fft.fftn, cupyx.scipy.fft.fht, cupyx.scipy.fft.hfft, cupyx.scipy.fft.hfft2, cupyx.scipy.fft.hfftn, cupyx.scipy.fft.idct, cupyx.scipy.fft.idctn, cupyx.scipy.fft.idst, cupyx.scipy.fft.idstn, cupyx.scipy.fft.ifft, cupyx.scipy.fft.ifft2, cupyx.scipy.fft.ifftn, cupyx.scipy.fft.ifht, cupyx.scipy.fft.ihfft, cupyx.scipy.fft.ihfft2, cupyx.scipy.fft.ihfftn, cupyx.scipy.fft.irfft, cupyx.scipy.fft.irfft2, cupyx.scipy.fft.irfftn, cupyx.scipy.fft.next_fast_len, cupyx.scipy.fft.rfft, cupyx.scipy.fft.rfft2, cupyx.scipy.fft.rfftn, cupyx.scipy.special.round, scipy.special.sinc, scipy.special.zeta

sparse namespace

Function Observations
spdiags m: same position, cupyx.scipy.sparse is non-kwarg, scipy.sparse is kwarg
n: same position, cupyx.scipy.sparse is non-kwarg, scipy.sparse is kwarg

fftpack namespace

Function Observations
fft plan: extra arg on cupyx.scipy.fftpack, is kwarg
fft2 plan: extra arg on cupyx.scipy.fftpack, is kwarg
fftn plan: extra arg on cupyx.scipy.fftpack, is kwarg
ifft plan: extra arg on cupyx.scipy.fftpack, is kwarg
ifft2 plan: extra arg on cupyx.scipy.fftpack, is kwarg
ifftn plan: extra arg on cupyx.scipy.fftpack, is kwarg
rfft plan: extra arg on cupyx.scipy.fftpack, is kwarg
rgommers commented 2 years ago

This is quite nice @andfoy. There may be an issue with your script for when the first argument of a function has a different name in cupy versus in numpy. Example from histogram:

x: extra arg on cupy, is kwarg
a: extra arg on numpy, is non-kwarg

As far as I can tell, they are both regular positional arguments. So the kwarg vs. non-kwarg thing is a bit of a red herring. Maybe you can figure out where it comes from and fix it?

Also, you may want to add a list of known exceptions that are okay. Example: density has a different default in numpy because of backwards compatibility reasons (None instead of False), but it's not desirable for cupy to match that - it is a regular boolean keyword in principle. Although in this particular case, the fix is to go remove normed from np.histogram - it has been deprecated for a few years.