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
Incorrect Exception in dsolve() : First implementation #1803
Conversation
A rather strange error from Travis, however it does not seem to be caused by this pull request:
|
Yes , I noticed that in the build statement . Could you please tell what you think needs to be done , because it had passed all the tests on my laptop and I'm quite sure of the required output. |
Add tests (use |
Sorry for being a noob but is the error because I haven't added tests? Could you please be a bit more clearer? |
The travis build error is not due to the lack of tests. The requirement for tests is a convention and it is not tested itself (that would be a bit too meta :)) For the moment just add the tests, this will cause a new travis build run and if the error persist we will discuss it again. The error itself seems unrelated to your code. |
More generally, there is a |
I've added tests using raises as mentioned. |
This looks good if tests pass. |
Could you merge it? .It seems to have passed the Travis |
Incorrect Exception in dsolve() : First implementation
I fear the added tests do not verify the code's behavior is correct. First of all, the messages are not checked, so the message to the user could be incorrect, with all tests passing. In fact, in line 1433 raises(ValueError, lambda: dsolve(f(x).diff(x)**2, f(x), 'seperable')) it says 'seperable', not 'separable', thus the exception message will be "Hint not recognized: seperable" instead of the expected (I guess so) "ODE " + str(eq) + " does not match hint separable". |
Oh, you're right. That should be fixed. |
This was so trivial that I just pushed a fix in. |
SymPy Bot Summary: ❌ Could not fetch the branch Manoj-Kumar-S/1996_issue. |
This pull request is related to the issue http://code.google.com/p/sympy/issues/detail?id=1996
As mentioned in the above link , dsolve() returns wrong exceptions when it is not solvable , and the hint is either invalid or incorrect. I've changed it so that it raises the correct Exceptions.
Also , as mentioned in the link , as needed
Do look at the code for changes required.