In an application we use different buttons to clear tables. I’ve tried to simplify the code by separating primary functions and one secondary function, like this:
def clear_sls_table(self):
self.clear_table(limit_state='service_limit_state')
def clear_uls_table(self):
self.clear_table(limit_state='ultimate_limit_state')
def clear_als_table(self):
self.clear_table(limit_state='accidental_limit_state')
@staticmethod
def clear_table(limit_state: str):
new_params = {
'load_cases': {
limit_state: default_columns_load_input_table,
}
}
return ViktorResult(set_parameters_result=SetParametersResult(new_params))
I can’t find no fault in the above mentioned code, and the application gives no error in the terminal. However, the tables aren’t cleared and the website gives the following warning:
The obvious workaround is to return the new_params
in the clear_table
method and to add a ViktorResult
return in the primary functions, but this way around uses more code lines, so I was wondering why this doesn’t work.