forked from Nicholas-Ho/Flood-Warning-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTask1D.py
28 lines (19 loc) · 812 Bytes
/
Task1D.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from floodsystem.stationdata import build_station_list
from floodsystem.geo import rivers_with_station, stations_by_river, stations_within_radius
def run():
"""Requirements for Task 1D"""
# Build list of stations
stations = build_station_list()
# Get rivers with stations
rivers = rivers_with_station(stations)
# Print rivers
print(f'{len(rivers)} rivers. First 10:', sorted(rivers)[:10])
# Find stations by river
stations = stations_by_river(stations)
# Print stations
print([station.name for station in stations['River Aire']])
print([station.name for station in stations['River Cam']])
print([station.name for station in stations['River Thames']])
if __name__ == "__main__":
print("*** Task 1D: CUED Part IA Flood Warning System ***")
run()