06.05.2011 01:54, Mateusz Paprocki пишет:
>
> To see what cache does with SymPy, run bin/test as follows:
>
> $ SYMPY_USE_CACHE=no bin/test
>
> I got the following result:
>
> ________________________________________________________________________________
> _________________ sympy/core/tests/test_eval.py:test_function
> __________________
> File "/home/mateusz/repo/git/sympy/sympy/core/tests/test_eval.py", line
> 81, in test_function
> assert exp(l(x))*l(x)/exp(l(x)) == l(x)
> AssertionError
> ________________________________________________________________________________
> _____________ sympy/matrices/tests/test_matrices.py:test_simplify
> ______________
> File "/home/mateusz/repo/git/sympy/sympy/matrices/tests/test_matrices.py",
> line 910, in test_simplify
> [ 1 + y, 2*((1 - 1*cos(pi*n))/(pi*n)) ]])
> AssertionError
> ________________________________________________________________________________
> _______________ sympy/printing/tests/test_repr.py:test_Function
> ________________
> File "/home/mateusz/repo/git/sympy/sympy/printing/tests/test_repr.py",
> line 38, in test_Function
> sT(Function("f")(x), "Function('f')(Symbol('x'))")
> File "/home/mateusz/repo/git/sympy/sympy/printing/tests/test_repr.py",
> line 22, in sT
> assert eval(string, ENV) == expr
> AssertionError
> ________________________________________________________________________________
> _____________ sympy/simplify/tests/test_simplify.py:test_simplify
> ______________
> File "/home/mateusz/repo/git/sympy/sympy/simplify/tests/test_simplify.py",
> line 131, in test_simplify
> assert simplify(e) == 1 + y
> AssertionError
> ________________________________________________________________________________
> _______________ sympy/test_external/test_numpy.py:test_symarray
> ________________
> File "/home/mateusz/repo/git/sympy/sympy/test_external/test_numpy.py",
> line 256, in test_symarray
> assert s1[0] is s2[0]
> AssertionError
> ________________________________________________________________________________
> ___________ sympy/utilities/tests/test_lambdify.py:test_sympy_lambda
> ___________
> File
> "/home/mateusz/repo/git/sympy/sympy/utilities/tests/test_lambdify.py", line
> 77, in test_sympy_lambda
> assert f(x) is sin(x)
> AssertionError
>
> tests finished: 2660 passed, 6 failed, 5 skipped, 53 expected to fail,
> 3 expected to fail but passed, in 1055.75 seconds
> DO *NOT* COMMIT!
>
> Most of those problems are already known and mostly related to Function. It
> took 1056 seconds to run the whole test suit. With cache it takes only 210
> seconds (Xeon 3.0 GHz).
>
>
Well, I forget about $SYMPY_USE_CACHE, and that the cache system can be
hard tested with the help of this environment variable.
But when I wrote about the clearing of cache (new issue 2341 created
just now) I ment that it will be better to isolate some groups of tests
(which are grouped in the files "test_something.py") from the other
groups, therefore to clear cache only after the every test file, and do
not switch off the entire cache system for every calculation at whole as
the $SYMPY_USE_CACHE variable does.
In this case the slowing down is not so significant:
(a) - do not clear cache for every file: 276.15 - 277.72 seconds.
(b) - clear cache after every test (test function): 273.70 - 274.49
seconds.
(c) - clear cache after every test file: 264.04 seconds.
P.S. I specially carried out twice, because I noticed that (b) is
insignificantly faster then (a) unexpectedly.
--
Alexey U.
--
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.