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

Add reset_default_uri func for R and expm

This commit is contained in:
D-X-Y
2021-03-06 05:33:08 -08:00
parent 49697b1f15
commit 91fd53ab4d
3 changed files with 18 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
# Licensed under the MIT License.
from contextlib import contextmanager
from typing import Text, Optional
from .expm import MLflowExpManager
from .exp import Experiment
from .recorder import Recorder
@@ -20,7 +21,9 @@ class QlibRecorder:
return "{name}(manager={manager})".format(name=self.__class__.__name__, manager=self.exp_manager)
@contextmanager
def start(self, experiment_name=None, recorder_name=None, uri=None):
def start(
self, experiment_name: Optional[Text] = None, recorder_name: Optional[Text] = None, uri: Optional[Text] = None
):
"""
Method to start an experiment. This method can only be called within a Python's `with` statement. Here is the example code:
@@ -282,6 +285,12 @@ class QlibRecorder:
"""
return self.exp_manager.uri
def reset_default_uri(self, uri: Text):
"""
Method to reset the default uri of current experiment manager.
"""
self.exp_manager.reset_default_uri(uri)
def get_recorder(self, recorder_id=None, recorder_name=None, experiment_name=None):
"""
Method for retrieving a recorder.