Example implementations are nice, but not if they're buried away so that they're hard to actually use (the code in the examples/ directory is like this).
Because SymPy is written in Python, which is such an easy language to read, I consider all the code base to be an "example implementation" to some degree. This is one of the reasons why we aim to "keep the code as simple as possible." Of course, we shouldn't have to sacrifice speed to do this (I strongly believe that fast code can be readable code). And writing all your code as if it were example code makes for more readable code (because example code should be well documented and commented). Therefore, I would just put the stuff in the combinatorics directory with the rest of the combinatorics stuff. The code will be there for anyone who is interested to see (for example, by reading the source, or by using the source() function). And they will be able to use it too. And besides, you never know when something like this will be useful to someone, beyond just seeing the implementation. Aaron Meurer On Tue, Jul 5, 2011 at 3:57 PM, Haz <[email protected]> wrote: > I'd have to agree with Saptarshi / Matthew on this one. I enjoy seeing > example implementations (if clearly done), and presumably these more > esoteric combinatorial objects have been contrived for one reason or another > -- better properties in certain cases, etc. I think they're suited for the > combinatorics module (nothing wrong with doing advanced combinatorics), but > at the very least they should be shipped with sympy in an "example > implementation" directory. > Just my $0.02. > Cheers > > On Tue, Jul 5, 2011 at 4:16 PM, Matthew Rocklin <[email protected]> wrote: >> >> As a user of SymPy (and other libraries) I often appreciate example >> implementations. If they don't go into the actual code isn't there an >> examples directory? >> >> On Tue, Jul 5, 2011 at 2:36 PM, Christophe BAL <[email protected]> >> wrote: >>> >>> Hello, >>> you could put this in teh wiki. >>> >>> C. >>> >>> 2011/7/5 Saptarshi Mandal <[email protected]> >>>> >>>> Hi all, >>>> A few days back I implemented a bunch of combinatorial generation >>>> algorithms for rather specialized objects (necklaces, lyndon words, >>>> bell permutations). These were being reviewed by Chris Smith and he >>>> pointed out that such algorithms may be unnecessary and he also wanted >>>> to know the motivation for implementing them. I did not really have an >>>> answer because honestly I was doing it for the kicks. My only argument >>>> was that it was educative as these algorithms have been developed >>>> within the last decade and a graduate student studying combinatorics >>>> might find it useful. For now, I have not submitted the code I wrote >>>> for the more specialized objects because it is outside of the scope of >>>> my proposal and I am a bit behind on my Permutation groups >>>> implementation (which I believe is the real meat of my project). I >>>> would still like to know what the rest of you think about this issue. >>>> Regards >>>> Saptarshi Mandal >>>> >>>> -- >>>> 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. >>>> >>> >>> -- >>> 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. >> >> -- >> 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. > > -- > 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. > -- 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.
