Skip to content

Commit

Permalink
Fixing minor warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob6838 committed Nov 8, 2024
1 parent e7cbd18 commit decb60b
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ icone_to_wzdx_test.geojson
icone_wzdx_translated_output_message.geojson
cotrip_translated_output_message.geojson
cotrip_wzdx_translated_output_message.geojson
.vscode/settings.json
*.pyc
*.geojson
test-output.xml
Expand Down
56 changes: 56 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"prettier.useEditorConfig": false,
"prettier.useTabs": false,
"prettier.configPath": ".vscode/.prettierrc.json",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
},
"cSpell.ignorePaths": ["*.json"],
"cSpell.words": [
"bdist",
"brng",
"cdot",
"codot",
"creationtime",
"Dataflows",
"dateutil",
"ellps",
"endtime",
"geopy",
"Geotab",
"hexidecimal",
"Hilgers",
"icone",
"inputfile",
"ipin",
"millis",
"navjoy",
"orjson",
"outputfile",
"pcms",
"pjson",
"polyline",
"polylines",
"protobuf",
"pypi",
"pyproj",
"pytest",
"pytz",
"restriping",
"rtdh",
"sdist",
"setuptools",
"srzmap",
"starttime",
"Trafficade",
"updatetime",
"USDOT",
"xmltodict"
]
}
2 changes: 1 addition & 1 deletion wzdx/monitoring/experimental/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def upload_logs(contents, path, bucket_name):
blob.upload_from_string(contents)
logging.info(f"{path} uploaded to {bucket_name}")
else:
logging.warn(f"blob already exists for {path}")
logging.warning(f"blob already exists for {path}")
return True
except Exception as e:
logging.error(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"feed_info": {
"publisher": "CDOT",
"version": "4.2",
"license": "https://creativecommons.org/publicdomain/zero/1.0/",
"data_sources": [
{
"data_source_id": "f7806c58-6492-4386-b12f-1b8c4a5404f7",
"organization_name": "CDOT",
"update_date": "2024-11-08T00:00:17Z",
"update_frequency": 300,
"contact_name": "Heather Pickering-Hilgers",
"contact_email": "heather.pickeringhilgers@state.co.us"
}
],
"update_date": "2024-11-08T00:00:17Z",
"update_frequency": 300,
"contact_name": "Heather Pickering-Hilgers",
"contact_email": "heather.pickeringhilgers@state.co.us"
},
"type": "FeatureCollection",
"features": [
{
"id": "U13632784_20241107235100",
"type": "Feature",
"properties": {
"core_details": {
"event_type": "work-zone",
"data_source_id": "f7806c58-6492-4386-b12f-1b8c4a5404f7",
"road_names": ["025A"],
"direction": "unknown",
"description": "Roadwork - Caution [iCone]",
"creation_date": "2024-11-07T23:51:00Z",
"update_date": "2024-11-07T23:51:50Z"
},
"start_date": "2024-11-07T23:51:00Z",
"end_date": "2024-11-14T23:58:00Z",
"is_start_date_verified": false,
"is_end_date_verified": false,
"is_start_position_verified": false,
"is_end_position_verified": false,
"location_method": "channel-device-method",
"vehicle_impact": "all-lanes-open",
"route_details_start": {
"Route": "025A",
"Measure": 227.23,
"MMin": 0.0,
"MMax": 385.223,
"Distance": 5.92
},
"condition_1": true
},
"geometry": {
"type": "LineString",
"coordinates": [
[-104.9880685, 39.9740377],
[-104.9880685, 39.9740377]
]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"feed_info": {
"publisher": "CDOT",
"version": "4.2",
"license": "https://creativecommons.org/publicdomain/zero/1.0/",
"data_sources": [
{
"data_source_id": "0c21decf-d9b4-402b-9d3d-f5d7fe7b6463",
"organization_name": "CDOT",
"update_date": "2024-11-07T23:17:40Z",
"update_frequency": 300,
"contact_name": "Heather Pickering-Hilgers",
"contact_email": "heather.pickeringhilgers@state.co.us"
}
],
"update_date": "2024-11-07T23:17:40Z",
"update_frequency": 300,
"contact_name": "Heather Pickering-Hilgers",
"contact_email": "heather.pickeringhilgers@state.co.us"
},
"type": "FeatureCollection",
"features": [
{
"id": "be0ba431-66a4-557e-b801-8fa8804c00d7",
"type": "Feature",
"properties": {
"core_details": {
"event_type": "work-zone",
"data_source_id": "0c21decf-d9b4-402b-9d3d-f5d7fe7b6463",
"road_names": [
"I-70"
],
"direction": "westbound",
"name": "OpenTMS-Event20643308360_westbound",
"description": "Between Exit 263: Colorado Mills Parkway (West Pleasant View) and C-470 (Golden) from Mile Point 262 to Mile Point 260. Both shoulders closed due to road construction. Starting November 12, 2024 at 7:00AM MST until November 12, 2024 at about 6:00PM MST. Full schedule below: \u00e2\u20ac\u00a2 November 12, 7:00AM - November 12, 6:00PM",
"update_date": "2024-11-07T21:09:35Z"
},
"start_date": "2024-11-12T14:00:00Z",
"end_date": "2024-11-13T01:00:00Z",
"is_start_date_verified": false,
"is_end_date_verified": false,
"is_start_position_verified": false,
"is_end_position_verified": false,
"location_method": "channel-device-method",
"work_zone_type": "static",
"vehicle_impact": "some-lanes-closed",
"lanes": [
{
"order": 1,
"type": "shoulder",
"status": "closed"
},
{
"order": 2,
"type": "general",
"status": "open"
},
{
"order": 3,
"type": "general",
"status": "open"
},
{
"order": 4,
"type": "general",
"status": "open"
},
{
"order": 5,
"type": "shoulder",
"status": "closed"
}
],
"beginning_cross_street": "Exit 263: Colorado Mills Parkway (West Pleasant View)",
"ending_cross_street": "C-470 (Golden)",
"types_of_work": [
{
"type_name": "roadway-creation",
"is_architectural_change": true
}
],
"beginning_milepost": 262.0,
"ending_milepost": 260.0,
"route_details_start": {
"Route": "070A_DEC",
"Measure": 262.0,
"MMin": 0.0,
"MMax": 449.589,
"Distance": 1.06
},
"route_details_end": {
"Route": "070A_DEC",
"Measure": 260.0,
"MMin": 0.0,
"MMax": 449.589,
"Distance": 1.08
},
"condition_1": true
},
"geometry": {
"type": "LineString",
"coordinates": [
[
-105.16586083999994,
39.734858632000055
],
[
-105.16638882599995,
39.73443766200006
],
[
-105.16854799099997,
39.73271605700006
],
[
-105.17077491299995,
39.73094029200007
],
[
-105.17293965199997,
39.72943332800003
],
[
-105.17468559199995,
39.72842892500006
],
[
-105.17580481399995,
39.727785029000074
],
[
-105.17843878399998,
39.72609999900004
],
[
-105.17993813899994,
39.72512450600004
],
[
-105.18206644899999,
39.723739730000034
],
[
-105.18563422299997,
39.72141816000004
],
[
-105.18769294899994,
39.72000476800008
],
[
-105.18847369599996,
39.71936694800007
],
[
-105.18984140499998,
39.718052475000036
],
[
-105.190781717,
39.71695507100003
],
[
-105.19270413899994,
39.714462801000025
]
]
}
}
]
}
8 changes: 4 additions & 4 deletions wzdx/tools/cdot_geospatial_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def get_route_and_measure(
startMeasure = measure
endMeasure = measure + step
if (endMeasure > mMax) or (startMeasure < mMin):
logging.warn(
logging.warning(
"get_route_and_measure bearing computation failed, measure out of bounds. MMin: {mMin}, MMax: {mMax}, startMeasure: {startMeasure}, endMeasure: {endMeasure}, step: {step}"
)
return route_details
Expand Down Expand Up @@ -246,7 +246,7 @@ def get_route_geometry_ahead(
latLng = self.get_point_at_measure(routeId, startMeasure)
routeDetails = self.get_route_and_measure(latLng, heading)
if not latLng or not routeDetails:
logging.warn(
logging.warning(
"get_route_geometry_ahead failed to get route details for routeId: {routeId}, startMeasure: {startMeasure}, heading: {heading}"
)
return None
Expand Down Expand Up @@ -381,12 +381,12 @@ def _make_cached_web_request(
url, timeout=timeout * 2, retryOnTimeout=False
)
else:
logging.warn(
logging.warning(
f"Geospatial Request Timed Out for {source} with url : {url}. Timeout: {timeout}. Error: {e}"
)
return None
except requests.exceptions.RequestException as e:
logging.warn(
logging.warning(
f"Geospatial Request Failed for {source} with url : {url}. Timeout: {timeout}. Error: {e}"
)
return None

0 comments on commit decb60b

Please sign in to comment.