-
Notifications
You must be signed in to change notification settings - Fork 2
Icone field device feed models #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dmccoystephenson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue (blocking): The 'pydantic' module is not included in the requirements.txt file, requiring the user to install the module manually before the unit tests can be run.
After installing pydantic manually, I see the following error also:
.venv\Lib\site-packages\pydantic\networks.py:967: in import_email_validator
raise ImportError("email-validator is not installed, run `pip install 'pydantic[email]'`") from e
E ImportError: email-validator is not installed, run `pip install 'pydantic[email]'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Pydantic models for the WZDx (Work Zone Data Exchange) field device feed specification, enabling structured validation and serialization of field device data. The implementation includes comprehensive models for various device types (arrow boards, cameras, traffic sensors, etc.) along with GeoJSON geometry support.
Key Changes
- Introduced Pydantic v2 models for 8 field device types with discriminated union pattern for type-safe device property handling
- Added GeoJSON geometry models (Point, LineString, MultiPoint, Polygon) with proper type validation
- Updated date_tools.py to use identity comparison (
is) instead of equality (!=) for type checking, improving code consistency
Reviewed changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| wzdx/tools/date_tools.py | Refactored type comparisons to use is/is not operators and updated datetime boundary check comment for millisecond timestamp handling |
| wzdx/models/geometry/* | Added GeoJSON geometry models with Literal type constraints and discriminated unions |
| wzdx/models/field_device_feed/field_device_core_details.py | Core details model shared across all device types with required and optional fields |
| wzdx/models/field_device_feed/properties/* | Device-specific property models for arrow boards, cameras, signals, sensors, beacons, signs, and markers |
| wzdx/models/field_device_feed/field_device_feature.py | GeoJSON Feature wrapper for field devices |
| wzdx/models/field_device_feed/device_feed.py | Top-level feed model containing metadata and device features |
| wzdx/models/feed_info/* | Feed metadata models for publisher info and data sources |
| tests/models/field_device_feed_test.py | Deserialization and serialization tests with real-world data |
| tests/data/models/* | Test fixtures with sample field device feed JSON data |
| tests/tools/date_tools_test.py | New unit tests for datetime_from_unix function boundary conditions |
| pyproject.toml | Added pydantic[email] and email-validator dependencies |
| poetry.lock | Updated lock file with new dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wzdx/models/field_device_feed/properties/dynamic_message_sign.py
Outdated
Show resolved
Hide resolved
wzdx/models/field_device_feed/properties/field_device_properties.py
Outdated
Show resolved
Hide resolved
The requirements.txt was a little out of date from poetry, I just regenerated it. The recommended way to import dependencies in this project is to use poetry commands, specifically poetry install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 31 out of 34 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 33 out of 36 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 33 out of 36 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dmccoystephenson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me & the unit tests pass!
Adding pydantic models for WZDx field device feed