carrien / free-speech

Analysis and plotting code for speech neuroimaging experiments.
MIT License
4 stars 5 forks source link

create default option that doesn't just return empty #77

Closed cwnaber closed 1 year ago

cwnaber commented 1 year ago

After making PR #76 for simonSingleWord_v2, I'm trying to prevent the need to make a PR for each new experiment. Our convention for the last few years has been relatively consistent in that experiments use the function name "run_exptName_expt" and "run_exptName_audapter".

This change is not meant to capture every future experiment name. I am unable to think of a reasonable situation where this change would return the INCORRECT function name. It will just still fail to find the correct function name in certain situations. (As it would behave without this change.)

carrien commented 1 year ago

I was going to suggest the same thing before I saw this PR. I would even be fine with taking out most of the cases here, only including ones that deviated from run_%saudapter, and then if you reach the "otherwise", silently returning run%s_audapter if it exists. (Edit: I didn't mean silently, but without requiring user input -- I see now that is already how it is.)

cwnaber commented 1 year ago

@carrien Glad we had the same idea! I just made another commit to remove cases that adhered to defaults. Let me know if there's anything else you wanna change.

cwnaber commented 1 year ago

@carrien All reasonable comments -- resolved and tested again.