From afdc06faa4926fba0aab9edab279d779e4cdbf65 Mon Sep 17 00:00:00 2001 From: colleenjg Date: Sun, 11 Oct 2020 23:01:33 -0400 Subject: [PATCH] GH #1741 - running speed main bugfix Fixes 2 errors in allensdk.brain_observatory.extract_running_speed.__main__.py in `extract_running_speeds()`. In the if/else statement (lines 61-65), 1) the second consecutive `=` (a typo) was corrected to `\` so that `dx_rad` is divided by median duration. 2) The if/else clauses were switched, so that the if `use_median_duration` statement is the one that uses np.median(durations) and not v.v. --- allensdk/brain_observatory/extract_running_speed/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/allensdk/brain_observatory/extract_running_speed/__main__.py b/allensdk/brain_observatory/extract_running_speed/__main__.py index 92c4b2307..32dd0c1bc 100644 --- a/allensdk/brain_observatory/extract_running_speed/__main__.py +++ b/allensdk/brain_observatory/extract_running_speed/__main__.py @@ -60,9 +60,9 @@ def extract_running_speeds( durations = end_times - start_times if use_median_duration: - angular_velocity = dx_rad / durations + angular_velocity = dx_rad / np.median(durations) else: - angular_velocity = dx_rad = np.median(durations) + angular_velocity = dx_rad / durations radius = wheel_radius * subject_position linear_velocity = angular_to_linear_velocity(angular_velocity, radius)