From 7242a1d82714065c8ddaa5191a6b74239f8e625a Mon Sep 17 00:00:00 2001 From: kushalbakshi Date: Wed, 10 Jan 2024 16:30:11 -0600 Subject: [PATCH 1/2] Minor fixes --- element_array_ephys/ephys_acute.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/element_array_ephys/ephys_acute.py b/element_array_ephys/ephys_acute.py index 9b7b5c8d..67a224ec 100644 --- a/element_array_ephys/ephys_acute.py +++ b/element_array_ephys/ephys_acute.py @@ -10,10 +10,10 @@ import pandas as pd from element_interface.utils import dict_to_uuid, find_full_path, find_root_directory -from . import ephys_report, get_logger, probe +from . import ephys_report, probe from .readers import kilosort, openephys, spikeglx -log = get_logger(__name__) +log = dj.logger schema = dj.schema() @@ -126,7 +126,7 @@ class AcquisitionSoftware(dj.Lookup): acq_software ( varchar(24) ): Acquisition software, e.g,. SpikeGLX, OpenEphys """ - definition = """ # Software used for recording of neuropixels probes + definition = """ # Name of software used for recording of neuropixels probes - SpikeGLX or Open Ephys acq_software: varchar(24) """ contents = zip(["SpikeGLX", "Open Ephys"]) @@ -180,7 +180,10 @@ def auto_generate_entries(cls, session_key): "probe_type": spikeglx_meta.probe_model, "probe": spikeglx_meta.probe_SN, } - if probe_key["probe"] not in [p["probe"] for p in probe_list]: + if ( + probe_key["probe"] not in [p["probe"] for p in probe_list] + and probe_key not in probe.Probe() + ): probe_list.append(probe_key) probe_dir = meta_filepath.parent @@ -204,7 +207,10 @@ def auto_generate_entries(cls, session_key): "probe_type": oe_probe.probe_model, "probe": oe_probe.probe_SN, } - if probe_key["probe"] not in [p["probe"] for p in probe_list]: + if ( + probe_key["probe"] not in [p["probe"] for p in probe_list] + and probe_key not in probe.Probe() + ): probe_list.append(probe_key) probe_insertion_list.append( { @@ -533,7 +539,6 @@ def make(self, key): - 1 : 0 : -self._skip_channel_counts ] - # (sample x channel) lfp = oe_probe.lfp_timeseries[:, lfp_channel_ind] lfp = ( lfp * np.array(oe_probe.lfp_meta["channels_gains"])[lfp_channel_ind] @@ -1588,3 +1593,4 @@ def get_recording_channels_details(ephys_recording_key: dict) -> np.array: ) return channels_details + \ No newline at end of file From 942897d0b17fdb1d2b133b8781a88b58ff848200 Mon Sep 17 00:00:00 2001 From: kushalbakshi Date: Wed, 10 Jan 2024 16:31:07 -0600 Subject: [PATCH 2/2] Black formatting --- element_array_ephys/ephys_acute.py | 1 - element_array_ephys/spike_sorting/ecephys_spike_sorting.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/element_array_ephys/ephys_acute.py b/element_array_ephys/ephys_acute.py index 67a224ec..cbafb194 100644 --- a/element_array_ephys/ephys_acute.py +++ b/element_array_ephys/ephys_acute.py @@ -1593,4 +1593,3 @@ def get_recording_channels_details(ephys_recording_key: dict) -> np.array: ) return channels_details - \ No newline at end of file diff --git a/element_array_ephys/spike_sorting/ecephys_spike_sorting.py b/element_array_ephys/spike_sorting/ecephys_spike_sorting.py index b8675523..6f7a8687 100644 --- a/element_array_ephys/spike_sorting/ecephys_spike_sorting.py +++ b/element_array_ephys/spike_sorting/ecephys_spike_sorting.py @@ -337,4 +337,4 @@ def _get_execution_duration(modules_input_hash_fp, modules_to_run): dur = modules_status[m]["duration"] or 0 logged_exec_dur += int(dur) - return logged_exec_dur, modules_status \ No newline at end of file + return logged_exec_dur, modules_status