1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-09 22:10:56 +08:00

for IDE auto-complete with global Wrapper

R, D, Cal, Inst, FeatureD, ExpressionD, DatasetD, D
This commit is contained in:
王雪
2021-01-20 19:52:41 +08:00
committed by you-n-g
parent e85646762c
commit 5ad1b4cc33
2 changed files with 166 additions and 49 deletions

View File

@@ -38,7 +38,9 @@ class QlibRecorder:
try:
yield run
except Exception as e:
self.end_exp(Recorder.STATUS_FA) # end the experiment if something went wrong
self.end_exp(
Recorder.STATUS_FA
) # end the experiment if something went wrong
raise e
self.end_exp(Recorder.STATUS_FI)
@@ -461,5 +463,14 @@ class QlibRecorder:
self.get_exp().get_recorder().set_tags(**kwargs)
import sys
if sys.version_info >= (3, 9):
from typing import Annotated
QlibRecorderWrapper = Annotated[QlibRecorder, Wrapper]
else:
QlibRecorderWrapper = QlibRecorder
# global record
R = Wrapper()
R: QlibRecorderWrapper = Wrapper()