Skip to content

Commit 0a437f7

Browse files
committed
conditional return on exception
1 parent c145492 commit 0a437f7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/dynamic_routing_analysis/decoding_utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,8 @@ def decode_context_with_linear_shift(session=None,params=None,trials=None,units=
12621262
print(tb_str)
12631263
logger.debug(f'error in session {session_id}')
12641264
logger.debug(tb_str)
1265-
return None
1265+
if return_results:
1266+
return None
12661267

12671268

12681269
def concat_decoder_results(files,savepath=None,return_table=True,single_session=False,use_zarr=False):
@@ -1515,7 +1516,8 @@ def concat_decoder_results(files,savepath=None,return_table=True,single_session=
15151516
print(tb_str)
15161517
logger.debug(f'error with decoding results summary')
15171518
logger.debug(tb_str)
1518-
return None
1519+
if return_table:
1520+
return None
15191521

15201522

15211523
def compute_significant_decoding_by_area(all_decoder_results):
@@ -2474,7 +2476,8 @@ def concat_trialwise_decoder_results(files,savepath=None,return_table=False,n_un
24742476
print(tb_str)
24752477
logger.debug(f'error with trialwise decoding results summary')
24762478
logger.debug(tb_str)
2477-
return None
2479+
if return_table:
2480+
return None,None,None,None,None
24782481

24792482

24802483
def concat_decoder_summary_tables(dir,savepath):

0 commit comments

Comments
 (0)