-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscraperplot.py
45 lines (33 loc) · 1.34 KB
/
scraperplot.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
# -*- coding: utf-8 -*-
"""
scraperplot.py
For retreiving and plotting data using the 'scraper.py' module.
Created on Wed Oct 30 15:11:00 2019
@author: Thomas Richards
"""
# import scraper.py
import scraper as scrp
# Run functions in get module
scraper = scrp.Scraper()
choices = input('What do you want to plot? Press enter for all. \n1. Managed '
'space data\n2. Sensor reading data \n>>')
if not choices:
chosen_space_numbers, chosen_space_names = \
scraper._choose_by_number(scraper.managed_space_info)
scraper.plot_managed_spaces(managed_spaces=chosen_space_numbers)
chosen_location_numbers, chosen_location_names = \
scraper._choose_by_number(scraper.sensor_location_info)
scraper.plot_sensor_reading_after(sensor_numbers=chosen_location_numbers)
elif choices:
choices = eval(choices)
if choices == 1:
chosen_space_numbers, chosen_space_names = \
scraper._choose_by_number(scraper.managed_space_info)
scraper.plot_managed_spaces(managed_spaces=chosen_space_numbers)
elif choices == 2:
chosen_location_numbers, chosen_location_names = \
scraper._choose_by_number(scraper.sensor_location_info)
scraper.plot_sensor_reading_after(sensor_numbers=\
chosen_location_numbers)
else:
print('Unknown input.')