I fell it's necessary to point out that the original purpose of constant_renumber was to make the constant numbering come out in order in the final printed expression, to as much degree possible. It's use as a testing canonicalizer was a secondary use that was not even considered in the original design.
For testing purposes, the perhaps exists a better solution, though as far as I know it's working just fine even with hash randomization (I don't remember there being a lot of test failures in the odes). For its original purpose, printing, it doesn't always achieve its goal, because sometimes the very act of swapping C1 and C2, for example, causes their printing order to also be swapped, so that you can never get them in the right order (e.g., you'll either get C2*sin(x) + C1*cos(x) or C2*cos(x) + C1*sin(x)). This could perhaps be fixed if we move to a separate class for constants as proposed in Stefan's pull request, and rewriting the printer to enforce constant numbering ordering on the final expresssion. Aaron Meurer On Jul 16, 2012, at 4:20 AM, "[email protected]" <[email protected]> wrote: > With all the issues surrounding ordering, hashes and hash > randomization I was left with the impression that we should rewrite > tests in such a way that they test for mathematical correctness but > not for specific ordering of args, etc. > > It seems that constant_renumber does two things: renumbers the > constants and forces some arch-independent order. Do we actually want > this? It seems that it is a performance penalty and support burden > that is there only for the sake of tests. > > -- > 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.
