I would definitely test the different alternatives for sympy.abc to
see what's faster.

Also, I wonder what the effect of sympy.abc on the cache is. We have
an LRU cache, and assumedly importing it messes with that, at least
for a little bit.

Aaron Meurer

On Mon, Mar 30, 2015 at 1:52 PM, Joachim Durchholz <[email protected]> wrote:
> Am 30.03.2015 um 19:58 schrieb Aaron Meurer:
>>
>> symbols() supports commas, so an easy thing to do here is to use the
>> form symbols(' t, w, x, y, z, n, k, m, p, i'), so that the left-hand
>> side of the assignment exactly matches the right-hand side.
>
>
> Ah, I knew it could do commas but I didn't know that it allows the
> comma-plus-space combination as well.
> That's going to make replacing `from sympy.abc import ...` with
> `symbols('...')` easy enough (and I think I'll fix up any existing calls as
> well, just to set the precedent).
>
> Question is: Is this what we want?
> grep reports 2200+ mentions of 'abc' in SymPy, that's an awful lot of work,
> both for fixing and for review.
>
> My personal main motive that I even started actually doing this has been to
> get some more warnings out of the system - static analysis does not know
> about the symbols that the exec calls in sympy.abc generates.
> I could imagine fixing that by rewriting sympy.abc as
>
> a = Symbol('a')
> b = Symbol('b')
> ...
> z = Symbol('z')
> A = Symbol('A')
> B = Symbol('B')
> ...
> Z = Symbol('Z')
> from sympy.printing.pretty.pretty_sombology import g, G
> alpha = Symbol(g('alpha'))
> beta = Symbol(g('beta'))
> ...
> omega = Symbol(g('omega'))
> ALPHA = Symbol(G('ALPHA'))
> ΒETA = Symbol(G('BETA'))
> ...
> OMEGA = Symbol(G('OMEGA'))
>
> It's dull, it's dumb, but it gets the work done, and this needs to be
> maintained so rarely that it shouldn't be a problem.
> It should also make the import of sympy.abc fast (I guess importing
> sympy.abc is slow because module initialization runs ~100 one-liners through
> the Python compiler, though I haven't checked that it is indeed as slow as
> `sympy/__init__.py` suggests).
>
> However, that's just something that I came up with tonight, I'll be happy to
> follow whatever course people see as best.
>
> --
> 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/55199B7D.5030505%40durchholz.org.
>
> 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%3D6JHY5rHEKGmd_tDBwWLwp0-8wpCLy4AGbWCsz35F%2BsWjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to