示例#1
0
def test_get_balance_history():
    from data_manager import create_new_experiment, get_balance_history
    df = pd.read_csv('./Testing/Testing_W041_load.csv')
    df.columns = ['TEST5', '2026-04-04', '2029-03-03']
    df[df.columns[0]] = df[df.columns[0]]+'5'
    create_new_experiment(df)
    plants = get_balance_history(40)
示例#2
0
def test_get_all_watering_history():
    from data_manager import create_new_experiment, get_all_water_data
    df = pd.read_csv('./Testing/Testing_W041_load.csv')
    df.columns = ['TEST6', '2024-04-04', '2028-03-03']
    df[df.columns[0]] = df[df.columns[0]]+'6'
    create_new_experiment(df)
    plants = get_all_water_data('TEST6')
示例#3
0
def test_end_experiment():
    from data_manager import create_new_experiment, end_experiment
    df = pd.read_csv('./Testing/Testing_W041_load.csv')
    df.columns = ['TEST2', '2020-08-20', '2023-03-03']
    df[df.columns[0]] = df[df.columns[0]]+'2'
    create_new_experiment(df)
    end_experiment('TEST2')
示例#4
0
def test_get_experiment_plants():
    from data_manager import create_new_experiment, get_experiment_plants
    df = pd.read_csv('./Testing/Testing_W041_load.csv')
    df.columns = ['TEST3', '2022-04-04', '2024-03-03']
    df[df.columns[0]] = df[df.columns[0]]+'3'
    create_new_experiment(df)
    plants = get_experiment_plants('TEST3')
示例#5
0
def test_get_all_balance_history():
    from data_manager import create_new_experiment, get_all_balance_data
    df = pd.read_csv('./Testing/Testing_W041_load.csv')
    df.columns = ['TEST7', '2027-04-04', '2030-03-03']
    df[df.columns[0]] = df[df.columns[0]]+'7'
    create_new_experiment(df)
    plants = get_all_balance_data('TEST7')
示例#6
0
def test_update_target_weights():
    from data_manager import create_new_experiment, update_target_weights
    df = pd.read_csv('./Testing/Testing_W041_load.csv')
    df.columns = ['TEST1', '2022-01-01', '2023-01-01']
    df[df.columns[0]] = df[df.columns[0]]+'1'
    create_new_experiment(df)
    df[df.columns[1]] = df[df.columns[1]]+1
    update_target_weights(df)
示例#7
0
def test_create_new_experiment_same_dates():
    from data_manager import create_new_experiment
    df = pd.read_csv('./Testing/Testing_W041_load.csv')
    df.columns = ['TEST_Same_Dates1', '2022-01-01', '2023-01-01']
    df[df.columns[0]] = df[df.columns[0]]+'66'
    create_new_experiment(df)

    df.columns = ['TEST_Same_Dates2', '2022-01-01', '2023-01-01']
    df[df.columns[0]] = df[df.columns[0]]+'99'
    create_new_experiment(df)
示例#8
0
def new_experiment():
    resp = None
    if request.method == 'POST':
        resp, df = get_uploaded_file_as_df()
        if resp:
            resp = create_new_experiment(df, owner=session['username'][:3])
    return render_template('new_experiment.html', resp=resp)
示例#9
0
def test_create_new_experiment():
    from data_manager import create_new_experiment
    df = pd.read_csv('./Testing/Testing_W041_load.csv')
    create_new_experiment(df)