mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-11 23:06:58 +08:00
Update R and workflow
This commit is contained in:
@@ -9,15 +9,13 @@ import re
|
||||
import sys
|
||||
import copy
|
||||
import yaml
|
||||
import atexit
|
||||
import signal
|
||||
import logging
|
||||
import platform
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from .utils import can_use_cache, init_instance_by_config, get_module_by_module_path
|
||||
from .workflow.utils import experiment_exception_hook, experiment_kill_signal_handler
|
||||
from .workflow.utils import experiment_exit_handler
|
||||
|
||||
# init qlib
|
||||
def init(default_conf="client", **kwargs):
|
||||
@@ -46,14 +44,9 @@ def init(default_conf="client", **kwargs):
|
||||
C.set_region(kwargs.get("region", C["region"] if "region" in C else REG_CN))
|
||||
|
||||
for k, v in kwargs.items():
|
||||
if k == "exp_manager":
|
||||
C["exp_manager"].update({"class": v})
|
||||
elif k == "exp_uri":
|
||||
C["exp_manager"]["kwargs"].update({"uri": v})
|
||||
else:
|
||||
C[k] = v
|
||||
if k not in C:
|
||||
LOG.warning("Unrecognized config %s" % k)
|
||||
C[k] = v
|
||||
if k not in C:
|
||||
LOG.warning("Unrecognized config %s" % k)
|
||||
|
||||
C.resolve_path()
|
||||
|
||||
@@ -93,9 +86,7 @@ def init(default_conf="client", **kwargs):
|
||||
qr = QlibRecorder(exp_manager)
|
||||
R.register(qr)
|
||||
# clean up experiment when python program ends
|
||||
atexit.register(R.end_exp, recorder_status="FINISHED") # will not take effect if experiment ends
|
||||
signal.signal(signal.SIGINT, experiment_kill_signal_handler)
|
||||
sys.excepthook = experiment_exception_hook
|
||||
experiment_exit_handler()
|
||||
|
||||
|
||||
def _mount_nfs_uri(C):
|
||||
|
||||
Reference in New Issue
Block a user