generated from CambridgeEngineering/PartIA-Flood-Warning-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_plot.py
62 lines (43 loc) · 1.66 KB
/
test_plot.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from floodsystem.stationdata import build_station_list
from floodsystem.plot import plot_water_levels, plot_water_levels_ext, plot_water_levels_web, plot_water_level_with_fit
from floodsystem.datafetcher import fetch_measure_levels
import datetime
def test_plot_water_levels():
# Build list of stations
stations = build_station_list()
dt = 10
station = stations[0]
dates, levels = fetch_measure_levels(station.measure_id, dt=datetime.timedelta(days=dt))
plot_water_levels(station, dates, levels)
def test_plot_water_levels_ext():
# Build list of stations
stations = build_station_list()
dt = 10
p = 4
stations = stations[:6]
datess, levelss = [], []
for station in stations[:6]:
dates, levels = fetch_measure_levels(station.measure_id, dt=datetime.timedelta(days=dt))
datess.append(dates)
levelss.append(levels)
plot_water_levels_ext(stations[:6], datess, levelss, p)
def test_plot_water_levels_web():
# Build list of stations
stations = build_station_list()
dt = 10
p = 4
stations = stations[:9]
datess, levelss = [], []
for station in stations[:9]:
dates, levels = fetch_measure_levels(station.measure_id, dt=datetime.timedelta(days=dt))
datess.append(dates)
levelss.append(levels)
plot_water_levels_web(stations[:9], datess, levelss, p)
def test_plot_water_level_with_fit():
# Build list of stations
stations = build_station_list()
dt = 10
p = 4
station = stations[0]
dates, levels = fetch_measure_levels(station.measure_id, dt=datetime.timedelta(days=dt))
plot_water_level_with_fit(station, dates, levels, p)