import pandas as pd
#import numpy as np
import os

DATA_PATH = os.path.join(os.path.dirname(__file__), "data/")

def load_assets() -> 'df':
    return pd.read_csv(DATA_PATH + 'assets.csv',encoding='gbk').set_index('date')

#def load_hs300_5min() -> 'df':
#    return pd.read_hdf(DATA_PATH + 'hs300_5min.h5')

def load_intraday(name = 'hs300', bar_size = '5min') -> 'df':
    return pd.read_hdf(DATA_PATH + name + '_' + bar_size + '.h5')

def load_hs300() -> 'df':
    print('--- data from tushare ---')
    df= pd.read_csv(DATA_PATH + 'hs300.csv', dtype = {'trade_date':str})
    return df.set_index('trade_date')
