Updates:
        Labels: NeedsBetterPatch

Comment #10 on issue 1644 by asmeurer: Coeff() with derivatives and  
functions
http://code.google.com/p/sympy/issues/detail?id=1644

I get
error: patch failed: sympy/core/basic.py:1844
error: sympy/core/basic.py: patch does not apply
error: patch failed: sympy/core/tests/test_numbers.py:127
error: sympy/core/tests/test_numbers.py: patch does not apply

on the current master.  Could you maybe push to a branch?  At any rate,  
just based on the code in the patch file, here are
some comments:
1) Thanks for fixing my typos. :)
2) There's this:
-            if r['b']:
+            if r.get('b', 0):

I can't tell for sure just from the code, but does this mean that if there  
is not b part, then the dictionary doesn't have the
key b?  I think it should always have the key b, and set it to 0 if there  
is no non-function part.

3) I'm assuming this change relates to the same thing:
-        if r and all([not r[i].has(x) for i in range(order + 1)]):
+        if r and not any(r[i].has(x) for i in r if i != 'b'):

I just realized that every other key is an int.  Maybe we should use -1  
instead of b, (like you did in your code block on IRC a
while ago).

4)
-        - dsolve always returns an Equality class.  If possible, it
+        - dsolve always returns an Equality class (except for the case
+          when the hint is "all" or "all_Integral").  If possible, it

OK, 'technically' it doesn't *always* return an Equality class.  Maybe it  
should be, "The solutions returned by dsolve are
always in the form of an Equality class.", which is still correct but less  
confusing.

5)
+            # f must be func or one of its derivatives in only var x
+            dargs = f.args[1:]
+            if not (f.is_Function and
+                    f == func or
+                    isinstance(f, Derivative) and
+                    all(w == x for w in dargs)):

Good, though f.args[1:] will have no effect for f(x).  I think dsolve  
should already be checking to see that f(x) is a function
of one variable, so you should only need to look at the derivatives, for  
which you can just use Derivative.symbols.

I don't know how the other code works (though there is my comment on the  
as_numer_denom stuff above.  Maybe that
should be clearer that it is a commented out block), so I will assume it is  
right if the tests pass.  But please fix the patch so
that it applies!

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to