Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in example three_link_conical_pendulum #481

Merged
merged 1 commit into from Nov 12, 2022

Conversation

AlainLich
Copy link
Contributor

Fix bug causing error, traceback shown below.

Error: wrong argument ordering and argument keyword not used.

traceback (most recent call last):
File "/home/alain/test/physique/Sympy/Examples/three_link_conical_pendulum/visualize.py", line 9, in
from derive import I, O, links, particles, q, u
File "/home/alain/test/physique/Sympy/Examples/three_link_conical_pendulum/derive.py", line 139, in
fr, frstar = kane.kanes_equations(forces, total_system)
File "/usr/lib/python3/dist-packages/sympy/physics/mechanics/kane.py", line 543, in kanes_equations
fr = self._form_fr(loads)
File "/usr/lib/python3/dist-packages/sympy/physics/mechanics/kane.py", line 283, in _form_fr
vel_list, f_list = _f_list_parser(fl, N)
File "/usr/lib/python3/dist-packages/sympy/physics/mechanics/functions.py", line 724, in _f_list_parser
vel_list, f_list = unzip(list(flist_iter()))
File "/usr/lib/python3/dist-packages/sympy/physics/mechanics/functions.py", line 711, in flist_iter
obj, force = pair
TypeError: cannot unpack non-iterable RigidBody object

Please edit below based on the type of PR. It is then the duty of reviewers to check off the items as they are completed. If any questions are not relevant to your particular pull request, a reviewer will simply check it off as done.

New Feature

  • There are no merge conflicts.
  • If there is a related issue, a reference to that issue is in the
    commit message.
  • Unit tests have been added for the new feature.
  • The PR passes tests both locally (run nosetests) and on Travis CI.
  • All public methods and classes have docstrings. (We use the numpydoc
    format
    .)
  • An explanation has been added to the online documentation. (docs
    directory)
  • The code follows PEP8 guidelines. (use a linter, e.g.
    pylint, to check your code)
  • The new feature is documented in the Release
    Notes
    .
  • The code is backwards compatible. (All public methods/classes must
    follow deprecation cycles.)
  • All reviewer comments have been addressed.

Bug Fix

  • There are no merge conflicts.
  • If there is a related issue, a reference to that issue is in the
    commit message.
  • Unit tests have been added for the bug. (Please reference the issue #
    in the unit test.)
  • The tests pass both locally (run nosetests) and on Travis CI.
  • The code follows PEP8 guidelines. (use a linter, e.g.
    pylint, to check your code)
  • The bug fix is documented in the Release
    Notes
    .
  • The code is backwards compatible. (All public methods/classes must
    follow deprecation cycles.)
  • All reviewer comments have been addressed.

Example

  • There are no merge conflicts with the master branch.
  • Examples rst file is placed in docs/examples/.
  • An entry with a 200x200 pixel image has been added to
    docs/index.rst.
  • RsT and image filenames are kebab-case (lower case hyphen-separated).
  • jupyter_sphinx RsT directives are used to ensure example is executed
    on build.
  • jupyter_sphinx ipynb and py download links are included.
  • The example has adequate text and figures (preferably SVG) explaining
    the problem.
  • All reviewer comments have been addressed.

Corrects bug causing  traceback below.
Error: wrong argument ordering and arg. keyword not used.

traceback (most recent call last):
  File "/home/alain/test/physique/Sympy/Examples/three_link_conical_pendulum/visualize.py", line 9, in <module>
    from derive import I, O, links, particles, q, u
  File "/home/alain/test/physique/Sympy/Examples/three_link_conical_pendulum/derive.py", line 139, in <module>
    fr, frstar = kane.kanes_equations(forces, total_system)
  File "/usr/lib/python3/dist-packages/sympy/physics/mechanics/kane.py", line 543, in kanes_equations
    fr = self._form_fr(loads)
  File "/usr/lib/python3/dist-packages/sympy/physics/mechanics/kane.py", line 283, in _form_fr
    vel_list, f_list = _f_list_parser(fl, N)
  File "/usr/lib/python3/dist-packages/sympy/physics/mechanics/functions.py", line 724, in _f_list_parser
    vel_list, f_list = unzip(list(flist_iter()))
  File "/usr/lib/python3/dist-packages/sympy/physics/mechanics/functions.py", line 711, in flist_iter
    obj, force = pair
TypeError: cannot unpack non-iterable RigidBody object
@moorepants
Copy link
Member

Thanks.

@moorepants moorepants merged commit b843bae into pydy:master Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants