diff --git a/docs/source/getting_started/movement_dataset.md b/docs/source/getting_started/movement_dataset.md index 7e80a81c..c13128d2 100644 --- a/docs/source/getting_started/movement_dataset.md +++ b/docs/source/getting_started/movement_dataset.md @@ -232,7 +232,7 @@ Let's imagine we want to compute the instantaneous velocity of all tracked points and store the results within the same dataset, for convenience. ```python -from movement.analysis.kinematics import compute_velocity +from movement.kinematics import compute_velocity # compute velocity from position velocity = compute_velocity(ds.position) @@ -246,7 +246,7 @@ ds["velocity"] = compute_velocity(ds.position) ds.velocity ``` -The output of {func}`movement.analysis.kinematics.compute_velocity` is an {class}`xarray.DataArray` object, +The output of {func}`movement.kinematics.compute_velocity` is an {class}`xarray.DataArray` object, with the same **dimensions** as the original `position` **data variable**, so adding it to the existing `ds` makes sense and works seamlessly. diff --git a/examples/compute_kinematics.py b/examples/compute_kinematics.py index d9107696..230131cc 100644 --- a/examples/compute_kinematics.py +++ b/examples/compute_kinematics.py @@ -117,18 +117,18 @@ # %% # Compute displacement # --------------------- -# The :mod:`movement.analysis.kinematics` module provides functions to compute +# The :mod:`movement.kinematics` module provides functions to compute # various kinematic quantities, # such as displacement, velocity, and acceleration. # We can start off by computing the distance travelled by the mice along # their trajectories: -import movement.analysis.kinematics as kin +import movement.kinematics as kin displacement = kin.compute_displacement(position) # %% -# The :func:`movement.analysis.kinematics.compute_displacement` +# The :func:`movement.kinematics.compute_displacement` # function will return a data array equivalent to the ``position`` one, # but holding displacement data along the ``space`` axis, rather than # position data. @@ -269,7 +269,7 @@ velocity = kin.compute_velocity(position) # %% -# The :func:`movement.analysis.kinematics.compute_velocity` +# The :func:`movement.kinematics.compute_velocity` # function will return a data array equivalent to # the ``position`` one, but holding velocity data along the ``space`` axis, # rather than position data. Notice how ``xarray`` nicely deals with the diff --git a/examples/filter_and_interpolate.py b/examples/filter_and_interpolate.py index fa18582b..baa17e99 100644 --- a/examples/filter_and_interpolate.py +++ b/examples/filter_and_interpolate.py @@ -9,8 +9,8 @@ # Imports # ------- from movement import sample_data -from movement.analysis.kinematics import compute_velocity from movement.filtering import filter_by_confidence, interpolate_over_time +from movement.kinematics import compute_velocity # %% # Load a sample dataset diff --git a/movement/analysis/__init__.py b/movement/analysis/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/movement/analysis/kinematics.py b/movement/kinematics.py similarity index 99% rename from movement/analysis/kinematics.py rename to movement/kinematics.py index b1bce6ac..17126d3e 100644 --- a/movement/analysis/kinematics.py +++ b/movement/kinematics.py @@ -290,7 +290,7 @@ def compute_head_direction_vector( """Compute the 2D head direction vector given two keypoints on the head. This function is an alias for :func:`compute_forward_vector()\ - `. For more + `. For more detailed information on how the head direction vector is computed, please refer to the documentation for that function. diff --git a/tests/test_integration/test_kinematics_vector_transform.py b/tests/test_integration/test_kinematics_vector_transform.py index 5fa1b91c..e91f4d64 100644 --- a/tests/test_integration/test_kinematics_vector_transform.py +++ b/tests/test_integration/test_kinematics_vector_transform.py @@ -4,7 +4,7 @@ import pytest import xarray as xr -import movement.analysis.kinematics as kin +import movement.kinematics as kin from movement.utils import vector diff --git a/tests/test_unit/test_kinematics.py b/tests/test_unit/test_kinematics.py index a54d199c..4c529f24 100644 --- a/tests/test_unit/test_kinematics.py +++ b/tests/test_unit/test_kinematics.py @@ -4,7 +4,7 @@ import pytest import xarray as xr -from movement.analysis import kinematics +from movement import kinematics @pytest.mark.parametrize(