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 percentage distance methods #339

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

Conversation

JackB-Ansys
Copy link
Collaborator

Deprecate get_coordinate_from_percentage_distance methods because these actually use fractional distances. Replace this functionality by adding optional arguments for get_coordinate_from_distance, where user can specify a percentage or fraction instead of specifying an absolute distance.

@github-actions github-actions bot added the bug Something isn't working label Jul 15, 2024
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.20%. Comparing base (378875f) to head (da2b09d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #339      +/-   ##
==========================================
+ Coverage   87.08%   87.20%   +0.12%     
==========================================
  Files          20       20              
  Lines        2028     2048      +20     
==========================================
+ Hits         1766     1786      +20     
  Misses        262      262              

@jgsdavies
Copy link
Collaborator

Codecov Report

Attention: Patch coverage is 74.19355% with 8 lines in your changes missing coverage. Please review.

Project coverage is 84.10%. Comparing base (a3afd47) to head (0f9f663).
Report is 2 commits behind head on main.

Additional details and impacted files

@JackB-Ansys You will need to improve the existing tests to cover all the new lines of code

src/ansys/motorcad/core/geometry.py Show resolved Hide resolved
return Coordinate(x, y)

def get_coordinate_from_distance(self, ref_coordinate, distance):
def get_coordinate_from_distance(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this change. @matthewAnsys thoughts?

@@ -531,14 +531,31 @@ def test_line_length():
assert line.length == sqrt(2)


def test_arc_get_coordinate_from_percentage_distance():
def test_arc_get_coordinate_from_fractional_distance():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we make sure this also works for arcs with negative radius

@jgsdavies
Copy link
Collaborator

Needs merge from main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants