isolate the output management in a external module in several steps.
"The output management means saving the simulation outputs at each stage of the simulation including global variables and simulation status"
gather the logs ( or trace of execution) just before the produce to extract them from if and else in order to simplify better. This will be done in a separate branch and test to be merge in master rapidly
make a first move of everything concerning the outputs management in an external file output_manager (copy-paste only). test this branch with global test.
Think of new design patterns to resume the outputs management like same name of attributs (1) or a ordered dict which does the changes for keys and values.
make loger converge to take as input only module data objects (Bud, ...). To do so, create a Logger class that can be called within walter.lpy to save values of updated global variables (DOY, Temperature,GAI ...) and then used by log member function dedicated to log the different modules only with module as arg.
see whether output names could match instance member names to simplify output log functions. Meantime add a {output_name: member_name} mapping to modules to automate the job of the log functions
(1) exemple = Temp_cum -> tempcum (not the same)
see whether the maping is really required or if alternatively all (instead of user defined for almost all) instance variable should be loged, to increase robustness of log function
isolate the output management in a external module in several steps. "The output management means saving the simulation outputs at each stage of the simulation including global variables and simulation status"
gather the logs ( or trace of execution) just before the produce to extract them from if and else in order to simplify better. This will be done in a separate branch and test to be merge in master rapidly
make a first move of everything concerning the outputs management in an external file output_manager (copy-paste only). test this branch with global test.
Think of new design patterns to resume the outputs management like same name of attributs (1) or a ordered dict which does the changes for keys and values.
make loger converge to take as input only module data objects (Bud, ...). To do so, create a Logger class that can be called within walter.lpy to save values of updated global variables (DOY, Temperature,GAI ...) and then used by log member function dedicated to log the different modules only with module as arg.
see whether output names could match instance member names to simplify output log functions. Meantime add a {output_name: member_name} mapping to modules to automate the job of the log functions (1) exemple = Temp_cum -> tempcum (not the same)
see whether the maping is really required or if alternatively all (instead of user defined for almost all) instance variable should be loged, to increase robustness of log function