On 09/03/12 19:39, Aaron Meurer wrote:
On Sep 3, 2012, at 1:37 AM, Juha Jeronen<[email protected]>  wrote:

On 31/08/12 17:52, Aaron Meurer wrote:

Ok. I'm not sure why I thought it is off by default - might be in some
functions in the old 0.6.7. As I'm using both 0.7.1 and 0.6.7 at the
moment (two machines, different distro), I may be a bit confused about
API details at times :)

Well it is occasionally, but as I said generally it *should* be True
by default.

Ok.


By the way, what distro has the old SymPy. Is it an issue of you using
some "stable" version, or should we try to work with the maintainers
to get it upgraded?

Yeah, it's Debian Stable.

Out of the distros tracked by OSWatershed, debian and arch are the only ones still offering 0.6.7 :)

http://oswatershed.org/pkg/sympy

And to be exact, I had forgotten that Ubuntu 12.04LTS actually comes with SymPy 0.7.1rc1, not the final 0.7.1...


Summarizing the discussion, the cleanest solution is probably to change
the API to:

collect(expr, syms=None, **kwargs)

kwargs:
  deep=True (default; API break!) or deep=False (top level only, like
old collect())
  method="dfs" (old rcollect()) or method="bfs" (recursive_collect()).

For syms, a list can be given as before. The default is the special
value None, which means "use automatic syms".

rcollect(expr, *vars) just calls collect(expr, syms, deep=True,
method="dfs").


Questions:


- Is None good as a special value? I think it's at least better than the
string "auto", because IIRC collect() isn't that particular about the
type of syms being a list if you want to collect on one symbol only (I
think this is a very nice convenience feature and should be kept). Given
this behaviour, the value None is the only one that doesn't pass control
information in the data band (as it's not a valid symbol).

Yes, None is a common special value for cases like this.

Ok.


(Of course, whatever the special value is, it can be the default when
syms is omitted, so the user doesn't need to worry about it.)


- Which method should be the default? Personally, I would suggest the
new bfs; at least it's what I intuitively expect myself when doing a
"recursive collect" (i.e. "extract as much stuff to as near the top
level as possible").

What is your opinion on this? And the other developers?

I'm not sure. Maybe you could take a look at where in the library code
collect is used to see an idea of some use cases. You could also get
an idea by replacing the default and seeing how many tests fail.

Ok.


Once these are settled, I think I have enough information to prepare a
proper patch (except for practical details, such as the preferred patch
format).

Use a pull request on Github. We'll help you if you're new to git.

Ok.

I have used git, but not Github. I suppose I'll need to create an account and then do something to create the pull request...

In any case, I'll prepare the patch locally first. I'll ping on this list when I have a first version ready for review.


 -J

--
You received this message because you are subscribed to the Google Groups 
"sympy" 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?hl=en.

Reply via email to