Global variables defined from command line using parse_args at module level prevents usage of individual functions outside of set workflows.
A quick temporary workaround is to put parse_args (and config_args/mip_info) under if __name__ == "__main__", then define each variable as needed in the script where the functions are used.
e.g.:
import isimip_func
isimip_func.MIPNAME = 'isimip3b'
sorted_cube = isimip_func.sort_isimip_cube(cube, '')
However, this would break current command line workflows where e.g. isimip_func is used in process_jules and both contain an identical parse_args().
Ideally, refactoring all global variables to be passed as function arguments should help with usability.
Global variables defined from command line using
parse_argsat module level prevents usage of individual functions outside of set workflows.A quick temporary workaround is to put
parse_args(andconfig_args/mip_info) underif __name__ == "__main__", then define each variable as needed in the script where the functions are used.e.g.:
However, this would break current command line workflows where e.g.
isimip_funcis used inprocess_julesand both contain an identicalparse_args().Ideally, refactoring all global variables to be passed as function arguments should help with usability.