Skip to content

Commit

Permalink
hotfix: fix issue with lims passing vcn stim table instead of newer one
Browse files Browse the repository at this point in the history
  • Loading branch information
aamster committed Oct 25, 2022
1 parent 56354b1 commit 0223f6d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@

from typing import Optional

from ._schemas import InputParameters, OutputParameters
from ._current_source_density import (
accumulate_lfp_data,
compute_csd,
extract_trial_windows
)
from ._filter_utils import filter_lfp_channels, select_good_channels
from ._interpolation_utils import (
interp_channel_locs,
make_actual_channel_locations,
make_interp_channel_locations
)
from allensdk.brain_observatory.ecephys.current_source_density._schemas \
import \
InputParameters, OutputParameters
from allensdk.brain_observatory.ecephys.current_source_density.\
_current_source_density import (
accumulate_lfp_data,
compute_csd,
extract_trial_windows
)
from allensdk.brain_observatory.ecephys.current_source_density._filter_utils \
import filter_lfp_channels, select_good_channels
from allensdk.brain_observatory.ecephys.current_source_density\
._interpolation_utils import (
interp_channel_locs,
make_actual_channel_locations,
make_interp_channel_locations
)
from allensdk.brain_observatory.ecephys.file_io.continuous_file import (
ContinuousFile
)
Expand Down Expand Up @@ -75,6 +80,13 @@ def run_csd(args: dict) -> dict:

stimulus_table = pd.read_csv(args['stimulus']['stimulus_table_path'])

# backwards compatibility
stimulus_table['stimulus_name'] = stimulus_table['stimulus_name'].apply(
lambda x: args['stimulus']['key'] if x == 'flashes' else x)
if args['start_field'] not in stimulus_table:
stimulus_table = stimulus_table.rename(
columns={'Start': args['start_field']})

probewise_outputs = []
for probe_idx, probe in enumerate(args['probes']):
logging.info('Processing probe: {} (index: {})'.format(probe['name'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def extract_trial_windows(

if num_trials is not None:
trials = trials.iloc[:num_trials, :]
trials = trials.to_dict('record')
trials = trials.to_dict('records')

relative_times = np.arange(-pre_stimulus_time,
post_stimulus_time,
Expand Down

0 comments on commit 0223f6d

Please sign in to comment.