1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-05 20:11:08 +08:00

Fix bugs for get_local_dir

This commit is contained in:
D-X-Y
2021-03-11 03:05:31 +00:00
parent cda96be8c3
commit 0ef7c8e0e6
4 changed files with 9 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ def get_path_list(path):
if isinstance(path, str):
return [path]
else:
return [p for p in path]
return list(path)
def sys_config(config, config_path):

View File

@@ -245,10 +245,10 @@ class MLflowRecorder(Recorder):
This function will return the directory path of this recorder.
"""
if self.artifact_uri is not None:
local_file_prefix = "file:"
if self.artifact_uri.startswith(local_file_prefix):
xpath = self.artifact_uri.lstrip(local_file_prefix)
return (Path(xpath) / "..").resolve()
local_dir_path = Path(self.artifact_uri.lstrip("file:")) / ".."
local_dir_path = str(local_dir_path.resolve())
if os.path.isdir(local_dir_path):
return local_dir_path
else:
raise RuntimeError("This recorder is not saved in the local file system.")