Problem with indexing in `read_fit_pseudodata`
Created by: RosalynLP
I've come across a problem in read_fit_pseudodata
where the levels of the multiindex in the fit are different from that in context_index
.
The issue is when we relabel the pseudodata's index
pseudodata.index = sorted_index
The assumption is that these two are aligned because they've both been sorted on all three levels of the multiindex, however if the levels are not the same then this assumption is wrong. For example, if one is (experiment, proc, id) and the other is (BIGEXP, proc, id), then sorting on BIGEXP first will yield different results (will be sorted alphabetically by dataset name) to sorting on experiments first. I suggest we could sort on range(1,3) instead because the dataset level (level 1) is the only one which will be the same between any two indexes.
So if they haven't been sorted the same you end up with the data in the wrong order.