I have the following function which I'm using to run pieces of analysis.
If I set run_all_analysis = True, I want to run both analysis_1 and analysis_2. If I set run_analysis_1 = True when run_all_analysis is False, I will just run analysis_1 (likewise for analysis_2)
def save_locally(self,
run_all_analysis: bool = False,
run_analysis_1: bool = False,
run_analysis_2: bool = False):
if run_all_analysis:
run_analysis_1 = True
run_analysis_2 = True
if run_analysis_1 = True
# some function that saves analysis 1 to local folder
if run_analysis_2 = True
# some function that saves analysis 2 to local folder
The issue is, I have lots of different pieces of analysis (around 20) and so this function could get really long. Is there a way to automatically set all input arguments to TRUE if run_all_analysis is TRUE (rather than writing out all the input arguments one by one?)?