Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ticket/PSB-70: Flipped running polarity for VBN behavior only sessions. #2667

Merged
merged 1 commit into from
May 31, 2023

Conversation

morriscb
Copy link
Contributor

No description provided.

@morriscb morriscb marked this pull request as ready for review March 21, 2023 17:21
"""
mean_speed = running_speed['speed'].mean()
output_frame = running_speed.copy()
if mean_speed < -1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was it decided that mean_speed < -1 indicates flipped polarity? Why not < 0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same question. Seems like a negative average running speed is bad.

Copy link
Contributor Author

@morriscb morriscb Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was proposed by the engineering group according to the issue. My assumption the value is -1 as you could have a case where a mouse is not running very much and the noise causes the mean to be below zero even fractionally. You can check out the plots of the mean histogram here. You can see a peak at just above zero with a slight tail to zero and lower values. @corbennett do you have any further context?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, please link to that histogram in the code so it is clear why that value is hardcoded

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -63,6 +64,32 @@ def __init__(
self._stimulus_timestamps = stimulus_timestamps
self._filtered = filtered

@staticmethod
def _check_running_speed(running_speed: pd.DataFrame) -> pd.DataFrame:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please name this something more specific like _fix_polarity

average speed is < -1 cm/s
"""
mean_speed = running_speed['speed'].mean()
output_frame = running_speed.copy()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copying here not needed. You are modifying the dataframe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly just end up being cautious about editing in place but you're right, I'll just edit and return the changed df.

"""
mean_speed = running_speed['speed'].mean()
output_frame = running_speed.copy()
if mean_speed < -1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same question. Seems like a negative average running speed is bad.

@morriscb morriscb changed the base branch from master to rc/2.15.2 March 22, 2023 21:05
"""
mean_speed = running_speed['speed'].mean()
output_frame = running_speed.copy()
if mean_speed < -1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, please link to that histogram in the code so it is clear why that value is hardcoded

Add link to issue with histogram.
@morriscb morriscb force-pushed the ticket/PSB-70/dev branch 2 times, most recently from 646cd39 to a56d845 Compare May 26, 2023 22:05
@morriscb morriscb merged commit 5f460cf into rc/2.15.2 May 31, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants