Skip to content

Commit

Permalink
Merge pull request #2701 from AllenInstitute/ticket-2490_2
Browse files Browse the repository at this point in the history
fixes issue with loading trials from BehaviorEcephysSession.from_nwb
  • Loading branch information
aamster committed Jul 19, 2023
2 parents 5c54dd8 + 2adb3b5 commit 56d1423
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
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()

0 comments on commit 56d1423

Please sign in to comment.