From 191ddf8a3125933fccec21aee8b40d02160a5d6b Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 5 Apr 2025 18:03:27 +0100 Subject: [PATCH] [server]: Manually add missing Luas stops --- .../fetch_permanent_data/lambda_function.py | 155 ++++++++++++++++++ .../test_fetch_permanent_data.py | 2 +- 2 files changed, 156 insertions(+), 1 deletion(-) diff --git a/server/src/functions/fetch_permanent_data/lambda_function.py b/server/src/functions/fetch_permanent_data/lambda_function.py index c5abe7a..3a46cfa 100644 --- a/server/src/functions/fetch_permanent_data/lambda_function.py +++ b/server/src/functions/fetch_permanent_data/lambda_function.py @@ -96,6 +96,161 @@ def fetch_luas(): "luasStopZoneCountA": stop["ZoneCountA"], "luasStopZoneCountB": stop["ZoneCountB"] } for stop in tsv_reader] + + stops += [ + { + # dawson luas stop + "objectID": "LuasStop-DAW", + "objectType": "LuasStop", + "latitude": 53.34235198108542, + "longitude": -6.257874705533702, + "luasStopName": "Dawson", + "luasStopIrishName": "Dásain", + "luasStopCode": "DAW", + "luasStopLineID": 2, + }, + + { + # westmoreland luas stop + "objectID": "LuasStop-WES", + "objectType": "LuasStop", + "latitude": 53.34657666552001, + "longitude": -6.258954552531184, + "luasStopName": "Westmoreland", + "luasStopIrishName": "Sráid Westmoreland", + "luasStopCode": "WES", + "luasStopLineID": 2, + }, + + { + # o connell gpo + "objectID": "LuasStop-OGP", + "objectType": "LuasStop", + "latitude": 53.34895364842052, + "longitude": -6.259870172748866, + "luasStopName": "O'Connell - GPO", + "luasStopIrishName": " Ó Conaill - AOP", + "luasStopCode": "OGP", + "luasStopLineID": 2, + }, + + { + # o connell upper + "objectID": "LuasStop-OUP", + "objectType": "LuasStop", + "latitude": 53.34897926629319, + "longitude": -6.259956003433765, + "luasStopName": "O'Connell - Upper", + "luasStopIrishName": "Ó Conaill Uachtarach", + "luasStopCode": "OUP", + "luasStopLineID": 2, + }, + + { + # broombridge + "objectID": "LuasStop-BRO", + "objectType": "LuasStop", + "latitude": 53.37238519438793, + "longitude": -6.29767637274806, + "luasStopName": "Broombridge", + "luasStopIrishName": "Droichead Broom", + "luasStopCode": "BRO", + "luasStopLineID": 2, + }, + + { + # cabra + "objectID": "LuasStop-CAB", + "objectType": "LuasStop", + "latitude": 53.3647720048475, + "longitude": -6.2818402941276315, + "luasStopName": "Cabra", + "luasStopIrishName": "Cabrach", + "luasStopCode": "CAB", + "luasStopLineID": 2, + }, + + { + # phibsborough + "objectID": "LuasStop-PHI", + "objectType": "LuasStop", + "latitude": 53.360531943612585, + "longitude": -6.278946230419645, + "luasStopName": "Phibsborough", + "luasStopIrishName": "Baile Phib", + "luasStopCode": "PHI", + "luasStopLineID": 2, + }, + + { + # grangegorman + "objectID": "LuasStop-GRA", + "objectType": "LuasStop", + "latitude": 53.35733203671144, + "longitude": -6.277386018855522, + "luasStopName": "Grangegorman", + "luasStopIrishName": "Gráinseach Ghormáin", + "luasStopCode": "GRA", + "luasStopLineID": 2, + }, + + { + # broadstone + "objectID": "LuasStop-BRD", + "objectType": "LuasStop", + "latitude": 53.354153216627836, + "longitude": -6.27358994584398, + "luasStopName": "Broadstone - University", + "luasStopIrishName": "An Clocháin Leathan", + "luasStopCode": "BRD", + "luasStopLineID": 2, + }, + { + # dominick + "objectID": "LuasStop-DOM", + "objectType": "LuasStop", + "latitude": 53.351380458718346, + "longitude": -6.265691018855716, + "luasStopName": "Dominick", + "luasStopIrishName": "Doiminic", + "luasStopCode": "DOM", + "luasStopLineID": 2, + }, + { + # parnell + "objectID": "LuasStop-PAR", + "objectType": "LuasStop", + "latitude": 53.35309164558487, + "longitude": -6.260360288173493, + "luasStopName": "Parnell", + "luasStopIrishName": "Sráid Pharnell", + "luasStopCode": "PAR", + "luasStopLineID": 2, + }, + { + # marlborough + "objectID": "LuasStop-MAR", + "objectType": "LuasStop", + "latitude": 53.34937746503714, + "longitude": -6.257806103514667, + "luasStopName": "Marlborough", + "luasStopIrishName": "Maoilbhríde", + "luasStopCode": "MAR", + "luasStopLineID": 2, + }, + { + # marlborough + "objectID": "LuasStop-MAR", + "objectType": "LuasStop", + "latitude": 53.34937746503714, + "longitude": -6.257806103514667, + "luasStopName": "Marlborough", + "luasStopIrishName": "Maoilbhríde", + "luasStopCode": "MAR", + "luasStopLineID": 2, + } + ] + return stops def fetch_gtfs(): diff --git a/server/src/test/fetch_permanent_data/test_fetch_permanent_data.py b/server/src/test/fetch_permanent_data/test_fetch_permanent_data.py index ff1cf0f..440a68e 100644 --- a/server/src/test/fetch_permanent_data/test_fetch_permanent_data.py +++ b/server/src/test/fetch_permanent_data/test_fetch_permanent_data.py @@ -66,7 +66,7 @@ class TestPermanentData(unittest.TestCase): mock_get.return_value.content = 'Abbreviation\tName\tIrishName\tLatitude\tLongitude\tStopID\tLineID\tSortOrder\tIsEnabled\tIsParkAndRide\tIsCycleAndRide\tZoneCountA\tZoneCountB\nABB\tAbbey Street\tSráid na Mainistreach\t53.0\t-6.0\t1\t1\t1\ttrue\tfalse\tfalse\t1\t2'.encode('utf-8-sig') result = fetch_luas() - self.assertEqual(len(result), 1) + self.assertEqual(len(result), 1 + 13) self.assertEqual(result[0]['luasStopName'], 'Abbey Street') @patch('functions.fetch_permanent_data.lambda_function.session.get')