Closed benjaminrwilson closed 3 years ago
@johnwlambert
looks good. can we add a simple unit test that would be broken without this change? or instead use keyword args, that would catch the duplicate?
looks good. can we add a simple unit test that would be broken without this change? or instead use keyword args, that would catch the duplicate?
I don't think dataclass
supports star expressions. It seems like we should design this in a way that ensures no duplicate members, though. A unit test would work in the short term, but it seems like we might should rethink how to handle this.
@benjaminrwilson i think keyword args would also fix this, since a duplicate keyword arg would be disallowed?
camera_sensors: SensorSuiteConfig = SensorSuiteConfig(
"ring_front_center"=SensorConfig(RING_CAMERA_HEIGHT, RING_CAMERA_WIDTH, "ring_front_center"),
"ring_front_left"= SensorConfig(RING_CAMERA_HEIGHT, RING_CAMERA_WIDTH, "ring_front_left"),
"ring_front_right"= SensorConfig(RING_CAMERA_HEIGHT, RING_CAMERA_WIDTH, "ring_front_right"),
"ring_side_left"= SensorConfig(RING_CAMERA_HEIGHT, RING_CAMERA_WIDTH, "ring_side_left"),
"ring_side_right"= SensorConfig(RING_CAMERA_HEIGHT, RING_CAMERA_WIDTH, "ring_side_right"),
"ring_rear_left"= SensorConfig(RING_CAMERA_HEIGHT, RING_CAMERA_WIDTH, "ring_rear_left"),
"ring_rear_right"= SensorConfig(RING_CAMERA_HEIGHT, RING_CAMERA_WIDTH, "ring_rear_right"),
"stereo_front_left"=SensorConfig(STEREO_CAMERA_HEIGHT, STEREO_CAMERA_WIDTH, "stereo_front_left"),
"stereo_front_right"=SensorConfig(STEREO_CAMERA_HEIGHT, STEREO_CAMERA_WIDTH, "stereo_front_right"),
)
Whoops, I misunderstood at first. I pushed your suggested fix. Thanks, @johnwlambert.
ring_front_center
was duplicated in the structured config. The duplicate has been removed.