Skip to content

Commit a6d7ebb

Browse files
normalized arg names, fixed requirements, removed random comments
1 parent d41eacd commit a6d7ebb

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

requirements.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
dash==2.0.0
2+
dash-bootstrap-components==1.0.3
3+
numpy==1.21.2
4+
pandas==1.3.3
15
PyYAML==5.4.1
26
requests==2.26.0
37
symbol-sdk-core-python==2.0.1
4-
zenlog==1.1
8+
tqdm==4.62.3
9+
zenlog==1.1

treasury/treasury/__init__.py

Whitespace-only changes.

treasury/treasury/app.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import dash
44
import dash_bootstrap_components as dbc
55
import pandas as pd
6-
from callbacks import (download_full, download_full_prices, download_small, download_small_prices, get_update_balances, get_update_prices,
7-
update_forecast_chart, update_price_chart, update_summary)
86
from dash import dcc, html
97
from dash.dependencies import Input, Output, State
10-
from data import get_gecko_spot, lookup_balance
8+
9+
from treasury.callbacks import (download_full, download_full_prices, download_small, download_small_prices, get_update_balances,
10+
get_update_prices, update_forecast_chart, update_price_chart, update_summary)
11+
from treasury.data import get_gecko_spot, lookup_balance
1112

1213
# defaults for startup
1314
FORECAST_PERIODS = 90
@@ -164,7 +165,7 @@ def get_app(price_data_loc, account_data_loc, serve, base_path, start_date, end_
164165
dcc.Store(id='small-sims'),
165166
dcc.Interval(
166167
id='auto-update-trigger',
167-
interval=auto_update_delay_seconds*1000, # in milliseconds
168+
interval=auto_update_delay_seconds*1000,
168169
n_intervals=0)
169170
], fluid=True)
170171

@@ -236,16 +237,15 @@ def get_app(price_data_loc, account_data_loc, serve, base_path, start_date, end_
236237

237238
def main():
238239
parser = argparse.ArgumentParser(description='webapp that processes data files and renders fork information')
239-
# parser.add_argument('--resources', help='directory containing resources', required=True)
240240
parser.add_argument('--host', help='host ip, defaults to localhost', default='127.0.0.1')
241241
parser.add_argument('--port', type=int, help='port for webserver', default=8080)
242242
parser.add_argument('--proxy', help='proxy spec of the form ip:port::gateway to render urls', default=None)
243-
parser.add_argument('--base_path', help='extension if server is not at root of url', default=None)
243+
parser.add_argument('--base-path', help='extension if server is not at root of url', default=None)
244244
parser.add_argument('--serve', action='store_true', help='flag to indicate whether server will recieve external requests')
245-
parser.add_argument('--price_data_loc', help='path to flat file storing collected data', default='../data/price_data.csv')
246-
parser.add_argument('--account_data_loc', help='path to csv with account information', default='../data/accounts.csv')
247-
parser.add_argument('--start_date', help='default start date', default='2021-12-01')
248-
parser.add_argument('--end_date', help='default end date', default=None)
245+
parser.add_argument('--price-data-loc', help='path to flat file storing collected data', default='../data/price_data.csv')
246+
parser.add_argument('--account-data-loc', help='path to csv with account information', default='../data/accounts.csv')
247+
parser.add_argument('--start-date', help='default start date', default='2021-12-01')
248+
parser.add_argument('--end-date', help='default end date', default=None)
249249
args = parser.parse_args()
250250

251251
if args.end_date is None:

treasury/treasury/callbacks.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import dash_bootstrap_components as dbc
22
import pandas as pd
33
import plotly.graph_objects as go
4-
import tensorflow_probability as tfp
54
from dash import dcc, html
6-
from data import get_gecko_prices, get_gecko_spot, lookup_balance
7-
from models import get_mean_variance_forecasts
8-
9-
tfd = tfp.distributions
105

6+
from treasury.data import get_gecko_prices, get_gecko_spot, lookup_balance
7+
from treasury.models import get_mean_variance_forecasts
118

129
EXPLORER_URL_MAP = {
1310
'XYM': 'https://symbol.fyi/accounts/',
@@ -261,7 +258,7 @@ def update_price_chart(lookback_prices, price_fig):
261258
go.Scattergl(
262259
x=lookback_returns.index.values,
263260
y=lookback_returns[asset].values,
264-
line=dict(width=2), # , color=COLOR_DICT.get(asset,'#ffffff')),
261+
line=dict(width=2),
265262
name=asset,
266263
customdata=lookback_prices[asset],
267264
hovertemplate=(

treasury/treasury/data.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from tqdm import tqdm
88

99
XYM_API_HOST = os.getenv('XYM_API_HOST', 'wolf.importance.jp')
10-
# XEM_API_HOST = os.getenv('XEM_API_HOST', 'alice5.nem.ninja')
1110
XEM_API_HOST = os.getenv('XEM_API_HOST', 'bigalice3.nem.ninja')
1211
CM_KEY = os.getenv('CM_KEY', '')
1312

0 commit comments

Comments
 (0)