From b284deb4edd400ff31886d3875b0fc570c98c2ae Mon Sep 17 00:00:00 2001 From: Yue Shuai <48269801+yueshuaing@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:14:06 -0700 Subject: [PATCH] add transit addition and deletion change types --- projectcard/projectcard.py | 2 ++ ...new_route.json => transit_route_addition.json} | 0 .../schema/changes/transit_service_deletion.json | 11 +++++++++++ projectcard/schema/projectcard.json | 15 ++++++++++----- 4 files changed, 23 insertions(+), 5 deletions(-) rename projectcard/schema/changes/{transit_add_new_route.json => transit_route_addition.json} (100%) create mode 100644 projectcard/schema/changes/transit_service_deletion.json diff --git a/projectcard/projectcard.py b/projectcard/projectcard.py index 42feb38..fe21977 100644 --- a/projectcard/projectcard.py +++ b/projectcard/projectcard.py @@ -20,6 +20,8 @@ "roadway_deletion", "transit_property_change", "transit_routing_change", + "transit_route_addition", + "transit_service_deletion", "pycode", ] diff --git a/projectcard/schema/changes/transit_add_new_route.json b/projectcard/schema/changes/transit_route_addition.json similarity index 100% rename from projectcard/schema/changes/transit_add_new_route.json rename to projectcard/schema/changes/transit_route_addition.json diff --git a/projectcard/schema/changes/transit_service_deletion.json b/projectcard/schema/changes/transit_service_deletion.json new file mode 100644 index 0000000..9074b44 --- /dev/null +++ b/projectcard/schema/changes/transit_service_deletion.json @@ -0,0 +1,11 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "service" + ], + "additionalProperties" : false, + "properties": { + "service": {"$ref": "../transit/selection/select_trips.json"} + } +} diff --git a/projectcard/schema/projectcard.json b/projectcard/schema/projectcard.json index a87e5e1..1bd1134 100644 --- a/projectcard/schema/projectcard.json +++ b/projectcard/schema/projectcard.json @@ -7,7 +7,8 @@ "change_roadway_property_change": { "$ref": "changes/roadway_property_change.json"}, "transit_property_change": { "$ref": "changes/transit_property_change.json"}, "transit_routing_change": { "$ref": "changes/transit_routing_change.json"}, - "transit_add_new_route": { "$ref": "changes/transit_add_new_route.json"}, + "transit_route_addition": { "$ref": "changes/transit_route_addition.json"}, + "transit_service_deletion": { "$ref": "changes/transit_service_deletion.json"}, "pycode":{ "type": "string" }, "change": { "type":"object", @@ -17,7 +18,8 @@ "roadway_property_change": { "$ref": "#/$defs/change_roadway_property_change"}, "transit_property_change": { "$ref": "#/$defs/transit_property_change"}, "transit_routing_change": { "$ref": "#/$defs/transit_routing_change"}, - "transit_add_new_route:": { "$ref": "#/$defs/transit_add_new_route"}, + "transit_route_addition": { "$ref": "#/$defs/transit_route_addition"}, + "transit_service_deletion": { "$ref": "#/$defs/transit_service_deletion"}, "pycode": { "$ref": "#/$defs/pycode"} }, "oneOf": [ @@ -26,7 +28,8 @@ {"required":["roadway_property_change"]}, {"required":["transit_property_change"]}, {"required":["transit_routing_change"]}, - {"required":["transit_add_new_route"]}, + {"required":["transit_route_addition"]}, + {"required":["transit_service_deletion"]}, {"required":["pycode"]} ] } @@ -42,7 +45,8 @@ {"required":["roadway_managed_lanes"]}, {"required":["transit_property_change"]}, {"required":["transit_routing_change"]}, - {"required":["transit_add_new_route"]}, + {"required":["transit_route_addition"]}, + {"required":["transit_service_deletion"]}, {"required":["pycode"]}, {"required":["changes"]} ], @@ -57,7 +61,8 @@ "roadway_managed_lanes": { "$ref": "#/$defs/change_roadway_property_change"}, "transit_property_change":{ "$ref": "#/$defs/transit_property_change"}, "transit_routing_change":{ "$ref": "#/$defs/transit_routing_change"}, - "transit_add_new_route":{ "$ref": "#/$defs/transit_add_new_route"}, + "transit_route_addition":{ "$ref": "#/$defs/transit_route_addition"}, + "transit_service_deletion": { "$ref": "#/$defs/transit_service_deletion"}, "pycode":{ "$ref": "#/$defs/pycode"}, "changes": {"type": "array","items":{"$ref": "#/$defs/change"}}, "self_obj_type": {"type": "string","enum": ["RoadwayNetwork","TransitNetwork"],"description":"For calculated project cards, must refer to the object to perform the calculation on. "},