Spaces:
Sleeping
Sleeping
File size: 3,511 Bytes
17ac060 6fdbb88 17ac060 98186ab 17ac060 58a2fce 88267ef 6fdbb88 88267ef 6fdbb88 88267ef 17ac060 58a2fce 6fdbb88 58a2fce 17ac060 58a2fce 17ac060 59596b5 17ac060 6b3eddf 17ac060 6fdbb88 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# Test Output
import streamlit as st
import pandas as pd
import plotly.graph_objects as go
st.set_page_config(
layout="wide",
page_title='Model-Test',
menu_items={
'About': "A shareable data application. https://www.giltedged.systems"
}
)
# Functions
@st.cache_data
def load_data(url, rows):
df = pd.read_csv(url, nrows=rows)
return df
def filter_data(df, end):
sliced_df = df.iloc[0:end]
return sliced_df
# Load analysis output.
output_df = load_data(
"https://www.data-reports.net/model-output/abmlp-test/abmlp-test-run-00.csv",
170 # number of steps.
)
# Layout
header = st.container()
body = st.container()
footer = st.container()
with header:
col1, col2 = st.columns(2)
with col1:
st.title("ABMLP-X Test Output")
with col2:
st.info("[GiltEdged.systems/category/abmlp-x](https://www.giltedged.systems/category/abmlp-x)")
with body:
with st.expander("See the Introduction of Long Term Bonds"):
st.markdown('''
> "In contrast to the centuries during which it had charged for the money, the (English) government now paid for the currency it enabled. - As a conceptual matter, the new system raises an interesting issue, left aside here. It seems that the payment of interest on debt that is later canceled means that the system will never 'clear'. In that sense, there appears to be an inflationary aspect to the modern strategy of liquidity creation, all else equal." — DESAN, C. (2015). *Making Money: Coin, Currency, and the Coming of Capitalism.* Oxford University Press. p. 296''')
col1, col2, col3, col4, col5 = st.columns(5)
col1.metric("Model Steps", "170")
col2.metric("Expenditure", "20 Units", "At Every Step", delta_color="off")
col3.metric("Coupon Rate", "1%")
col4.metric("Base Rate", "1%")
col5.metric("Taxation", "20%", "Flat Rate", delta_color="off")
steps = st.slider(label="Steps", min_value=10, max_value=170, value=170)
chart_data = filter_data(output_df, steps)
def display_chart():
goFig = go.Figure()
goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.national_income,
mode='lines',
name='National Income'
))
goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.disposable_income,
mode='lines',
name='Disposable Income'
))
goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.consumption,
mode='lines',
name='Consumption'
))
goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.bills_issued,
mode='lines',
name='Bills Issued'
))
goFig.add_trace(go.Scatter(x=chart_data.date, y=chart_data.fiscal_balance,
mode='lines',
name='Fiscal Balance'
))
goFig.update_layout(
margin=dict(l=50,r=40,b=40,t=40),
height=700,
template="plotly_dark",
xaxis_title="Model Steps",
xaxis_tickfont_size=14,
yaxis=dict(
title='Monetary Units',
),
showlegend=True,
legend_title="Macro Indicators"
)
st.plotly_chart(goFig, use_container_width=True, theme="streamlit")
display_chart()
with footer:
st.markdown("---")
st.caption("Visit the [GiltEdged.systems](https://www.www.giltedged.systems) website.")
|