Ejemplo n.º 1
0
path = (super_path + '/' + project_name + "/Sleeping&Awaken_Users")
util.writeUsersCSV_byItem(active_devs_sleeping_intervals_df, path)

num_hibernation_users = len(active_devs_hibernation_intervals_df)
path = (super_path + '/' + project_name + "/Hibernated&Unfrozen_Users")
util.writeUsersCSV_byItem(active_devs_hibernation_intervals_df, path)

num_dead_users = len(active_devs_dead_intervals_df)
path = (super_path + '/' + project_name + "/Dead&Resurrected_Users")
util.writeUsersCSV_byItem(active_devs_dead_intervals_df, path)

full_sleepings_list = util.getSleepingsList(super_path, project_name)
full_hibernated_list = util.getHibernationsList(
    super_path,
    project_name)  # Includes Deads because they have been Hibernated before
full_dead_list = util.getDeadsList(super_path, project_name)
util.add(projects_stats, [
    project_name, num_all_users, num_active_users,
    len(full_sleepings_list),
    len(full_hibernated_list),
    len(full_dead_list)
])
project_transitions = util.countDevTransitions(super_path, project_name,
                                               breaks_df['durations'])
durations = util.reportDevsBreaksLengthDistribution(project_name, super_path)
durations.to_csv(super_path + '/' + project_name +
                 '/dev_statuses_durations.csv',
                 sep=';',
                 na_rep='NA',
                 header=True,
                 index=False,
    with open(proj_path + '/inactivity_interval_list.csv',
              'r') as f:  #opens PW file
        inactivity_intervals_data = [
            list(map(str, rec)) for rec in csv.reader(f, delimiter=',')
        ]

    active_users_df = pandas.read_csv(proj_path + '/active_users.csv')

    num_main_proj_users = len(inactivity_intervals_data)
    num_active_users = len(active_users_df)

    full_sleepings_list = util.getSleepingsList(proj_path)
    full_hibernated_list = util.getHibernationsList(
        proj_path)  # Includes Deads because they have been Hibernated before
    full_dead_list = util.getDeadsList(proj_path)
    util.add(projects_stats, [
        project_name, num_main_proj_users, num_active_users,
        len(full_sleepings_list),
        len(full_hibernated_list),
        len(full_dead_list)
    ])

# Write Final Tables
projects_stats.to_csv(main_path + '/projects_stats.csv',
                      sep=';',
                      na_rep='NA',
                      header=True,
                      index=False,
                      mode='w',
                      encoding='utf-8',