Previously Experiment and Measurement were implemented as wrappers around SOMA objects. However, as the complexity of the SOMA interfaces increases (and we want to ensure that they are extensible by implementations), it is clear that they make more sense as mixins.
This follows the inspiration of pathlib, where extra behaviors are specified in a mixin, and a specialization inherits both the implementation class (i.e., a concrete Collection) and the extra behaviors (e.g. Experiment or Measurement).
The parent of the Experiment and Measurement mixins are specified as MutableMappings instead of Collections to avoid an inheritance conflict in the Python interpreter:
TypeError: multiple bases have instance lay-out conflict.
Previously Experiment and Measurement were implemented as wrappers around SOMA objects. However, as the complexity of the SOMA interfaces increases (and we want to ensure that they are extensible by implementations), it is clear that they make more sense as mixins.
This follows the inspiration of
pathlib
, where extra behaviors are specified in a mixin, and a specialization inherits both the implementation class (i.e., a concreteCollection
) and the extra behaviors (e.g.Experiment
orMeasurement
).The parent of the
Experiment
andMeasurement
mixins are specified asMutableMapping
s instead ofCollection
s to avoid an inheritance conflict in the Python interpreter:TypeError: multiple bases have instance lay-out conflict
.