diff --git a/src/nipanel/_panel_value_accessor.py b/src/nipanel/_panel_value_accessor.py index 9404a20..600d40e 100644 --- a/src/nipanel/_panel_value_accessor.py +++ b/src/nipanel/_panel_value_accessor.py @@ -69,7 +69,7 @@ def get_value(self, value_id: str, default_value: _T | None = None) -> _T | obje Returns: The value, or the default value if not set. The returned value will - be the same as default_value, if one was provided. + have the same type as default_value, if one was provided. Raises: KeyError: If the value is not set and no default value is provided diff --git a/src/nipanel/converters/protobuf_types.py b/src/nipanel/converters/protobuf_types.py index 530487b..c92cd2f 100644 --- a/src/nipanel/converters/protobuf_types.py +++ b/src/nipanel/converters/protobuf_types.py @@ -405,7 +405,13 @@ def to_python_value( class HTDateTimeConverter(Converter[ht.datetime, precision_timestamp_pb2.PrecisionTimestamp]): - """A converter for hightime.datetime objects.""" + """A converter for hightime.datetime objects. + + .. note:: The nipanel package will always convert PrecisionTimestamp messages to + bintime.DateTime objects using BTDateTimeConverter. To use hightime.datetime + values in a panel, you must pass a hightime.datetime value for the default_value + parameter of the get_value() method on the panel. + """ @property def python_type(self) -> type: @@ -419,14 +425,12 @@ def protobuf_message(self) -> Type[precision_timestamp_pb2.PrecisionTimestamp]: @property def protobuf_typename(self) -> str: - """The protobuf name for the type. - - Override the base class here because there can only be one converter that - converts ``PrecisionTimestamp`` objects. Since there are two converters that convert - to ``PrecisionTimestamp``, we have to choose one to handle conversion from protobuf. - For the purposes of nipanel, we'll convert ``PrecisionTimestamp`` messages to - bintime.DateTime. See ``BTDateTimeConverter``. - """ + """The protobuf name for the type.""" + # Override the base class here because there can only be one converter that + # converts PrecisionTimestamp objects. Since there are two converters that convert + # to PrecisionTimestamp, we have to choose one to handle conversion from protobuf. + # For the purposes of nipanel, we'll convert PrecisionTimestamp messages to + # bintime.DateTime. See BTDateTimeConverter. return "PrecisionTimestamp_Placeholder" def to_protobuf_message(