undecision_management function needs refactoring
The function undecision_management needs refactoring. There are several issues:
- It has a cyclomatic complexity of 20: 180 lines with lots of
if/elif/else
andfor
blocks. Most of these blocks should become named functions. - There are comments in French.
- I think there are latent bugs on the use of the
model_tile
variable, which in some cases can be a list of strings (ifregion_vec
isNone
, we go throughgen_mask_region_by_tile
which returns List[str]) and in other cases it's a str. And it is used as a str to build image names.