refactor: _postprocess_flat_outputs()
Did this show up in a performance profile or why did you decide to optimize this code?

Readability is always subjective and one could argue that list comprehensions are easier to read. Hey @sherhut, Thanks for your feedback! The code optimization aimed to improve efficiency by consolidating loops. While I didn't run a performance profile, I believe it can enhance execution. Regarding readability, I'll consider list comprehensions. Open to other suggestions too :) Hey @sherhut,
Could you please review it once you have a moment :) Hi @sherhut, Can you please review this PR ? Thank you! I agree this looks like a reasonable optimization on paper. But without seeing it improve something on a performance profile, it is hard to judge whether it is worth it. Readability is always subjective and I find both versions equally easy to read, if not preferring the original.
In this refactored version, I have changed the code to consolidate two loops into one loop for the same method, improving efficiency and readability.