Skip to content

data collector for PIT is not working #1892

@hlstwizard

Description

@hlstwizard

🐛 Bug Description

To Reproduce

Steps to reproduce the behavior:

  1. Follow the example to download PIT data.
    python collector.py download_data --source_dir ~/.qlib/stock_data/source/pit --start 2000-01-01 --end 2020-01-01 --interval quarterly
  2. Get this error
Traceback (most recent call last):
  File "E:\Git\qlib\scripts\data_collector\pit\collector.py", line 261, in <module>
    fire.Fire(Run)
  File "C:\veighna_studio\lib\site-packages\fire\core.py", line 135, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "C:\veighna_studio\lib\site-packages\fire\core.py", line 468, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "C:\veighna_studio\lib\site-packages\fire\core.py", line 684, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "E:\Git\qlib\scripts\data_collector\base.py", line 402, in download_data
    _class(
  File "E:\Git\qlib\scripts\data_collector\pit\collector.py", line 69, in __init__
    super().__init__(
  File "E:\Git\qlib\scripts\data_collector\base.py", line 80, in __init__
    self.instrument_list = sorted(set(self.get_instrument_list()))
  File "E:\Git\qlib\scripts\data_collector\pit\collector.py", line 83, in get_instrument_list
    symbols = get_hs_stock_symbols()
  File "E:\Git\qlib\scripts\data_collector\utils.py", line 235, in get_hs_stock_symbols
    symbols |= _get_symbol()
  File "E:\Git\qlib\scripts\data_collector\utils.py", line 219, in _get_symbol
    raise ValueError("The complete list of stocks is not available.")
ValueError: The complete list of stocks is not available.
(pit)

Expected Behavior

No error occurs and we fetch the data successfully.

Screenshot

Environment

Note: User could run cd scripts && python collect_info.py all under project directory to get system information
and paste them here directly.

  • Qlib version:
  • Python version:
  • OS (Windows, Linux, MacOS): Windows
  • Commit number (optional, please provide it if you are using the dev version):

Additional Notes

The possible problem is that this API is not returning the full list of 5000+ symbols, but only part of it.

If we want the full list, it must be sourced from somewhere else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions