Skip to content

Running speed incorrectly calculated. #1741

@colleenjg

Description

@colleenjg

Describe the bug
2 errors introduced by latest commit to allensdk/brain_observatory/extract_running_speed/__main__.py in extract_running_speeds().

  1. The if/else statements (line 62-65) are reversed: median duration is not used if use_median_duration is True, and is used otherwise.
  2. In the else statement, angular_velocity is accidentally set to the median duration due to a = instead of a / on line 65. As a result, the running velocity array is set entirely to a single repeating value, namely the median duration.

allensdk version 2.3.0


FIX:

if use_median_duration:
    angular_velocity = dx_rad / durations
else:
    angular_velocity = dx_rad = np.median(durations)

should be

if use_median_duration:
    angular_velocity = dx_rad / np.median(durations)
else:
    angular_velocity = dx_rad / durations

Metadata

Metadata

Assignees

No one assigned

    Labels

    braintvrelates to Insitute BrainTV programbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions