MCPcopy Index your code
hub / github.com/microsoft/qlib / normalize_cache_instruments

Function normalize_cache_instruments

qlib/utils/__init__.py:359–372  ·  view source on GitHub ↗

normalize cache instruments :return: list or dict

(instruments)

Source from the content-addressed store, hash-verified

357
358
359def 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
375def is_tradable_date(cur_date):

Callers 1

normalize_uri_argsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected