Repository navigation
Conversation
|
@sanjaygrr Looks like you beat me to it haha, and did it better! @efiring there is a lot of ufunc machinery that is hidden by all the wrapping going on. Properties like |
|
I can easily add the nin and nout attributes, but I don't see any point in adding any of the methods. Is there any real use case for any of them? Do any of them even make sense in this context? |
|
Those methods probably aren't useful, my suggestion was more from an expectation that the functions in the library are ufuncs and get surprised when the interface doesn't match. Things like function signatures, e.g. the wrapped ufuncs didn't support kwargs at all until #98, or properties e.g. I had some expectation that nin and nout properties existed. Adding just nin and nout properties are good enough for this issue/PR, but maybe consider matching the full ufunc interface, or doing a |
Closes #304.
As discussed there,
masked_array_supportnow passesout=Noneexplicitly along withwhere=, so numpy 2.5 no longer warns about uninitialized memory. Values under the mask stay uninitialized, as before.Multi-output ufuncs reject a bare
out=None(TypeError: 'out' must be a tuple of arrays), so those get oneNoneper output. The count comes from thetypesattribute the wrappers already expose, e.g.'dd->dd'. Anoutpassed by the caller still takes precedence.Checked on Python 3.14.7 with numpy 2.5.4:
pytest gsw/tests -W error::UserWarning: 670 passed (test_p_from_z_ok[zp4]used to emit the warning);p_from_z,SA_from_SPand the two-outputCT_first_derivativesreturn correctly masked results with no warning;out=array still works.