diff --git a/alphacompiler/data/load_quandl_sf1.py b/alphacompiler/data/load_quandl_sf1.py index d4448b6..bed0bbe 100644 --- a/alphacompiler/data/load_quandl_sf1.py +++ b/alphacompiler/data/load_quandl_sf1.py @@ -33,6 +33,13 @@ def clear_raw_folder(raw_folder_path): + # check if raw exists, else create raw + raw_f_path = os.path.join(BASE, "raw") + if not os.path.exists(raw_f_path): + # If it doesn't exist, create the "raw" folder + os.makedirs(raw_f_path) + print(f"The 'raw' folder has been created at: {raw_f_path}") + # removes all the files in the raw folder print(' ** clearing the raw/ folder **') files = glob.glob(raw_folder_path + '/*') diff --git a/alphacompiler/util/zipline_data_tools.py b/alphacompiler/util/zipline_data_tools.py index 74d9c35..6beb1f1 100644 --- a/alphacompiler/util/zipline_data_tools.py +++ b/alphacompiler/util/zipline_data_tools.py @@ -67,7 +67,8 @@ def get_tickers_from_bundle(bundle_name): bundle_data = load(bundle_name, os.environ, None) # get a list of all sids - lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")])) + #lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")])) + lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(country_codes=[str("US")]) # enable zipline-reloaded all_sids = lifetimes.sid # retreive all assets in the bundle @@ -82,7 +83,8 @@ def get_all_assets_for_bundle(bundle_name): bundle_data = load(bundle_name, os.environ, None) # get a list of all sids - lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")])) + #lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(frozenset([str("US")])) + lifetimes = bundle_data.asset_finder._compute_asset_lifetimes(country_codes=[str("US")]) # enable zipline-reloaded all_sids = lifetimes.sid print('all_sids: ', all_sids)