Skip to content

Fix Trajectory data backward compatibility#311

Merged
beverlylytle merged 5 commits into
compas-dev:mainfrom
yijiangh:fix-traj_data_backward_compat
Jun 22, 2021
Merged

Fix Trajectory data backward compatibility#311
beverlylytle merged 5 commits into
compas-dev:mainfrom
yijiangh:fix-traj_data_backward_compat

Conversation

@yijiangh
Copy link
Copy Markdown
Contributor

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

This PR includes a small fix to make compas_fab.robots.JointTrajectory's from_data compatible with json data generated before compas_fab 0.18.0, before the JointTrajectoryPoint class attributes values and types are changed to joint_values and joint_types, and the attached_collision_meshes attribute is introduced.

While I am very eager to try out all the exciting features introduced in the latest version, I found upgrading the version turned all of my previously saved JointTrajectory data unparsable. I understand that we cannot keep compatible with everything in the past, but I found being backward-compatible for a longer time period can be very beneficial.

This PR also includes a small fix to disable redirect_stdout when used in a Jupyter notebook environment. Jupyter notebook (ipython) will raise UnsupportedOperation on fileno(): ipython/ipython#3072. I suggest we can simply circumvent redirect_stdout since C output is hidden anyway by default in ipython, unless we use some external piping package like https://github.com/minrk/wurlitzer.

This PR is also related to compas-dev/compas#867

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I added a line to the CHANGELOG.rst file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas_fab.robots.CollisionMesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

Copy link
Copy Markdown
Member

@gonzalocasas gonzalocasas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@beverlylytle wanna give it a look in case I'm missing something?

@beverlylytle
Copy link
Copy Markdown
Member

LGTM, too! The deploy-and-publish workflow is failing because one of the links is broken/dead. Maybe replace the link in line

Available at: https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.552.109.
with http://wseas.us/e-library/conferences/crete2002/papers/444-809.pdf

@yijiangh
Copy link
Copy Markdown
Contributor Author

@beverlylytle I pushed another change to fix the link, now it seems to be good to go?

@beverlylytle
Copy link
Copy Markdown
Member

Yep, it is! Thanks for improving the code!

@beverlylytle beverlylytle merged commit dab12ba into compas-dev:main Jun 22, 2021
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.

3 participants