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

Fixed order of return values of :func:.space_ops.cartesian_to_spherical #2168

Merged
merged 8 commits into from Oct 30, 2021

Conversation

Viicos
Copy link
Contributor

@Viicos Viicos commented Oct 7, 2021

Overview: What does this pull request change?

As mentioned in #2095, the returned array in cartesian_to_spherical is not in the correct order. spherical_to_cartesian is unpacking them correctly as r, theta, phi but cartesian_to_spherical returns the array in that order: r, phi, theta.

position_tip was also edited to be in accordance with the correct order.

Motivation and Explanation: Why and how do your changes improve the library?

Links to added or changed documentation pages

Further Information and Comments

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

@PhotonSpheres
Copy link
Member

Thanks for fixing this! It seems like that a specific test is failing now, can you look into that? Feel free to ask if you need help.

@Viicos
Copy link
Contributor Author

Viicos commented Oct 9, 2021

Thanks for fixing this! It seems like that a specific test is failing now, can you look into that? Feel free to ask if you need help.

Woops forgot to check if tests went good after my commit, forgot they were added in #2095.

@PhotonSpheres PhotonSpheres added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Oct 9, 2021
@PhotonSpheres PhotonSpheres changed the title Fixed spherical coords order in cartesian_to_spherical Fixed order in function cartesian_to_spherical Oct 9, 2021
Copy link
Member

@PhotonSpheres PhotonSpheres left a comment

Choose a reason for hiding this comment

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

Great! LGTM

@behackl
Copy link
Member

behackl commented Oct 13, 2021

This is just a general remark: what do you think about using named tuples in cases like these?

@Viicos
Copy link
Contributor Author

Viicos commented Oct 17, 2021

This is just a general remark: what do you think about using named tuples in cases like these?

Could be a good idea to avoid having situations like this one where the tuple order was incorrect, but we wouldn't be able to take advantage of the numpy arrays operations.

@behackl
Copy link
Member

behackl commented Oct 19, 2021

This is just a general remark: what do you think about using named tuples in cases like these?

Could be a good idea to avoid having situations like this one where the tuple order was incorrect, but we wouldn't be able to take advantage of the numpy arrays operations.

I wonder whether this would really be so much of a drawback. But maybe we'll come back to it eventually.

In any case, thank you for your efforts!

@behackl behackl enabled auto-merge (squash) October 30, 2021 21:14
@behackl behackl merged commit 85e7337 into ManimCommunity:main Oct 30, 2021
@behackl behackl changed the title Fixed order in function cartesian_to_spherical Fixed order of return values of :func:.space_ops.cartesian_to_spherical Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix Bug fix for use in PRs solving a specific issue:bug
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants