Skip to content

Commit 00f49ef

Browse files
committed
fix: processing on non-traditional file formats in blech_clust
1 parent 3e378db commit 00f49ef

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ requirements/.DS_Store
66
blech.dir
77
*.swp
88
*.Rhistory
9+
.aider*
10+
.env

blech_clust.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,6 @@ def generate_processing_scripts(dir_name, blech_clust_dir, electrode_layout_fram
299299
if file_type[0] != 'traditional':
300300
electrodes_list = file_lists[file_type[0]]['electrodes']
301301
dig_in_file_list = file_lists[file_type[0]]['dig_in']
302-
else:
303-
rhd_file_list = file_lists[file_type[0]]['rhd']
304302

305303
# Use info file for port list calculation
306304
info_file = np.fromfile(dir_name + '/info.rhd', dtype=np.dtype('float32'))
@@ -318,6 +316,7 @@ def generate_processing_scripts(dir_name, blech_clust_dir, electrode_layout_fram
318316
ports = info_dict['ports']
319317

320318
if file_type[0] == 'traditional':
319+
rhd_file_list = file_lists[file_type[0]]['rhd']
321320
with open(rhd_file_list[0], 'rb') as f:
322321
header = read_header(f)
323322
# temp_file, data_present = importrhdutilities.load_file(file_list[0])

pipeline_testing/prefect_pipeline.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -519,33 +519,29 @@ def emg_only_test():
519519
@flow(log_prints=True)
520520
def full_test():
521521
if break_bool:
522-
for data_type in ['emg', 'emg_spike']:
523-
print(f'Running full test with data type : {data_type}')
524-
prep_data_flow(data_type = data_type)
525-
run_spike_test()
526-
run_emg_main_test()
522+
spike_only_test()
523+
emg_only_test()
524+
spike_emg_test()
527525
else:
528-
for data_type in ['emg', 'emg_spike']:
529-
print(f'Running full test with data type : {data_type}')
530-
try:
531-
prep_data_flow(data_type = data_type)
532-
except:
533-
print('Failed to prep data')
534-
try:
535-
run_spike_test()
536-
except:
537-
print('Failed to run spike test')
538-
try:
539-
run_emg_main_test()
540-
except:
541-
print('Failed to run emg test')
526+
try:
527+
spike_only_test()
528+
except:
529+
print('Failed to run spike test')
530+
try:
531+
emg_only_test()
532+
except:
533+
print('Failed to run emg test')
534+
try:
535+
spike_emg_test()
536+
except:
537+
print('Failed to run spike+emg test')
542538

543539
############################################################
544540
## Run Flows
545541
############################################################
546542
# If no individual tests are required, run both
547543
if args.all:
548-
print('Running spike and emg tests')
544+
print('Running all tests')
549545
full_test(return_state=True)
550546
elif args.e:
551547
print('Running emg tests only')

0 commit comments

Comments
 (0)