Skip to content

Commit

Permalink
renamed new vector util to compute_signed_angle_2d
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Jan 16, 2025
1 parent a028458 commit 5f28f01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions movement/kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from movement.utils.reports import report_nan_values
from movement.utils.vector import (
compute_norm,
compute_signed_angle_2d,
convert_to_unit,
signed_angle_between_2d_vectors,
)
from movement.validators.arrays import validate_dims_coords

Expand Down Expand Up @@ -430,9 +430,7 @@ def compute_heading_angle(
)

# Compute signed angle between forward vector and reference vector
heading_array = signed_angle_between_2d_vectors(
forward_vector, reference_vector
)
heading_array = compute_signed_angle_2d(forward_vector, reference_vector)

Check warning on line 433 in movement/kinematics.py

View check run for this annotation

Codecov / codecov/patch

movement/kinematics.py#L433

Added line #L433 was not covered by tests

# Convert to degrees
if not in_radians:
Expand Down
2 changes: 1 addition & 1 deletion movement/utils/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def pol2cart(data: xr.DataArray) -> xr.DataArray:
).transpose(*dims)


def signed_angle_between_2d_vectors(
def compute_signed_angle_2d(
test_vector: xr.DataArray, reference_vector: xr.DataArray | npt.NDArray
) -> xr.DataArray:
r"""Compute the signed angle between two 2D vectors.
Expand Down

0 comments on commit 5f28f01

Please sign in to comment.