1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-14 16:26:55 +08:00

add_pre-commit_and_flake8_to_CI

This commit is contained in:
Linlang Lv (iSoftStone)
2022-03-22 09:48:13 +08:00
committed by you-n-g
parent 243e516cf1
commit 30e457119c
45 changed files with 191 additions and 42 deletions

View File

@@ -170,12 +170,9 @@ class ExpManager:
experiment_name = self._default_exp_name
if create:
exp, is_new = self._get_or_create_exp(experiment_id=experiment_id, experiment_name=experiment_name)
exp, _ = self._get_or_create_exp(experiment_id=experiment_id, experiment_name=experiment_name)
else:
exp, is_new = (
self._get_exp(experiment_id=experiment_id, experiment_name=experiment_name),
False,
)
exp = self._get_exp(experiment_id=experiment_id, experiment_name=experiment_name)
if self.active_experiment is None and start:
self.active_experiment = exp
# start the recorder
@@ -201,7 +198,7 @@ class ExpManager:
# So we supported it in the interface wrapper
pr = urlparse(self.uri)
if pr.scheme == "file":
with FileLock(os.path.join(pr.netloc, pr.path, "filelock")) as f: # pylint: disable=E0110
with FileLock(os.path.join(pr.netloc, pr.path, "filelock")): # pylint: disable=E0110
return self.create_exp(experiment_name), True
# NOTE: for other schemes like http, we double check to avoid create exp conflicts
try:

View File

@@ -146,7 +146,7 @@ class RecordTemp:
for item in self.list():
ps = self.get_path(item).split("/")
dirn, fn = "/".join(ps[:-1]), ps[-1]
dirn = "/".join(ps[:-1])
if self.get_path(item) not in _get_arts(dirn):
raise FileNotFoundError
if parents: