scverse/Muon.jl

Should `.mod` be an OrderedDict?

Closed this issue · 3 comments

It's not ordered in the reference Python implementation, so I don't see why we would need it here.

gtca commented

Python dictionaries are ordered by implementation.

The reasoning is that in the HDF5 the modalities will be sorted alphabetically. Hence we use the mod-order attribute to reconstruct the original modality ordering. This is relevant as we store multimodal annotations and might want to make sure to get the modalities in the exact same order after reading from the file.

Python dictionaries are ordered
Ah, I see. Apparently that's only since Python 3.6/3.7, I didn't have that on my radar. In that case I suppose that yes, it makes sense to have an OrderedDict here