You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
I need to update a unit test where integrate now returns something that
contains 1/(2*(s+1)).
However, when I write that subexpression, SymPy gives me 1/(2*s + 2),
which compares unequal.
What would be the best way forward?
Alternatives that I can think of:
- have integrate() do whatever SymPy does when constructing 1/(2*s + 2)
- have the unit test do it and leave integrate() as it is
- rewrite the unit test to directly construct the Expr object (how?)
James Crist
unread,
Mar 28, 2015, 11:12:23 AM3/28/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
One way that's pretty common is to do something like:
result = whatever your testing solution = something you type in assert simplify(result - solution) == 0
This is better than constructing a special case form, because that form may change in the future.
Aaron Meurer
unread,
Mar 28, 2015, 4:35:32 PM3/28/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
Except in the tests you should use a more directed, efficient
simplification function than simplify(). cancel() should be sufficient
for this case.
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
Am 28.03.2015 um 21:35 schrieb Aaron Meurer:
> Except in the tests you should use a more directed, efficient
> simplification function than simplify(). cancel() should be sufficient
> for this case.
That worked, thanks.
Is there a guideline which function to select for what kind of
normalization?
(I admit I haven't read SymPy's documentation, reading it all has always
been a daunting task.)