Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'collector' has no attribute 'YahooNormalizeUS1dExtend' while running update_data_to_bin #1196

Closed
rmallof opened this issue Jul 13, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@rmallof
Copy link

rmallof commented Jul 13, 2022

🐛 Bug Description

After downloading all the US tickers I attempted to update the prices using 'python collector.py update_data_to_bin'

An observation made is it took almost the same amount of time than downloading all the data. Plus, by the end of the execution, the script crashed:

2022-07-13 06:22:32.848 | INFO | data_collector.base:_collector:197 - error symbol nums: 0
2022-07-13 06:22:32.848 | INFO | data_collector.base:_collector:198 - current get symbol nums: 12754
2022-07-13 06:22:32.848 | INFO | data_collector.base:collector_data:211 - 1 finish.
2022-07-13 06:22:32.848 | INFO | data_collector.base:collector_data:218 - total 12754, error: 0
Traceback (most recent call last):
File "collector.py", line 1203, in
fire.Fire(Run)
File "/opt/conda/envs/qlib/lib/python3.8/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/opt/conda/envs/qlib/lib/python3.8/site-packages/fire/core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/opt/conda/envs/qlib/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "collector.py", line 1178, in update_data_to_bin
self.normalize_data_1d_extend(qlib_data_1d_dir)
File "collector.py", line 1058, in normalize_data_1d_extend
_class = getattr(self._cur_module, f"{self.normalize_class_name}Extend")
AttributeError: module 'collector' has no attribute 'YahooNormalizeUS1dExtend'

To Reproduce

Steps to reproduce the behavior:

  1. Download all prices from US region
  2. Run python collector.py update_data_to_bin --source_dir /us_source --normalize_dir /us_data_normal --qlib_data_1d_dir /us_data --region US --trading_date 2022-07-09 --end_date 2022-07-12

Expected Behavior

Prices are updated without crashing

Environment

Linux
x86_64
Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.10
#1 SMP Wed Mar 2 00:30:59 UTC 2022

Python version: 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:10) [GCC 10.3.0]

Qlib version: 0.8.6.99
numpy==1.23.1
pandas==1.4.3
scipy==1.8.1
requests==2.28.1
sacred==0.8.2
python-socketio==5.6.0
redis==4.3.4
python-redis-lock==3.7.0
schedule==1.1.0
cvxpy==1.2.1
hyperopt==0.1.2
fire==0.4.0
statsmodels==0.13.2
xlrd==2.0.1
plotly==5.5.0
matplotlib==3.5.1
tables==3.7.0
pyyaml==6.0
mlflow==1.27.0
tqdm==4.64.0
loguru==0.6.0
lightgbm==3.3.2
tornado==6.1
joblib==1.1.0
fire==0.4.0
ruamel.yaml==0.17.21

Additional Notes

@rmallof rmallof added the bug Something isn't working label Jul 13, 2022
@rmallof
Copy link
Author

rmallof commented Jul 13, 2022

Maybe I'm missing something but the above command, even with --trading_date 2022-07-09 --end_date 2022-07-12, it downloaded data from 2000-12-28 to 2020-11-10

I'd appreciate some pointers on how to properly use the update_data_to_bin succesfully

Thank you!

@you-n-g
Copy link
Collaborator

you-n-g commented Jul 18, 2022

Data updating is not supported for US data.
But I think not much customization is required.
You can follow this example and create a PR to make contributions to the community.

@rmallof
Copy link
Author

rmallof commented Jul 18, 2022

Thanks for the reply, I'll check out the example above

Awesome project btw!

@rmallof rmallof closed this as completed Jul 18, 2022
HyeongminMoon added a commit to HyeongminMoon/qlib that referenced this issue Nov 15, 2022
HyeongminMoon added a commit to HyeongminMoon/qlib that referenced this issue Nov 15, 2022
you-n-g pushed a commit that referenced this issue Dec 5, 2022
… (from yahoo finance) for US region (#1358)

* Update YahooNormalizeUS1dExtend(#1196)

* Prevent pandas read_csv errors while running update_data_to_bin for US region

* Fix parse_index error while running update_data_to_bin for US region

* prevent pandas.read_csv error on specific symbol names

* Reordering parameters for better rendering

* removes prefix during feature_dir existence checking

* add explanation comments
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this issue Mar 23, 2023
… (from yahoo finance) for US region (microsoft#1358)

* Update YahooNormalizeUS1dExtend(microsoft#1196)

* Prevent pandas read_csv errors while running update_data_to_bin for US region

* Fix parse_index error while running update_data_to_bin for US region

* prevent pandas.read_csv error on specific symbol names

* Reordering parameters for better rendering

* removes prefix during feature_dir existence checking

* add explanation comments
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this issue Mar 23, 2023
… (from yahoo finance) for US region (microsoft#1358)

* Update YahooNormalizeUS1dExtend(microsoft#1196)

* Prevent pandas read_csv errors while running update_data_to_bin for US region

* Fix parse_index error while running update_data_to_bin for US region

* prevent pandas.read_csv error on specific symbol names

* Reordering parameters for better rendering

* removes prefix during feature_dir existence checking

* add explanation comments
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this issue Mar 23, 2023
… (from yahoo finance) for US region (microsoft#1358)

* Update YahooNormalizeUS1dExtend(microsoft#1196)

* Prevent pandas read_csv errors while running update_data_to_bin for US region

* Fix parse_index error while running update_data_to_bin for US region

* prevent pandas.read_csv error on specific symbol names

* Reordering parameters for better rendering

* removes prefix during feature_dir existence checking

* add explanation comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants