Spaces:
Runtime error
Runtime error
Commit ·
6f418fd
1
Parent(s): 059f046
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,10 +64,19 @@ simulation = Executor(exec_context=exec_context, configs=experiment.configs)
|
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
-
def
|
| 68 |
raw_result, tensor_fields, sessions = simulation.execute()
|
| 69 |
result = pd.DataFrame(raw_result)
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
|
|
|
|
| 73 |
iface.launch()
|
|
|
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
+
def plot_seir(name):
|
| 68 |
raw_result, tensor_fields, sessions = simulation.execute()
|
| 69 |
result = pd.DataFrame(raw_result)
|
| 70 |
+
pd.options.plotting.backend = "plotly"
|
| 71 |
+
fig = result.plot(
|
| 72 |
+
kind = "line",
|
| 73 |
+
x = "timestep",
|
| 74 |
+
y= ["S","E","I", "R"])
|
| 75 |
+
fig.update_layout(title = name,
|
| 76 |
+
xaxis_title="Time (Days)",
|
| 77 |
+
yaxis_title="People")
|
| 78 |
+
return fig
|
| 79 |
|
| 80 |
+
graph = gr.Plot()
|
| 81 |
+
iface = gr.Interface(fn=plot_seir, inputs="text", outputs=graph)
|
| 82 |
iface.launch()
|