MCPcopy
hub / github.com/microsoft/qlib / get_data_uri

Method get_data_uri

qlib/config.py:366–384  ·  view source on GitHub ↗

please refer DataPathManager's __init__ and class doc

(self, freq: Optional[Union[str, Freq]] = None)

Source from the content-addressed store, hash-verified

364 return QlibConfig.LOCAL_URI
365
366 def get_data_uri(self, freq: Optional[Union[str, Freq]] = None) -> Path:
367 """
368 please refer DataPathManager's __init__ and class doc
369 """
370 if freq is not None:
371 freq = str(freq) # converting Freq to string
372 if freq is None or freq not in self.provider_uri:
373 freq = QlibConfig.DEFAULT_FREQ
374 _provider_uri = self.provider_uri[freq]
375 if self.get_uri_type(_provider_uri) == QlibConfig.LOCAL_URI:
376 return Path(_provider_uri)
377 elif self.get_uri_type(_provider_uri) == QlibConfig.NFS_URI:
378 if "win" in platform.system().lower():
379 # windows, mount_path is the drive
380 _path = str(self.mount_path[freq])
381 return Path(f"{_path}:\\") if ":" not in _path else Path(_path)
382 return Path(self.mount_path[freq])
383 else:
384 raise NotImplementedError(f"This type of uri is not supported")
385
386 def set_mode(self, mode):
387 # raise KeyError

Callers 14

initFunction · 0.80
get_cache_dirMethod · 0.80
_expressionMethod · 0.80
updateMethod · 0.80
_datasetMethod · 0.80
_dataset_uriMethod · 0.80
updateMethod · 0.80
datasetMethod · 0.80
period_featureMethod · 0.80
datasetMethod · 0.80
support_freqMethod · 0.80
uriMethod · 0.80

Calls 1

get_uri_typeMethod · 0.95

Tested by

no test coverage detected