sympy / sympy_benchmarks

Some benchmarks of SymPy
14 stars 32 forks source link

Mechanics benchmarks failing for old commits #28

Open moorepants opened 8 years ago

moorepants commented 8 years ago

Example:

[  1.18%] · For sympy commit hash 6ef7f5b5:
[  1.18%] ·· Building for py2.7-fastcache-mpmath....
[  1.18%] ·· Benchmarking py2.7-fastcache-mpmath
[  1.19%] ··· Running physics.mechanics.kane.KanesMethodMassSpringDamper.time_kanesmethod_mass_spring_damper                                                                       failed
[  1.19%] ····· Traceback (most recent call last):
                  File "/home/moorepants/src/asv/asv/benchmark.py", line 685, in <module>
                    result = benchmark.do_run()
                  File "/home/moorepants/src/asv/asv/benchmark.py", line 405, in do_run
                    return self.run(*self._current_params)
                  File "/home/moorepants/src/asv/asv/benchmark.py", line 472, in run
                    timing = timer.timeit(number)
                  File "/home/moorepants/src/sympy_benchmarks/env/f5b82df50164b5d73101b16d6e2f197f/lib/python2.7/timeit.py", line 202, in timeit
                    timing = self.inner(it, self.timer)
                  File "/home/moorepants/src/sympy_benchmarks/env/f5b82df50164b5d73101b16d6e2f197f/lib/python2.7/timeit.py", line 100, in inner
                    _func()
                  File "benchmarks/physics/mechanics/kane.py", line 35, in time_kanesmethod_mass_spring_damper
                    self.KM.kanes_equations(self.body_list, self.force_list)
                  File "/home/moorepants/src/sympy_benchmarks/env/f5b82df50164b5d73101b16d6e2f197f/lib/python2.7/site-packages/sympy/physics/mechanics/kane.py", line 712, in kanes_equations
                    fr = self._form_fr(FL)
                  File "/home/moorepants/src/sympy_benchmarks/env/f5b82df50164b5d73101b16d6e2f197f/lib/python2.7/site-packages/sympy/physics/mechanics/kane.py", line 276, in _form_fr
                    vel_list, f_list = _f_list_parser(fl, N)
                  File "/home/moorepants/src/sympy_benchmarks/env/f5b82df50164b5d73101b16d6e2f197f/lib/python2.7/site-packages/sympy/physics/mechanics/functions.py", line 571, in _f_list_parser
                    vel_list, f_list = unzip(list(flist_iter()))
                  File "/home/moorepants/src/sympy_benchmarks/env/f5b82df50164b5d73101b16d6e2f197f/lib/python2.7/site-packages/sympy/physics/mechanics/functions.py", line 562, in flist_iter
                    for obj, force in fl:
                TypeError: 'Particle' object is not iterable

@jbm950

jbm950 commented 8 years ago

At a glance this appears to be due to this line

self.KM.kanes_equations(self.body_list, self.force_list)

I remember discussing that the input order for kanes_equations() was swapped recently. What would you like me to do?

moorepants commented 8 years ago

You can use the deprecated API and it will work for all past versions or put a check for version number (git commit hash) so that everything before that change uses old and everything after uses new.

jbm950 commented 8 years ago

I found the commit. How do I tell what versions it was applied to?

moorepants commented 8 years ago

I don't think it has been applied to any versions yet. It is post last release. You'll need to ask stackoverflow and the google about the git kungfu needed to figure that out.

jbm950 commented 8 years ago

Opened a PR that should address this problem

moorepants commented 8 years ago

The first one is now fixed but we also have this api change too:

[  0.07%] ····· Traceback (most recent call last):
                  File "/home/moorepants/src/asv/asv/benchmark.py", line 794, in <module>
                    commands[mode](args)
                  File "/home/moorepants/src/asv/asv/benchmark.py", line 765, in main_run
                    skip = benchmark.do_setup()
                  File "/home/moorepants/src/asv/asv/benchmark.py", line 498, in do_setup
                    result = Benchmark.do_setup(self)
                  File "/home/moorepants/src/asv/asv/benchmark.py", line 433, in do_setup
                    setup(*self._current_params)
                  File "/home/moorepants/src/sympy_benchmarks/benchmarks/physics/mechanics/lagrange.py", line 24, in setup
                    Pa.potential_energy = k * q**2 / 2.0
                AttributeError: can't set attribute