Skip to content

Commit

Permalink
removed "analysis" level from namespace (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi authored Oct 24, 2024
1 parent f7f3b48 commit 1b6b44d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/source/getting_started/movement_dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.

Expand Down
8 changes: 4 additions & 4 deletions examples/compute_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/filter_and_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file removed movement/analysis/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion movement/analysis/kinematics.py → movement/kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()\
<movement.analysis.kinematics.compute_forward_vector>`. For more
<movement.kinematics.compute_forward_vector>`. For more
detailed information on how the head direction vector is computed,
please refer to the documentation for that function.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration/test_kinematics_vector_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion tests/test_unit/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
import xarray as xr

from movement.analysis import kinematics
from movement import kinematics


@pytest.mark.parametrize(
Expand Down

0 comments on commit 1b6b44d

Please sign in to comment.