1
0
Fork 0
Browse Source

import io_services into flicker.py.

I, also, removed the load_data function. This is part of the gradual
move to transfer 'service' based functions out of flicker.py. The aim
here is to reduce the need for duplicating code or make it easier to
make function calls when needing a particular piece of data (or
transformation of data).
stable
Craig Oates 3 years ago
parent
commit
8f9df9462b
  1. 13
      src/flicker.py

13
src/flicker.py

@ -1,15 +1,6 @@
import csv
import datetime
from services import io_services
def load_data():
data = dict()
with open("data/test-data-lite.csv") as csv_file:
csv_reader = csv.reader(csv_file, delimiter=",")
for r in csv_reader:
if (r[1] != "Time Stamp"):
data[r[1]] = r[2] # Ignores the 'Id' column.
return data
from services import io_services, log_services
def tally_readings_per_second2(data):
time_tallies = dict()
@ -82,7 +73,7 @@ def main():
# rsp_above_two = get_rps_above(2, time_tallies)
# flicker_tallies = tally_flickers(rsp_above_two, time_tallies)
raw_data = io_services.load_raw_data("data/test-data-lite.csv")
print(raw_data)
log_services.print_dictionary(raw_data)
if __name__ == "__main__":
main()