Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions httomo/yaml_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def check_hdf5_paths_against_loader(conf: PipelineConfig, in_file_path: str) ->
colour=Colour.GREEN,
)
params = conf[0]["parameters"]
if "image_key_path" not in params:
params["image_key_path"] = None
POSSIBLE_AUTO_PARAMS = ["data_path", "image_key_path", "rotation_angles"]
possible_auto_param_pairs = {name: params[name] for name in POSSIBLE_AUTO_PARAMS}
auto_pairs = {k: v for k, v in possible_auto_param_pairs.items() if v == "auto"}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- method: standard_tomo
module_path: httomo.data.hdf.loaders
parameters:
data_path: auto
rotation_angles: auto
8 changes: 8 additions & 0 deletions tests/test_yaml_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ def test_hdf5_paths_invalid_non_auto_value_caught_if_null_image_key_path(
assert not check_hdf5_paths_against_loader(conf, standard_data)


def test_hdf5_paths_accepts_omitted_image_key_path(
standard_data: str, sample_pipelines: str, load_yaml: Callable
):
filepath = sample_pipelines + "testing/loader_omitted_image_key_path.yaml"
conf = load_yaml(filepath)
assert check_hdf5_paths_against_loader(conf, standard_data)


def test_check_methods_exist_in_templates(sample_pipelines: str, load_yaml: Callable):
incorrect_method_pipeline = sample_pipelines + "testing/incorrect_method.yaml"
conf = load_yaml(incorrect_method_pipeline)
Expand Down