SepShr / MLCSHE

This repo houses the ML-Component Systemic Hazard Envelope project, or MILSCHE (pronounced /'mɪlʃ/).
MIT License
3 stars 0 forks source link

flatten_list() does not always flatten complete solutions. #37

Closed SepShr closed 2 years ago

SepShr commented 2 years ago

The flatten_list() function does not always return the flattened list. The issue might be related to the condition it checks if isinstance(nested_list, list) else [nested_list]. In the previous version of the flatten() function, other conditions had to be checked as well:

if isinstance(list_of_lists[0], list) or \
                isinstance(list_of_lists[0], self.creator.Individual) or \
                isinstance(list_of_lists[0], self.creator.Scenario) or \
                isinstance(list_of_lists[0], self.creator.OutputMLC):

This is the most likely reason. I will update the issue when it's fixed.

SepShr commented 2 years ago

The issue turned out to be caused by another part of the code (the updated function required a list of complete solutions as input rather that the complete solution itself). This issue will be closed.