You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check if the parameter name of config methods exists in yaml template method parameters
"""
template_yaml_conf=_get_template_yaml_conf(conf)
formethod_dictinconf:
yml_method_list= [
yml_method_dict
foryml_method_dictintemplate_yaml_conf
if (yml_method_dict["method"] ==method_dict["method"])
and (yml_method_dict["module_path"] ==method_dict["module_path"])
]
unknown_param_dict= [
p
foryml_methodinyml_method_list
forp, vinmethod_dict["parameters"].items()
ifpnotinyml_method["parameters"].keys()
]
forpinunknown_param_dict:
_print_with_colour(
f"Parameter '{p}' in the '{method_dict['method']}' method is not valid."
)
returnFalse
returnTrue
For some basic info:
conf is a list of method configs parsed from the YAML pipeline file to a python list
template_yaml_conf is a list of templates associated with the methods in the pipeline, parsed to python list
It seems like in the loop over the method configs in the pipeline file, the YAML template config associated with that method is searched for, and put in the the yml_method_list variable, which is a list:
if (yml_method_dict["method"] ==method_dict["method"])
and (yml_method_dict["module_path"] ==method_dict["module_path"])
]
This is a bit confusing, since I would have expected that the conf and template_yaml_conf lists are the same length, due to each method config having one and only one YAML template associated with it. There doesn't seem to be a need to "search" for the YAML template config associated with each method, I would have thought doing an iteration over both conf and template_yaml_conf something would accomplish this, like:
formethod_config, template_configinzip(conf, template_yaml_config):
# TODO: check params in `method_config` are compatible with `template_config`, maybe using sets or something
and there's maybe no need for yml_method_list (again, which is a list only ever containing one element)?
The text was updated successfully, but these errors were encountered:
Specifically, this is about the check for that parameters in the config for a method are in the template for that method:
httomo/httomo/yaml_checker.py
Lines 172 to 195 in 7842bae
For some basic info:
conf
is a list of method configs parsed from the YAML pipeline file to a python listtemplate_yaml_conf
is a list of templates associated with the methods in the pipeline, parsed to python listIt seems like in the loop over the method configs in the pipeline file, the YAML template config associated with that method is searched for, and put in the the
yml_method_list
variable, which is a list:httomo/httomo/yaml_checker.py
Lines 177 to 183 in 7842bae
This is a bit confusing, since I would have expected that the
conf
andtemplate_yaml_conf
lists are the same length, due to each method config having one and only one YAML template associated with it. There doesn't seem to be a need to "search" for the YAML template config associated with each method, I would have thought doing an iteration over bothconf
andtemplate_yaml_conf
something would accomplish this, like:and there's maybe no need for
yml_method_list
(again, which is a list only ever containing one element)?The text was updated successfully, but these errors were encountered: