When I wrote skillmodels, I did not see the benefit of immutability. Therefore many attributes of SkillModel, which are generated in ModelSpecProcessor are lists and dictionaries, even though we never change them later.
Desired Situation
Replace lists by tuples, unless we use them in numba functions that in the most recent numba version need them to be numpy arrays (see #33). Replace dictionaries by namedtuples.
Implementation
Do this as early as possible, i.e. in ModelSpecProcessor
Anecdote
When converting skillmodels to use estimagic I lost one day on debugging. The problem was that I had accidentally appended something to a list of measurements. So this is an easy but important change!
Current Situation
When I wrote skillmodels, I did not see the benefit of immutability. Therefore many attributes of
SkillModel
, which are generated inModelSpecProcessor
are lists and dictionaries, even though we never change them later.Desired Situation
Replace lists by tuples, unless we use them in numba functions that in the most recent numba version need them to be numpy arrays (see #33). Replace dictionaries by namedtuples.
Implementation
Do this as early as possible, i.e. in ModelSpecProcessor
Anecdote
When converting skillmodels to use estimagic I lost one day on debugging. The problem was that I had accidentally appended something to a list of measurements. So this is an easy but important change!