Example:
import scipp as sc
a = sc.DataGroup({'1': sc.scalar(1.0, unit='m'),
'2': sc.scalar(2.0, unit='m'),
'3': sc.scalar(3.0, unit='m'),
'4': sc.scalar(4.0, unit='m'),
})
b = a**2
b.keys()
dict_keys(['1', '2', '3', '4'])
Order is preserved.
Then doing c = a * b yields c.keys() as ['3', '2', '4', '1']
I understand that if the two operands don't have the same keys, you need to output only the keys found in both.
But if both operands have the same keys, can we preserve the order? (I guess we would have to pick the order of e.g. the first operand)
A use case where the current behaviour is causing problems:
Making a plot with a, you have the blue line corresponding to entry '1'.
Then making a plot with c, the blue line is now corresponding to entry '3'.
Example:
Order is preserved.
Then doing
c = a * byieldsc.keys()as['3', '2', '4', '1']I understand that if the two operands don't have the same keys, you need to output only the keys found in both.
But if both operands have the same keys, can we preserve the order? (I guess we would have to pick the order of e.g. the first operand)
A use case where the current behaviour is causing problems:
Making a plot with
a, you have the blue line corresponding to entry'1'.Then making a plot with
c, the blue line is now corresponding to entry'3'.