Skip to content

Fix ParamContainer comparison function bug

The method ParamContainer.__eq__ does not work correctly when comparing params with params loaded from a PIV file because the order of the tag_children are not the same in the list. So, I propose to compare tag_children and children so that it does not depend on the order.

This is possibly not the best way, i.e. it would be best if _make_dict created dictionnaries recurvively, as advertised, instead, but I don't know if the current behavior is used by other parts of fluiddyn, so I don't want to make non-backward compatible changes without opinions. To be clear, I think _make_dict should not return "tag_children" and "children" as keys but as d["children"] = {k: v for zip(tag_children, children)} (and the same for attributes), so that the returned dictionary is really order independent recursively.

Merge request reports