reVX.setbacks.setbacks_cli.preprocess_merge_config

preprocess_merge_config(config, project_dir, command_name, merge_file_pattern='PIPELINE')[source]

Pre-process merge config.

Parameters:
  • config (dict) – Collection config. This config will be updated to include the keys node_out_path and node_pattern representing the output file path and the input file pattern, respectively.

  • project_dir (path-like) – Path to project directory. This path is used to resolve the output filepath.

  • command_name (str) – Name of the command being run. This is used to parse the pipeline status for output files if "merge_file_pattern": "PIPELINE" in the input config.

  • merge_file_pattern (str | list | dict, optional) – Unix-style /filepath/pattern*.h5 representing the files to be merged into a single output GeoTIFF file. If no output file path is specified (i.e. this input is a single pattern or a list of patterns), the output file path will be inferred from the pattern itself (specifically, the wildcard will be removed and the result will be the output file path). If a list of patterns is provided, each pattern will be merged into a separate output file. To specify the name of the output file(s), set this input to a dictionary whose keys are paths to the output file (relative paths are allowed) and the values are patterns representing the input files that should be merged into the output TIFF. If running a merge job as part of a pipeline, this input can be set to "PIPELINE", which will parse the output of the previous step (compute) and generate the input file pattern and output file name automatically. By default, "PIPELINE".

Returns:

config (dict) – Updated merge config dictionary.