New assumptions strikes again!

I hope that by trying to interface SymPy with another project we expose and
fix some of the warts in SymPy's current design.  Things like Function
threw me off when I melded SymPy with LogPy (my little logic programming
system) or with Theano.  It'll be nice for others to run into these.

My hope is that if/when we remove old assumptions that we'll be able to
simplify a lot of the core, removing metaclasses, and hopefully imposing a
few more strict invariants.

SymPy is pretty awesome but it'd be nice if the trees were simpler.  That
would make it more pleasurable to interoperate with other systems.


On Wed, Apr 23, 2014 at 3:36 PM, Ondřej Čertík <[email protected]>wrote:

> On Wed, Apr 23, 2014 at 4:31 PM, Ondřej Čertík <[email protected]>
> wrote:
> > On Wed, Apr 23, 2014 at 4:27 PM, Aaron Meurer <[email protected]>
> wrote:
> >> Well that would only affect what you do in your own workspace. Much
> >> better would be if sympy transparently imported and used csympy
> >> wherever relevant when it was available, so that sympy.Symbol would be
> >> csympy.Symbol, and so on. Then everywhere in sympy would use csympy.
> >
> > That's a good idea. There is of course the issue with assumptions,
> > attached to the Symbols...
> >
> >>
> >> But this requires full interoperability between sympy and csympy
> >> (which is one of the things I have not seen yet). I think the next
> >> task for csympy should be:
> >>
> >> - Patch sympy/core/symbol.py to use csympy.Symbol (so that from
> >> sympy.core.symbol import Symbol gives csympy.Symbol)
> >> - Run the tests
> >> - Fix whatever fails
> >> - Repeat with further csympy objects
> >>
> >> And always do this with every csympy object that is written. We
> >> perhaps need a more unified way to automatically replace anything in
> >> sympy with csympy (especially since Ondrej still hasn't provided a
> >> clear separation between what will and will not be in csympy, at least
> >> in my mind).
> >>
> >> Then we can stop making these artificial benchmarks and performance
> >> speculations, and just see what really is slow, and what really speeds
> >> things up, and, just as importantly, what doesn't speed things up
> >> enough to warrant the complexity cost.
> >>
> >> I would focus on this rather than PyDy specifically. It may be
> >> possible to use csympy in PyDy without doing this, but it will be a
> >> wasted effort if you eventually do this and then the PyDy specific
> >> implementation can be scrapped.
> >
> > The goal of using CSymPy in PyDy is precisely to do this switch
> > (single line of code)
> > in PyDy only, not the core of SymPy. Because that's a lot simpler (no
> > need to worry
> > about assumptions) and tons of tests. And doing a real application
> > where speed matters.
>
> So that we are not just talking, here is the actual code:
>
> https://github.com/sympy/sympy/pull/7397
>
> It's simple, and we are still trying to make it more simple (=more
> compatible
> with SymPy), until it is really just one line. There are some technical
> issue
> like our Function("f") would correspond to just raw class in C++, except
> that
> C++ doesn't support that, so I have a function called function_symbol("f",
> x),
> and so on. This could be abstracted in the Python wrappers and so on. This
> will all be fixed eventually.
>
> Aaron, I think you want to have full compatibility with SymPy immediately.
> But
> there could be significant speed/efficiency cost, and I need to make
> sure that the
> speed of the C++ core is optimal.
>
> The time frame is roughly this summer, when we implement enough features
> to be useful for PyDy and do some serious benchmarking on real world
> problems.
> After that it would be good time to review the Python API to make sure
> it works well
> with SymPy and start integrating it more. For now I just keep things
> simple to get the job done.
>
> Ondrej
>
> >
> > After that, do this in sympy.core --- that requires tackling
> > assumptions and maybe few
> > other things.
> >
> > Ondrej
> >
> >>
> >> Aaron Meurer
> >>
> >> On Wed, Apr 23, 2014 at 5:19 PM, Matthew Rocklin <[email protected]>
> wrote:
> >>> Perhaps a good target workflow would be something like the following
> >>>
> >>> from sympy import *
> >>> from csympy import *
> >>>
> >>> ... do work as usual ...
> >>>
> >>> In other words it would be nice for csympy to take over from sympy
> where it
> >>> has functionality, but for sympy-proper to fill in all of the holes.
> >>> Ondrej, is this on your roadmap at all?
> >>>
> >>> It gets weird of course when you have something like Expr(...) +
> CExpr(...)
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "sympy" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send
> an
> >>> email to [email protected].
> >>> To post to this group, send email to [email protected].
> >>> Visit this group at http://groups.google.com/group/sympy.
> >>> To view this discussion on the web visit
> >>>
> https://groups.google.com/d/msgid/sympy/CAJ8oX-Fh%3DFR5LM2Uehn%2BWTdFs%3D8QBys%2B2BoPXUdZKgdWeHaqbA%40mail.gmail.com
> .
> >>>
> >>> For more options, visit https://groups.google.com/d/optout.
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups "sympy" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> >> To post to this group, send email to [email protected].
> >> Visit this group at http://groups.google.com/group/sympy.
> >> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6Kn9fKNFN7uNya_pLaj0%2Bqy0d%3DisZ8_6SKdp8sGwwBMKQ%40mail.gmail.com
> .
> >> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CADDwiVD_Knxf1%2B82-vmGOyPA%3DWfZgg1Np3PMyUDHoYaRzt4nqA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJ8oX-HKbbG_qCKfDEVDtuhxZhBN%2B0aLW61oLyjHQ8BbmmMBdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to