From 0e942523d300ac01d56ae8419cb62e696d3abae2 Mon Sep 17 00:00:00 2001 From: Chris Broz Date: Thu, 15 Sep 2022 13:40:12 -0500 Subject: [PATCH] Ensure Path type for get_spikeglx_meta_filepath --- element_array_ephys/ephys_acute.py | 11 ++++++++--- element_array_ephys/ephys_chronic.py | 9 +++++++-- element_array_ephys/ephys_no_curation.py | 9 +++++++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/element_array_ephys/ephys_acute.py b/element_array_ephys/ephys_acute.py index df7ebd73..056c64ce 100644 --- a/element_array_ephys/ephys_acute.py +++ b/element_array_ephys/ephys_acute.py @@ -890,9 +890,14 @@ def yield_unit_waveforms(): def get_spikeglx_meta_filepath(ephys_recording_key): # attempt to retrieve from EphysRecording.EphysFile - spikeglx_meta_filepath = (EphysRecording.EphysFile & ephys_recording_key - & 'file_path LIKE "%.ap.meta"').fetch1('file_path') - + spikeglx_meta_filepath = pathlib.Path( + ( + EphysRecording.EphysFile + & ephys_recording_key + & 'file_path LIKE "%.ap.meta"' + ).fetch1("file_path") + ) + try: spikeglx_meta_filepath = find_full_path(get_ephys_root_data_dir(), spikeglx_meta_filepath) diff --git a/element_array_ephys/ephys_chronic.py b/element_array_ephys/ephys_chronic.py index 2f6948e6..7c1ebecb 100644 --- a/element_array_ephys/ephys_chronic.py +++ b/element_array_ephys/ephys_chronic.py @@ -835,8 +835,13 @@ def yield_unit_waveforms(): def get_spikeglx_meta_filepath(ephys_recording_key): # attempt to retrieve from EphysRecording.EphysFile - spikeglx_meta_filepath = (EphysRecording.EphysFile & ephys_recording_key - & 'file_path LIKE "%.ap.meta"').fetch1('file_path') + spikeglx_meta_filepath = pathlib.Path( + ( + EphysRecording.EphysFile + & ephys_recording_key + & 'file_path LIKE "%.ap.meta"' + ).fetch1("file_path") + ) try: spikeglx_meta_filepath = find_full_path(get_ephys_root_data_dir(), diff --git a/element_array_ephys/ephys_no_curation.py b/element_array_ephys/ephys_no_curation.py index f0988917..17c45b7f 100644 --- a/element_array_ephys/ephys_no_curation.py +++ b/element_array_ephys/ephys_no_curation.py @@ -849,8 +849,13 @@ def yield_unit_waveforms(): def get_spikeglx_meta_filepath(ephys_recording_key): # attempt to retrieve from EphysRecording.EphysFile - spikeglx_meta_filepath = (EphysRecording.EphysFile & ephys_recording_key - & 'file_path LIKE "%.ap.meta"').fetch1('file_path') + spikeglx_meta_filepath = pathlib.Path( + ( + EphysRecording.EphysFile + & ephys_recording_key + & 'file_path LIKE "%.ap.meta"' + ).fetch1("file_path") + ) try: spikeglx_meta_filepath = find_full_path(get_ephys_root_data_dir(),