Open yousefmoazzam opened 6 months ago
The _save_yaml() function doesn't have a output_folder parameter, yet it somehow is able to refer to it without defining it itself: https://github.com/DiamondLightSource/httomo/blob/878c74c32dad626b46a52f1b4a8505747f5fd978/templates/yaml_templates_generator.py#L124-L131
_save_yaml()
output_folder
This is because it's using the output_folder defined in the if __name__ == "__main__" block at the bottom of the script: https://github.com/DiamondLightSource/httomo/blob/878c74c32dad626b46a52f1b4a8505747f5fd978/templates/yaml_templates_generator.py#L228-L232
if __name__ == "__main__"
Given that the _save_yaml() function is called by the main yaml_generator() function: https://github.com/DiamondLightSource/httomo/blob/878c74c32dad626b46a52f1b4a8505747f5fd978/templates/yaml_templates_generator.py#L96
yaml_generator()
which has been passed the output_folder value: https://github.com/DiamondLightSource/httomo/blob/878c74c32dad626b46a52f1b4a8505747f5fd978/templates/yaml_templates_generator.py#L37-L42
it would be nice to pass _save_yaml() the output_folder value, rather than have it rely on a global variable.
The
_save_yaml()
function doesn't have aoutput_folder
parameter, yet it somehow is able to refer to it without defining it itself: https://github.com/DiamondLightSource/httomo/blob/878c74c32dad626b46a52f1b4a8505747f5fd978/templates/yaml_templates_generator.py#L124-L131This is because it's using the
output_folder
defined in theif __name__ == "__main__"
block at the bottom of the script: https://github.com/DiamondLightSource/httomo/blob/878c74c32dad626b46a52f1b4a8505747f5fd978/templates/yaml_templates_generator.py#L228-L232Given that the
_save_yaml()
function is called by the mainyaml_generator()
function: https://github.com/DiamondLightSource/httomo/blob/878c74c32dad626b46a52f1b4a8505747f5fd978/templates/yaml_templates_generator.py#L96which has been passed the
output_folder
value: https://github.com/DiamondLightSource/httomo/blob/878c74c32dad626b46a52f1b4a8505747f5fd978/templates/yaml_templates_generator.py#L37-L42it would be nice to pass
_save_yaml()
theoutput_folder
value, rather than have it rely on a global variable.