-
Notifications
You must be signed in to change notification settings - Fork 67
Wrap cse #193
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
Wrap cse #193
Conversation
b = sympify(expr) | ||
vec.push_back(b.thisptr) | ||
symengine.cse(replacements, reduced_exprs, vec) | ||
return (vec_pair_to_list(replacements), vec_basic_to_list(reduced_exprs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure on returning the results in a tuple
? SymPy
, if I'm not wrong, doesn't do that and might lead to an inconsistency later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SymPy does return a tuple. (At least in git master)
@@ -81,7 +81,8 @@ install: | |||
|
|||
- set PATH=C:\Python%PYTHON_VERSION%;C:\Python%PYTHON_VERSION%\Scripts;%PATH% | |||
- pip install nose pytest | |||
- pip install --install-option="--no-cython-compile" cython | |||
- if [%COMPILER%]==[MinGW-w64] pip install --install-option="--no-cython-compile" cython==0.26 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@certik, you were right. Downgrading cython fixed the error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It's better to pick a particular version of Cython, since they seem to break things for us from time to time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add some SymPy
style test cases? Just so we can be sure that its compatible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @ShikharJ said, let's add some SymPy style tests, to ensure we have the same interface. Otherwise this looks good.
@@ -81,7 +81,8 @@ install: | |||
|
|||
- set PATH=C:\Python%PYTHON_VERSION%;C:\Python%PYTHON_VERSION%\Scripts;%PATH% | |||
- pip install nose pytest | |||
- pip install --install-option="--no-cython-compile" cython | |||
- if [%COMPILER%]==[MinGW-w64] pip install --install-option="--no-cython-compile" cython==0.26 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It's better to pick a particular version of Cython, since they seem to break things for us from time to time.
e2 = (x + y)*w | ||
substs, reduced = cse([e1, e2]) | ||
assert substs == [(x0, x + y)] | ||
assert reduced == [x0*z, x0*w] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only added a few tests here to test the interface. All the tests in C++ are taken from the sympy test suite and there's no point reproducing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's just for the interface / API, not the correctness, which is (and must) be tested in C++.
Thanks for the reviews |
No description provided.