diff --git a/openhtf/core/measurements.py b/openhtf/core/measurements.py index 1c0ab344e..b07606fdc 100644 --- a/openhtf/core/measurements.py +++ b/openhtf/core/measurements.py @@ -820,6 +820,10 @@ def __getitem__(self, name: Text) -> Any: # Return the MeasuredValue's value, MeasuredValue will raise if not set. return m.measured_value.value + @property + def measurements(self) -> Dict[Text, Measurement]: + return self._measurements + # Work around for attrs bug in 20.1.0; after the next release, this can be # removed and `Collection._custom_setattr` can be renamed to `__setattr__`. diff --git a/openhtf/core/test_state.py b/openhtf/core/test_state.py index fc1d3f43e..c4497ec84 100644 --- a/openhtf/core/test_state.py +++ b/openhtf/core/test_state.py @@ -105,6 +105,7 @@ class ImmutableMeasurement(object): units = attr.ib(type=Optional[units.UnitDescriptor]) dimensions = attr.ib(type=Optional[List[measurements.Dimension]]) outcome = attr.ib(type=Optional[measurements.Outcome]) + docstring = attr.ib(type=Optional[Text], default=None) @classmethod def from_measurement( @@ -124,7 +125,9 @@ def from_measurement( value=value, units=measurement.units, dimensions=measurement.dimensions, - outcome=measurement.outcome) + outcome=measurement.outcome, + docstring=measurement.docstring, + ) class TestState(util.SubscribableStateMixin):