DiamondLightSource / DiamondLightSource/httomo
Unnecessary list of one element per iteration in loop in YAML checker?
- Dominant language
- Python
- Stars
- 10
- Forks
- 5
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 1
Description
Specifically, this is about the check for that parameters in the config for a method are in the template for that method: https://github.com/DiamondLightSource/httomo/blob/7842bae27c1777545279aa36e8c10d9c4eeb489f/httomo/yaml_checker.py#L172-L195
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: https://github.com/DiamondLightSource/httomo/blob/7842bae27c1777545279aa36e8c10d9c4eeb489f/httomo/yaml_checker.py#L177-L183
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:
```python
for method_config, template_config in zip(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)?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.