Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion participants/scipy_000/pr_tutorial/buggy_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def angle_to_sexigesimal(angle_in_degrees, decimals=3):
if math.floor(decimals) != decimals:
raise OSError('decimals should be an integer!')

hours_num = angle_in_degrees*24/180
hours_num = angle_in_degrees*24/360
Copy link

@DavidVFiumano DavidVFiumano Jul 14, 2023

Choose a reason for hiding this comment

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

What test did you do to demonstrate this fixed the function? Could you make it into a unit test?

Copy link
Author

Choose a reason for hiding this comment

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

Good idea! I added a basic unit test based off the other example test function.

hours = math.floor(hours_num)

min_num = (hours_num - hours)*60
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from pr_tutorial.buggy_function import angle_to_sexigesimal

def test_angle_to_sexigesimal_30():
assert angle_to_sexigesimal(30) == "2:0:0.000"