-
-
Notifications
You must be signed in to change notification settings - Fork 83
Add sqrt member to AffineScalarFunc to make numpy.linalg.norm work #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The method used here (adding The attribute would be needed for both Some methods will need different names, such as |
During implementation of the patch I already did that for I think once this PR is merged and has proven to work for some time, one could implement your suggestion in a separate PR. |
I can see that some time has past since this pr was last updated, and I just ran into this issue (plus the norm one) when attempting to use uncertainties with statsmodels. Are the failed checks related to an incomplete implementation? If this works as-is I can make progress on my own work by just monkey-patching |
I also see an issue where numpy needs an implementation of the conjugate method as the default in numpy is to use the Frobenius norm, although this is really not my area |
My rewrite, discussed in #251 implements |
This is my own try at fixing issue #121.
It works by adding
sqrt
as a member function toAffineScalarFunc
so thatnumpy
knows how to calculate the square root of it.This also makes some other
numpy
methods work likenumpy.sqrt
.