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

Remove toggles for signed angle computations #445

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

willGraham01
Copy link
Contributor

@willGraham01 willGraham01 commented Feb 27, 2025

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

See #438 - simplifies the call signature of functions that compute angles between vectors, and allows us to use precise language in our doc-strings when describing these quantities.

Also see #427.

Both of these issues were raised in #416, but were shifted to issues to reduce the PR complexity. Now that #416 is merged, we can apply these changes. Have tagged the original, hard-working reviewers from that PR here (but probably only one pair of eyes needed) 😅

What does this PR do?

Removes the option to toggle the "angle direction" in (high-level) functions that compute signed angles between two vectors, in some capacity. Specifically;

The above functions already adhered to a consistent convention when their default values were used, which has been made the definition and standard.

The lower-level compute_signed_angle_2d function, that these functions all depend on, has retained it's v_as_left_operand argument. This is because the function is asymmetric in its arguments, and there may be cases where we really do want to swap the roles of the input u and v.

Small Test Suite Changes

One error-case test has been removed, since this is actually tested by compute_signed_angle_2d anyway - and in fact the error that is checked-for is raised within that function.

A test that the in_degrees toggle for compute_forward_vector_angle has been added, since CodeCov was complaining.

References

Closes #427.
Closes #438.

How has this PR been tested?

Since this is just removal of a feature, the now-irrelevant parts of the test suite have been removed. All other tests still pass with the adoption of the new convention.

Is this a breaking change?

No.

Does this PR require an update to the documentation?

No.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.84%. Comparing base (b0676b7) to head (271e7c1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #445      +/-   ##
==========================================
- Coverage   99.84%   99.84%   -0.01%     
==========================================
  Files          23       23              
  Lines        1312     1301      -11     
==========================================
- Hits         1310     1299      -11     
  Misses          2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@willGraham01 willGraham01 marked this pull request as ready for review February 27, 2025 10:47
@sfmig
Copy link
Contributor

sfmig commented Feb 27, 2025

@niksirbi I can pick this up if you want

@niksirbi
Copy link
Member

@niksirbi I can pick this up if you want

Thanks! Happy for you to take charge of reviewing this.

@sfmig sfmig removed the request for review from niksirbi February 27, 2025 14:02
Copy link
Contributor

@sfmig sfmig left a comment

Choose a reason for hiding this comment

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

Looks great @willGraham01 ! 🚀

I just spotted a couple of references to old syntax, the other two are minor comments.

So nice to have this functionality 🤩

@willGraham01 willGraham01 enabled auto-merge March 3, 2025 08:40

This comment was marked as resolved.

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.

Fix convention of signed angles Switch compute_forward_vector_angle to return radian angles by default
3 participants