from services import io_services , log_services , data_services
def main ( ) :
# File paths used to save and load the data.
raw_data_path = " data/test-data.csv "
rps_save_path = " data/results/readings-per-sec.csv "
rps_above_thresh = " data/results/readings_above_threshold.csv "
flicker_list = " data/results/flicker_list.csv "
filtered_flickers = " data/results/filtered_flicker_entries.csv "
raw_data = io_services . load_raw_data ( raw_data_path )
# log_services.print_list(raw_data)
time_tallies = data_services . tally_readings_per_second ( raw_data )
# log_services.print_dictionary(time_tallies)
rps_totals = data_services . total_count_for_each_reading_per_second ( time_tallies )
# log_services.print_dictionary(rps_totals)
io_services . save_rps_totals ( rps_totals , rps_save_path )
rps_above_herz = data_services . get_rps_above ( 4 , time_tallies )
# log_services.print_list(rps_above_two)
io_services . save_rps_above_threshold ( rps_above_herz , rps_above_thresh )
flicker_entries = data_services . find_flickers ( rps_above_herz , raw_data )
# log_services.print_dictionary(flicker_tallies)
io_services . save_rps_totals ( flicker_entries , flicker_list )
filtered_flicker_entries = data_services . find_readings_with_lights_on ( flicker_entries )
# log_services.print_list(filtered_flicker_entries)
io_services . save_filtered_flickers ( filtered_flicker_entries , filtered_flickers )
if __name__ == " __main__ " :
main ( )