Extended filenames as dict
All threads resolved!
All threads resolved!
Closes #102 (closed)
Merge request reports
Activity
added feature label
added 2 commits
requested review from @vidlb
assigned to @remicress
I did a
ctrl + alt + L
in PyCharm and it has messed with the indentation.Sorry I'll try to get back to the original one to ease the review
edit: fixed
Edited by Rémi Cressonadded 1 commit
- aa2ae024 - FIX: ext_fname prevail over extensions in filepath
- Resolved by Rémi Cresson
- Resolved by Rémi Cresson
- Resolved by Rémi Cresson
- Resolved by Vincent Delbar
- Resolved by Rémi Cresson
- Resolved by Rémi Cresson
- Resolved by Rémi Cresson
- Resolved by Rémi Cresson
- Resolved by Rémi Cresson
changed milestone to %Release 2.0
- Resolved by Vincent Delbar
- Resolved by Rémi Cresson
- Resolved by Vincent Delbar
@remicress I don't understand all those dict copies. The following should be enough and is 10 lines shorter :
# Append filename extension to filenames if ext_fname: if not isinstance(ext_fname, (dict, str)): raise ValueError("Extended filename must be a str or a dict") if isinstance(ext_fname, str): splits = [pair.split("=") for pair in ext_fname.split("&")] ext_fname = dict(split for split in splits if len(split) == 2) logger.debug("%s: extended filename for all outputs:", self.name) for key, ext in ext_fname.items(): logger.debug("%s: %s", key, ext) ext_fname_str = "&".join([ f"{key}={value}" for key, value in ext_fname.items() ]) for key, filepath in kwargs.items(): if self._out_param_types[key] == otb.ParameterType_OutputImage: if "?&" in filepath: logger.debug("Extended filename already provided for parameter %s", key) else: parameters[key] = f"{filepath}?&{ext_fname_str}"
Edited by Vincent Delbar
- Resolved by Rémi Cresson
- Resolved by Rémi Cresson
I think you should squash this kind of MR like !85 (merged) to avoid having commit history with duplicated messages, or things like "Apply 1 suggestion(s) to 1 file(s)" in the main branch
Edited by Vincent Delbarmentioned in commit c4fe5746
Please register or sign in to reply