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

fixes issue with loading trials from BehaviorEcephysSession.from_nwb #2701

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, List, Dict, Any, Union, Callable, Tuple
from typing import Optional, List, Dict, Any, Union, Callable, Tuple, Type

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -50,6 +50,10 @@ def _get_monitor_delay():
# used to collect the ecephys sessions for VBN
return 0.02

@classmethod
def _trials_class(cls) -> Type[Trials]:
return VBNTrials

@classmethod
def from_lims(cls, behavior_session_id: int,
lims_db: Optional[Any] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,17 @@ def test_getters_sanity(behavior_ecephys_session_fixture):
behavior_ecephys_session_fixture.get_performance_metrics()
behavior_ecephys_session_fixture.get_rolling_performance_df()
behavior_ecephys_session_fixture.get_reward_rate()


@pytest.mark.requires_bamboo
def test_getters_sanity_from_nwb(
behavior_ecephys_session_fixture):
"""Sanity check to make sure that the BehaviorEcephysSession
can use the BehaviorSession base class getter methods when read from nwb
"""
nwbfile, _ = behavior_ecephys_session_fixture.to_nwb()

sess = BehaviorEcephysSession.from_nwb(nwbfile=nwbfile)
sess.get_performance_metrics()
sess.get_rolling_performance_df()
sess.get_reward_rate()