refactor: reuse shared grid layers in Q7 parser#882
Conversation
allenporter
left a comment
There was a problem hiding this comment.
I know this is draft still and not ready but giving early feedback in the name of quick iteration
| map_data: MapData | None = None | ||
| """Parsed map data (metadata for points on the map).""" | ||
|
|
||
| layers: GridLayers | None = None |
There was a problem hiding this comment.
These don't seem like data points we want or need to expose to callers, and are more like internal map rendering details.
| self.image_content = parsed_data.image_content | ||
| self.map_data = parsed_data.map_data | ||
| self.raw_api_response = raw_payload | ||
| try: |
There was a problem hiding this comment.
Once parsed, these don't appear to be used by anything.
is there a specifc reason we're parsing the raw payload again? I would expect this to all be behind the existing self._map_parser.parse call above where the map parser parses the raw content and pulls out useful data points.
Is it because in q10 these come as a separate channel, therefore we need to change the map interface from working in raw payload to be raw payload + layers + calibration data?
Summary
Keeps the Q7 shared-grid reuse from #848 as a small parser-internal refactor. The draft no longer expands the Q7 trait API and remains independent of the Q10 map stack.
Changes
GridLayersonce insideB01MapParser.parsefrom the already-parsed protobuf payload.MapContentTraitunchanged: callers continue to receive onlyimage_content,map_data, andraw_api_response.Review feedback addressed
Validation
pytest -q— 792 passed, 86 snapshots passedpre-commit run --show-diff-on-failure --color=always --all-files— all hooks passed, including Ruff and mypy