Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,7 @@ import pandas as pd
|
|
19 |
import plotly.express as px
|
20 |
##import gurobipy
|
21 |
|
|
|
22 |
import streamlit as st
|
23 |
|
24 |
|
@@ -57,7 +58,7 @@ t = pd.Index(df_excel.iloc[:,0], name = 't')[1:168]
|
|
57 |
# Technologies
|
58 |
df_excel = pd.read_excel(url_excel, sheet_name = 'Technologies')
|
59 |
i = pd.Index(df_excel.iloc[:,0], name = 'i')
|
60 |
-
|
61 |
|
62 |
df_excel = pd.read_excel(url_excel, sheet_name = 'Technologies')
|
63 |
iConv = pd.Index(df_excel.iloc[0:7,2], name = 'iConv')
|
@@ -236,29 +237,9 @@ CO2_limit = m.add_constraints(((y / eff_i) * co2_factor_i * dt).sum() <= l_co2,
|
|
236 |
m.solve(solver_name = 'highs')
|
237 |
|
238 |
|
239 |
-
|
240 |
# %%
|
241 |
-
#
|
242 |
-
|
|
|
243 |
|
244 |
-
pd.options.plotting.backend = "plotly"
|
245 |
-
# Read dual values and plot
|
246 |
-
df = loadserve_t.dual.to_dataframe().reset_index()
|
247 |
-
#df['t'] = pd.to_datetime(df['t'])
|
248 |
-
df
|
249 |
-
|
250 |
-
|
251 |
-
# %%
|
252 |
-
# Read values
|
253 |
-
Productionlevels = m.solution['y'].to_dataframe().reset_index()
|
254 |
-
|
255 |
-
df = Productionlevels
|
256 |
-
df
|
257 |
-
|
258 |
-
# %%
|
259 |
-
#pandas gui
|
260 |
-
# Create Line plot
|
261 |
-
fig = px.line(df, x=df['t'], y=df['y'], color = df['i'])
|
262 |
fig
|
263 |
-
|
264 |
-
# %%
|
|
|
19 |
import plotly.express as px
|
20 |
##import gurobipy
|
21 |
|
22 |
+
|
23 |
import streamlit as st
|
24 |
|
25 |
|
|
|
58 |
# Technologies
|
59 |
df_excel = pd.read_excel(url_excel, sheet_name = 'Technologies')
|
60 |
i = pd.Index(df_excel.iloc[:,0], name = 'i')
|
61 |
+
|
62 |
|
63 |
df_excel = pd.read_excel(url_excel, sheet_name = 'Technologies')
|
64 |
iConv = pd.Index(df_excel.iloc[0:7,2], name = 'iConv')
|
|
|
237 |
m.solve(solver_name = 'highs')
|
238 |
|
239 |
|
|
|
240 |
# %%
|
241 |
+
# Installed Cap
|
242 |
+
# Assuming df_excel has columns 'All' and 'Capacities'
|
243 |
+
fig = px.bar(m.solution['K'].to_dataframe().reset_index(), y='i', x='K', orientation='h', title='Installed Capacities', color='i')
|
244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
fig
|
|
|
|