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.
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.
The
flatten_list()
function does not always return the flattened list. The issue might be related to the condition it checksif isinstance(nested_list, list) else [nested_list]
. In the previous version of theflatten()
function, other conditions had to be checked as well:This is the most likely reason. I will update the issue when it's fixed.