We should treat dataclasses more like we treat Values objects stored inside other Values objects. Currently we consider a dataclass inside a values to be an element similar to an sf.V3, sf.Rot3, scalar, etc., but they are often just used as containers of other objects. This change would enable (1) accessing elements in a dataclass using dot notation and (2) better printing of Values which contain complex dataclasses.
Example of (1):
We should be able to do something like values["my_dataclass.element_in_dataclass"] but currently cannot. Instead you have to do values["my_dataclass"].element_in_dataclass right now.
For (2) we just need to edit format() in values.py to print dataclasses like we print Values objects.
We should treat dataclasses more like we treat Values objects stored inside other Values objects. Currently we consider a dataclass inside a values to be an element similar to an
sf.V3
,sf.Rot3
, scalar, etc., but they are often just used as containers of other objects. This change would enable (1) accessing elements in a dataclass using dot notation and (2) better printing of Values which contain complex dataclasses.Example of (1): We should be able to do something like
values["my_dataclass.element_in_dataclass"]
but currently cannot. Instead you have to dovalues["my_dataclass"].element_in_dataclass
right now.For (2) we just need to edit
format()
invalues.py
to print dataclasses like we print Values objects.