-
-
Notifications
You must be signed in to change notification settings - Fork 601
Fixes incorrect behaviour when taking the derivative of a constant matrix #39451
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
Conversation
Thanks for the bug fix. After "Verify that :issue:`15067` is fixed::" in After you make that correction, I will run |
Documentation preview for this PR (built with commit 8cecf8c; changes) is ready! 🎉 |
There is no need for
That needs to be fixed. |
sagemathgh-39451: Fixes incorrect behaviour when taking the derivative of a constant matrix <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#15067. Fixed error in the _derivative methods of matrix_dense.pyx and matrix_sparse.pyx. These functions attempted to call the derivative method belonging to each element of the matrix. This caused incorrect behaviour when the element did not have a derivative method. This was fixed by altering the code to call the derivative function defined in /src/sage/calculus/functional.py with the element as a parameter, instead of the derivative method belonging to the element. Doctests were added to verify this change. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [X] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39451 Reported by: Caleb Van't Land Reviewer(s):
sagemathgh-39451: Fixes incorrect behaviour when taking the derivative of a constant matrix <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#15067. Fixed error in the _derivative methods of matrix_dense.pyx and matrix_sparse.pyx. These functions attempted to call the derivative method belonging to each element of the matrix. This caused incorrect behaviour when the element did not have a derivative method. This was fixed by altering the code to call the derivative function defined in /src/sage/calculus/functional.py with the element as a parameter, instead of the derivative method belonging to the element. Doctests were added to verify this change. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [X] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39451 Reported by: Caleb Van't Land Reviewer(s):
Fixes #15067.
Fixed error in the _derivative methods of matrix_dense.pyx and matrix_sparse.pyx. These functions attempted to call the derivative method belonging to each element of the matrix. This caused incorrect behaviour when the element did not have a derivative method. This was fixed by altering the code to call the derivative function defined in /src/sage/calculus/functional.py with the element as a parameter, instead of the derivative method belonging to the element. Doctests were added to verify this change.
📝 Checklist
⌛ Dependencies