pcdshub / typhos

Automatic-yet-customizable Graphical User Interface Generation for Ophyd Devices
http://pcdshub.github.io/typhos
Other
16 stars 26 forks source link

FIX: signal prec default #592

Closed ZLLentz closed 1 year ago

ZLLentz commented 1 year ago

Description

When the core (signal) plugin receives a floating point value with no precision information or nonsensical precision information, set the precision metadata to a sensible default.

Manual precision setting at the device/signal level is still supported fully.

Motivation and Context

By default, we had/have the following cases:

Before: 0.23 displays as 0

After: 0.23 displays as 0.230

How Has This Been Tested?

I added targeted unit tests

Works interactively with state_velo, which is the signal that led us to this issue:

image

Where Has This Been Documented?

Release notes

Pre-merge checklist

ZLLentz commented 1 year ago

closing/reopening to cycle CI

ZLLentz commented 1 year ago

Made the requested change and also adjusted the test slightly to nitpick the naming/annotations and cover a case that I accidentally removed