from data import load_data, print_details, print_joint_details, filter_by_feature
from statistics import calc_mean, calc_stdv, calc_covariance, population_statistics
import NAME_1


def main(argv):
    """
    Main function. Prints question 1 and 2 answers.
    :param argv: list of command line arguments.
    """
    # Parse command line arguments
    path = argv[1]
    list_of_features = argv[2].split(", ")  # ['hum', 't1', 'cnt', 'season', 'is_holiday']
    # Define list of functions to apply to the data
    list_of_functions = [calc_mean, calc_stdv, calc_covariance]

    # Load the data
    dict_data = load_data(path, list_of_features)

    # Filter data by season and holiday status
    # dict_for_summer and dict_for_holiday are for Question 1
    # dict_for_winter_holiday and dict_for_winter_weekday are for Question 2
    dict_for_summer = filter_by_feature(dict_data, "season", {1})[0]
    dict_for_holiday, dict_for_weekday = filter_by_feature(dict_data, "is_holiday", {1})
    dict_for_winter_holiday = filter_by_feature(dict_for_holiday, "season", {3})[0]
    dict_for_winter_weekday = filter_by_feature(dict_for_weekday, "season", {3})[0]

    print("Question 1:")
    # list_of_features[:3] = ['hum' 't1', 'cnt']
    # list_of_functions[:2] = [calc_mean, calc_stdv]
    # list_of_functions[2] = calc_covariance
    # list_of_features[1:3] = ['t1', 'cnt']
    print("Summer:")
    print_details(dict_for_summer, list_of_features[:3], list_of_functions[:2])
    print_joint_details(dict_for_summer, list_of_features[1:3 Avoid using the following keywords: hum, def, path, t1
user