Closed seberg closed 9 months ago
It seems that numexpr
should create a new constant which is large enough and replace NPY_MAXARGS
where it's used for array size, and keep it where it's used for operands+1 > NUMEXPR_MAXARGS
check.
Am I understanding this correctly?
Right, that would work, unless you don't care about doing a normal allocation. Only thing is if NumPy lifts the limit, it would be nice if you just notice, but not sure that there is a good way.
Sounds like this should be fixed, thanks!
I bumped
NPY_MAXARGS
on NumPy main, however, it seems more useful to makeNPY_MAXARGS
a runtime constant, rather than a compile time one. So that it gives the correct value for both NumPy 1.x and 2.0 (unlikeNPY_MAXDIMS
, it is used too much for heap arrays).This means
numexpr
needs to use a custom constant for the heap array allocations, but can keep using theoperands+1 > NPY_MAXARGS
check. In principle it would be nice to have aoperands+1 > NUMEXPR_MAXARGS
check which maybe could warn (if you don't just remove the need for a compile time constant).PS: I am open to bumping the constant further and hopefully removing it in the long term. Maybe you can just not rely on it at all anymore, but I am not sure what errors NumPy would raise if you removed it...