Exemplo n.º 1
0
def main(prefix):

    result = re.load_result(prefix)
    result.import_dict(ml_glpp_parameters(result))
    re.save_result(prefix, result)

    return result
Exemplo n.º 2
0
def run_trial(trial, prefix="experiment", *args):
  ''' Runs a particular trial. Parameters:
        - trial: name of a function in trials.py
        - prefix: file in which the results should be stored.
        - *args: arguments to the trial function '''
  reload(trials)
  resu = getattr(trials, trial)(*args)
  result.save_result(config.results_dir + prefix, resu)
  return resu
Exemplo n.º 3
0
def main(prefix):
    result = re.load_result(prefix)
    try:
        an = lnp_result_info(result)
    except:
        print " (not a LNP simulation)"
        an = information_analysis(result.intensity)
    setattr(result, "info", an)
    re.save_result(prefix, result)
    return result
Exemplo n.º 4
0
    if catch_no_event:
        twitter.obtain_tweets(date_since, date_until,
                              csv_with_duplicate + no_event_folder + date,
                              csv_without_duplicate + no_event_folder + date)

    # Get and show total tweets statistics
    print("\nGet number of total tweets")
    total_tweets_counts = twitter.count_total_tweets(
        twitter.get_teams(), csv_with_duplicate + no_event_folder + date)

    graphic.create_graph(total_tweets_counts, ["Team", "Count"])

    # Save results in CSV file
    print("\nSave results -> Total tweets")
    result.save_result(total_tweets_counts,
                       ["Position", "Team", "Total tweets"],
                       csv_result + no_event_folder + date,
                       "ResultTotalTweets")

    # Get and show unique users' tweets statistics
    print("\nGet number of tweets created by unique users")
    total_tweets_per_unique_user_counts = twitter.count_tweets_per_unique_user(
        twitter.get_teams(), csv_without_duplicate + no_event_folder + date)

    graphic.create_graph(total_tweets_per_unique_user_counts,
                         ["Team", "Count"])

    # Save results in CSV file
    print("\nSave results -> Total tweets per unique user")
    result.save_result(total_tweets_per_unique_user_counts,
                       ["Position", "Team", "Total tweets per unique user"],
                       csv_result + no_event_folder + date,