normalize cache instruments :return: list or dict
(instruments)
| 357 | |
| 358 | |
| 359 | def normalize_cache_instruments(instruments): |
| 360 | """normalize cache instruments |
| 361 | |
| 362 | :return: list or dict |
| 363 | """ |
| 364 | if isinstance(instruments, (list, tuple, pd.Index, np.ndarray)): |
| 365 | instruments = sorted(list(instruments)) |
| 366 | else: |
| 367 | # dict type stockpool |
| 368 | if "market" in instruments: |
| 369 | pass |
| 370 | else: |
| 371 | instruments = {k: sorted(v) for k, v in instruments.items()} |
| 372 | return instruments |
| 373 | |
| 374 | |
| 375 | def is_tradable_date(cur_date): |