Skip to content

Supporting Connected Work Zone Message#57

Merged
jacob6838 merged 28 commits intomainfrom
cwz
Sep 12, 2025
Merged

Supporting Connected Work Zone Message#57
jacob6838 merged 28 commits intomainfrom
cwz

Conversation

@jacob6838
Copy link
Collaborator

@jacob6838 jacob6838 commented Aug 13, 2025

Adding support for CWZ 1.0 message

  • Creating standard_to_cwz message translator
  • Supporting alternating traffic in planned events
    • vehicle_impact updated to "alternating-one-way"
    • all lanes closed except for center-most lane showing "alternating-flow"
  • Validating and improving geometry generation for dual carriageways

The CWZ data feed is deployed to the RTDH production environment, and is now featured on the WZDx Feed Registry

@jacob6838 jacob6838 requested review from drewjj and mcook42 August 13, 2025 18:22
@drewjj drewjj requested a review from Copilot August 15, 2025 19:39
Copy link

Copilot AI left a 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 support for Connected Work Zone (CWZ) 1.0 message format, expands support for alternating traffic scenarios, and improves dual carriageway geometry generation. The implementation includes new standard-to-CWZ translators, enhanced vehicle impact detection for alternating traffic patterns, and updates to the geospatial API for more accurate route handling.

  • Creates standard_to_cwz translator modules for converting RTDH standard messages to CWZ 1.0 format
  • Adds support for alternating traffic with "alternating-one-way" vehicle impact and "alternating-flow" lane status
  • Improves dual carriageway route detection and geometry generation logic

Reviewed Changes

Copilot reviewed 30 out of 46 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
wzdx/tools/cwz_translator.py New CWZ translator utility functions for message initialization, validation, and conversion
wzdx/tools/cdot_geospatial_api.py Updated base URL and corrected dual carriageway detection logic
wzdx/standard_to_wzdx/planned_events_translator.py Removed vehicle impact calculation and updated program name
wzdx/standard_to_cwz/planned_events_translator.py New CWZ translator for planned events with alternating traffic support
wzdx/sample_files/validation_schema/connected_work_zone_feed_v10.py New CWZ v1.0 JSON schema validation
wzdx/raw_to_standard/planned_events.py Enhanced alternating traffic detection and vehicle impact calculation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@drewjj
Copy link

drewjj commented Aug 15, 2025

I will let you respond to the Copilot stuff before I go any further with my review. Looking at a completely new project is making me go cross eyed and I think this did a good job at finding some little stuff that may have been missed. I am not so sure on some of its logical interpretations. Copilot can definitely be wrong.

@jacob6838
Copy link
Collaborator Author

jacob6838 commented Aug 15, 2025

@drewjj all copilot comments have been addressed. It did get a few things wrong, which usually means I didn't document the intended functionality enough. I added some comments

drewjj
drewjj previously approved these changes Aug 25, 2025
Copy link

@drewjj drewjj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good! The tests all pass just fine for me too.

@jacob6838 jacob6838 removed the request for review from mcook42 September 11, 2025 14:34
Copy link
Member

@dmccoystephenson dmccoystephenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trouble Running Unit Tests

Linux

When I attempt to run the unit tests, I get the following:

ModuleNotFoundError: No module named 'six.moves'

This is after opening the project in WSL, running pip install -r requirements.txt followed by python -m pytest 'tests/' -v

Windows

Upon running python -m pytest 'tests/' -v on Windows I run into the following:

ERROR: file or directory not found: 'tests/'

If I just run python -m pytest on Windows, I run into the following:

INTERNALERROR> E   ModuleNotFoundError: No module named 'jsonschema'

Copy link
Member

@dmccoystephenson dmccoystephenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new enums make the code a lot easier to read & understand!

I was able to get the unit tests to run using a virtual environment, and I ran into a number of test failures:

image

Steps to reproduce in WSL:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m pytest 'tests/' -v

@dmccoystephenson
Copy link
Member

dmccoystephenson commented Sep 12, 2025

I was able to get the unit tests to run using a virtual environment, and I ran into a number of test failures:

Turns out I was on the wrong branch! When I switched to the cwz branch the unit tests passed.

Copy link
Member

@dmccoystephenson dmccoystephenson left a 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!

@jacob6838 jacob6838 merged commit c6dd1e0 into main Sep 12, 2025
2 checks passed
@jacob6838 jacob6838 deleted the cwz branch September 12, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants