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
matrix vstack/hstack can fail with immutable matrix as first argument #11944
Comments
I want to try this. |
@cbm755 this the output in my system and seems to be fine.
|
Thanks for checking. I've tried it and I can reproduce with Python 2 on both Sympy 1.0.1 and the current git master. But on Python 3, it works as you show: nice catch. |
Go for it. It should be an easy fix, I'm just not enough of a Python expert to know which fix is the best. Please add a test and read the https://github.com/sympy/sympy/wiki/Development-workflow. |
Hi @Abdullahjavednesar . Let me know in case you're not working on it :) |
This is fixed in #11592 , for what it's worth :-) |
@siefkenj that's great! I wondered when I saw your refactor but I haven't had a chance to look yet. Thanks. @Abdullahjavednesar if that PR goes in first, we'll need to update your PR #11951 to just add tests---this issue will still need tests even if its fixed elsewhere. |
// edited by skirpichev Closes sympy/sympy#11944
Closes sympy/sympy#11944 // edited by skirpichev Based on sympy/sympy#11951 Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Closes sympy/sympy#11944 // edited by skirpichev Based on sympy/sympy#11951 Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Note it will work if one uses
MatrixBase.vstack
.I don't think this is really about immutable matrices; its about
cls.col_join
not being the right method, depending on what is inargs
.One way to fix this would be to take
cls
from the type ofargs[0]
instead:Although I'm not sure that's quite right.
Another option is to avoid
reduce
and use:(or more pythonic version thereof).
Whatever we do
hstack
needs the same fix.The text was updated successfully, but these errors were encountered: