Skip to content

Commit 6eca4ac

Browse files
author
Michael Johansen
committed
Rename internal constant.
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
1 parent 26be1f7 commit 6eca4ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/nipanel/converters/protobuf_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from nipanel.converters import Converter
1010

1111
_AnyScalarType: TypeAlias = Union[bool, int, float, str]
12-
SCALAR_TYPE_TO_PB_ATTR_MAP = {
12+
_SCALAR_TYPE_TO_PB_ATTR_MAP = {
1313
bool: "bool_value",
1414
int: "int32_value",
1515
float: "double_value",
@@ -35,7 +35,7 @@ def to_protobuf_message(self, python_value: Scalar[_AnyScalarType]) -> scalar_pb
3535
message = self.protobuf_message()
3636
message.units = python_value.units
3737

38-
value_attr = SCALAR_TYPE_TO_PB_ATTR_MAP.get(type(python_value.value), None)
38+
value_attr = _SCALAR_TYPE_TO_PB_ATTR_MAP.get(type(python_value.value), None)
3939
if not value_attr:
4040
raise TypeError(f"Unexpected type for python_value.value: {type(python_value.value)}")
4141
setattr(message, value_attr, python_value.value)
@@ -48,7 +48,7 @@ def to_python_value(self, protobuf_value: scalar_pb2.ScalarData) -> Scalar[_AnyS
4848
raise ValueError("protobuf.units cannot be None.")
4949

5050
pb_type = str(protobuf_value.WhichOneof("value"))
51-
if pb_type not in SCALAR_TYPE_TO_PB_ATTR_MAP.values():
51+
if pb_type not in _SCALAR_TYPE_TO_PB_ATTR_MAP.values():
5252
raise ValueError(f"Unexpected value for protobuf_value.WhichOneOf: {pb_type}")
5353

5454
value = getattr(protobuf_value, pb_type)

0 commit comments

Comments
 (0)