Skip to content

Commit

Permalink
Issue #75: Fixing numpy NaN deprecation.
Browse files Browse the repository at this point in the history
MattClarkson committed Dec 29, 2024
1 parent 62d1386 commit 69ee736
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions sksurgerycore/baseclasses/tracker.py
Original file line number Diff line number Diff line change
@@ -96,6 +96,7 @@ def get_smooth_frame(self, port_handles):
return smth_handles, smth_times, smth_frame_nos, smth_tracking, \
smth_qual

# pylint: disable=too-many-positional-arguments
def add_frame_to_buffer(self, port_handles, time_stamps, frame_numbers,
tracking_rot, tracking_trans, quality,
rot_is_quaternion = False):
4 changes: 2 additions & 2 deletions tests/algorithms/test_averagequaternions.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ def test_average_quat():
Test average quaternions
"""
quat0 = [0.0, 0.0, 0.0, 0.0]
quat1 = [np.NaN, np.NaN, np.NaN, np.NaN]
quat1 = [np.nan, np.nan, np.nan, np.nan]
quat2 = [math.cos(math.pi/4.0), 0.0, 0.0, -1.0 * math.sin(math.pi/4.0)]
quat3 = [math.cos(math.pi/8.0), 0.0, 1.0 * math.sin(math.pi/8.0), 0.0]

@@ -39,7 +39,7 @@ def test_weighted_average_quat():
Test weighted average quaternions
"""
quat0 = [0.0, 0.0, 0.0, 0.0]
quat1 = [np.NaN, np.NaN, np.NaN, np.NaN]
quat1 = [np.nan, np.nan, np.nan, np.nan]
quat2 = [math.cos(math.pi/4.0), 0.0, 0.0, -1.0 * math.sin(math.pi/4.0)]
quat3 = [math.cos(math.pi/8.0), 0.0, 1.0 * math.sin(math.pi/8.0), 0.0]

2 changes: 1 addition & 1 deletion tests/algorithms/test_tracking_smoothing.py
Original file line number Diff line number Diff line change
@@ -152,7 +152,7 @@ def test_rolling_rot_four_values():
Test rolling mean returns vector value for single entry
"""
rvec0 = [0.0, 0.0, 0.0]
rvec1 = [np.NaN, np.NaN, np.NaN]
rvec1 = [np.nan, np.nan, np.nan]
rvec2 = [0.0, 0.0, -math.pi/2.0]
rvec3 = [0.0, math.pi/3.0, 0.0]

0 comments on commit 69ee736

Please sign in to comment.