def get_user_inputs(self): for i in range(self.number_of_func): print("") print(CVIOLET + "Enter Params for Function " + str(i + 1) + CEND) print("") _input = {} question = [ List('type', message="Which function type to run?", choices=['magnitude', 'categorical']), Text('start', message="Bioperiod Start Date. Example: 10/20", validate=lambda _, d: d is not ''), Text('end', message="Bioperiod End Date. Example: 06/20", validate=lambda _, d: d is not '') ] answers = prompt(question) _input["type"] = answers['type'] _input["bioperiod_start_date"] = answers['start'] _input["bioperiod_end_date"] = answers['end'] cate_question = [ Text('binnings', message="Define the binnings. Example: 0.3, 0.5 ", validate=lambda _, d: d is not ''), ] if answers['type'] == 'categorical': cate_answer = prompt(cate_question) _input["binnings"] = [ float(x.strip()) for x in cate_answer['binnings'].split(',') ] _input["binnings"].insert(0, 0) self.user_inputs["func_" + str(i)] = _input
def run(): # choices=["noisy_alignment", # "sup_denoising", # "unsup_denoising", # "noisy_hdr", # "none"] choices = ["noisy_alignment", "unsup_denoising", "none"] options = [ List('exp', message="Pick a experiment to run!", choices=choices) ] answer = prompt(options) if answer['exp'] == "noisy_hdr": noisy_hdr.run() elif answer['exp'] == "sup_denoising": sup_denoising.run() elif answer['exp'] == "unsup_denoising": unsup_denoising.run() elif answer['exp'] == "noisy_alignment": noisy_alignment.run() elif answer['exp'] == "none": print("No experiment today! Go outside :D")
def get_user_inputs(self): # inquirer questions for hydrologic_variable, binning, and functional_bin_number print('') questions = [ List( 'hydrologic_variable', message="Which hydrologic variable?", choices=['d: depth', 'v: velocity', 't: shear stress'], ), Text('binning', message="Define the binning. Example: 1.2, 2.1 ", validate=lambda _, d: d is not ''), Text('functional_bin_number', message="Input functional bin number. Example: 0 or 1", validate=lambda _, d: will_it_float(d)), ] answers = prompt(questions) # parse answers to desired values self.hydrologic_variable = answers['hydrologic_variable'][0] self.binning = [ float(x.strip()) for x in answers['binning'].split(',') ] self.functional_bin_number = int(answers['functional_bin_number'])