dashboard: do not use float64. Closes #2347

This commit is contained in:
Sébastien Bourdeauducq 2024-02-27 11:09:37 +08:00
parent a8a5fc213b
commit b2ba087acd

View File

@ -81,8 +81,7 @@ class CreateEditDialog(QtWidgets.QDialog):
t = value.dtype if value is np.ndarray else type(value) t = value.dtype if value is np.ndarray else type(value)
if scale != 1 and np.issubdtype(t, np.number): if scale != 1 and np.issubdtype(t, np.number):
# degenerates to float type # degenerates to float type
value_edit_string = self.value_to_edit_string( value_edit_string = self.value_to_edit_string(value / scale)
np.float64(value / scale))
self.unit_widget.setText(metadata.get('unit', '')) self.unit_widget.setText(metadata.get('unit', ''))
self.scale_widget.setText(str(metadata.get('scale', ''))) self.scale_widget.setText(str(metadata.get('scale', '')))
self.precision_widget.setText(str(metadata.get('precision', ''))) self.precision_widget.setText(str(metadata.get('precision', '')))
@ -109,7 +108,7 @@ class CreateEditDialog(QtWidgets.QDialog):
t = value.dtype if value is np.ndarray else type(value) t = value.dtype if value is np.ndarray else type(value)
if scale != 1 and np.issubdtype(t, np.number): if scale != 1 and np.issubdtype(t, np.number):
# degenerates to float type # degenerates to float type
value = np.float64(value * scale) value = float(value * scale)
if self.key and self.key != key: if self.key and self.key != key:
asyncio.ensure_future(exc_to_warning(rename(self.key, key, value, metadata, persist, self.dataset_ctl))) asyncio.ensure_future(exc_to_warning(rename(self.key, key, value, metadata, persist, self.dataset_ctl)))
else: else: