Reordering of morphotactics flags in customization

I noticed that I often get diffs of the following sort when I customize:

Screen Shot 2020-07-20 at 1.13.27 PM

I am not making any morphology changes whatsoever, so, this seems just like some random ordering issue.

Does someone (@goodmami) have a good idea on how which place in the code to look at to get rid of this?

It’s probably just non-deterministic order coming from a hash (dict). I wouldn’t recommend trying to sort things in because it would probably affect more than just morphotactics. Instead look in gmcs/linglib/ for the write_flags() function (and maybe the similar write_copy_up_flags()):

You might also make use of the tdl_order attribute on morphotactic nodes, but I forget how it’s used.