import pandas as pd
from OCAES import ocaes

# ----------------------
# create and run model
# ----------------------
data = pd.read_csv('timeseries_inputs_2019.csv')
inputs = ocaes.get_default_inputs()
# inputs['C_well'] = 5000.0
# inputs['X_well'] = 50.0
# inputs['L_well'] = 50.0
# inputs['X_cmp'] = 0
# inputs['X_exp'] = 0
model = ocaes(data, inputs)
df, s = model.get_full_results()

revenue, LCOE, COVE, avoided_emissions = model.post_process(s)
s['revenue'] = revenue
s['LCOE'] = LCOE
s['COVE'] = COVE
s['avoided_emissions'] = avoided_emissions


df.to_csv('results_timeseries.csv')
s.to_csv('results_values.csv')
print(model.calculate_LCOE(s))

# ----------------------
# create plots using built-in functions
# ----------------------
model.plot_overview()
model.plot_power_energy()

[((7, 7, 7, 48), 'pandas.read_csv', 'pd.read_csv', ({(7, 19, 7, 47): '"""timeseries_inputs_2019.csv"""'}, {}), "('timeseries_inputs_2019.csv')", True, 'import pandas as pd\n'), ((8, 9, 8, 35), 'OCAES.ocaes.get_default_inputs', 'ocaes.get_default_inputs', ({}, {}), '()', False, 'from OCAES import ocaes\n'), ((14, 8, 14, 27), 'OCAES.ocaes', 'ocaes', ({(14, 14, 14, 18): 'data', (14, 20, 14, 26): 'inputs'}, {}), '(data, inputs)', False, 'from OCAES import ocaes\n')]