mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-11 06:46:56 +08:00
Merge branch 'main' into main
This commit is contained in:
@@ -221,12 +221,13 @@ class QlibConfig(Config):
|
||||
self["provider_uri"] = str(Path(self["provider_uri"]).expanduser().resolve())
|
||||
|
||||
def get_uri_type(self):
|
||||
rm = re.match("^[^/ ]+:.+", self["provider_uri"])
|
||||
# Windows path is "C:\\"
|
||||
if rm is None or Path(self["provider_uri"]).exists():
|
||||
return QlibConfig.LOCAL_URI
|
||||
else:
|
||||
is_win = re.match("^[a-zA-Z]:.*", self["provider_uri"]) is not None # such as 'C:\\data', 'D:'
|
||||
is_nfs_or_win = re.match("^[^/]+:.+", self["provider_uri"]) is not None # such as 'host:/data/' (User may define short hostname by themselves or use localhost)
|
||||
|
||||
if is_nfs_or_win and not is_win:
|
||||
return QlibConfig.NFS_URI
|
||||
else:
|
||||
return QlibConfig.LOCAL_URI
|
||||
|
||||
def get_data_path(self):
|
||||
if self.get_uri_type() == QlibConfig.LOCAL_URI:
|
||||
|
||||
Reference in New Issue
Block a user