On Tuesday, 10 November 2015 00:04:39 UTC+1, Aaron Meurer wrote: > > I'm trying to fix sympy.vector.Point so that it follows the args > invariant. Right now, there is a check that the parent_point must be a > Point instance, but it can also be None, in which case, it is set to a > Symbol. This causes a Point constructed in such way to not follow > expr.func(*expr.args) == expr. >
There are also some subclassing of Symbol and ignoring the parameter extensions: https://github.com/sympy/sympy/blob/01b4f8d97be55746ee2abe38163b533ca5318ba7/sympy/vector/scalar.py#L14 *index* and *system *are defining parameters, they should be in the *.args*. Perhaps one should follow the example in *sympy.diffgeom*, https://github.com/sympy/sympy/blob/f3de4f3698c28355d6397e917b3d9d5bbf9c84c0/sympy/diffgeom/diffgeom.py#L467 *BaseScalarField* in *diffgeom* is the analogous of *BaseField* in *vector.* > > Example: > > In [11]: from sympy.vector import * > > In [12]: C = CoordSysCartesian('C') > > If I remember correctly, the letter *'C'* (the name of the coordinate system) doesn't get registered in the *args*, that's another issue. > > As a side note, the fact that this sort of thing exists in SymPy is > embarrassingly bad. We should fix test_args to test that objects are > recreatable from their arguments and put a moratorium on new objects > that don't follow that rule. > > It's a bit complicated to explain to new users how to write class constructors. Mathematica has a pattern matching syntax that forces you to keep its equivalent of SymPy's args sorted in this particular way. -- 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/90c852e2-911c-4be1-93b0-6798e7736d5e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
