mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-15 00:36:55 +08:00
Update workflow logging
This commit is contained in:
@@ -17,9 +17,9 @@ class MetaLogger(type):
|
|||||||
super().__init__(name, bases, dic)
|
super().__init__(name, bases, dic)
|
||||||
|
|
||||||
def __new__(cls, name, bases, dict):
|
def __new__(cls, name, bases, dict):
|
||||||
wrapper_dict = type(logging.getLogger("module_name")).__dict__.copy()
|
wrapper_dict = type(logging.getLogger("MetaLogger")).__dict__.copy()
|
||||||
wrapper_dict.update(dict)
|
wrapper_dict.update(dict)
|
||||||
wrapper_dict["__doc__"] = logging.getLogger("module_name").__doc__
|
wrapper_dict["__doc__"] = logging.getLogger("MetaLogger").__doc__
|
||||||
return type.__new__(cls, name, bases, wrapper_dict)
|
return type.__new__(cls, name, bases, wrapper_dict)
|
||||||
|
|
||||||
def __call__(cls, *args, **kwargs):
|
def __call__(cls, *args, **kwargs):
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
# Copyright (c) Microsoft Corporation.
|
# Copyright (c) Microsoft Corporation.
|
||||||
# Licensed under the MIT License.
|
# Licensed under the MIT License.
|
||||||
|
|
||||||
import mlflow
|
import mlflow, logging
|
||||||
from mlflow.entities import ViewType
|
from mlflow.entities import ViewType
|
||||||
from mlflow.exceptions import MlflowException
|
from mlflow.exceptions import MlflowException
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from .recorder import Recorder, MLflowRecorder
|
from .recorder import Recorder, MLflowRecorder
|
||||||
from ..log import get_module_logger
|
from ..log import get_module_logger
|
||||||
|
|
||||||
logger = get_module_logger("workflow", "INFO")
|
logger = get_module_logger("workflow", logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
class Experiment:
|
class Experiment:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import mlflow
|
import mlflow
|
||||||
from mlflow.exceptions import MlflowException
|
from mlflow.exceptions import MlflowException
|
||||||
from mlflow.entities import ViewType
|
from mlflow.entities import ViewType
|
||||||
import os
|
import os, logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from typing import Optional, Text
|
from typing import Optional, Text
|
||||||
@@ -14,7 +14,7 @@ from ..config import C
|
|||||||
from .recorder import Recorder
|
from .recorder import Recorder
|
||||||
from ..log import get_module_logger
|
from ..log import get_module_logger
|
||||||
|
|
||||||
logger = get_module_logger("workflow", "INFO")
|
logger = get_module_logger("workflow", logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
class ExpManager:
|
class ExpManager:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Copyright (c) Microsoft Corporation.
|
# Copyright (c) Microsoft Corporation.
|
||||||
# Licensed under the MIT License.
|
# Licensed under the MIT License.
|
||||||
|
|
||||||
import re
|
import re, logging
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
@@ -16,7 +16,7 @@ from ..utils import flatten_dict
|
|||||||
from ..contrib.eva.alpha import calc_ic, calc_long_short_return, calc_long_short_prec
|
from ..contrib.eva.alpha import calc_ic, calc_long_short_return, calc_long_short_prec
|
||||||
from ..contrib.strategy.strategy import BaseStrategy
|
from ..contrib.strategy.strategy import BaseStrategy
|
||||||
|
|
||||||
logger = get_module_logger("workflow", "INFO")
|
logger = get_module_logger("workflow", logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
class RecordTemp:
|
class RecordTemp:
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
# Copyright (c) Microsoft Corporation.
|
# Copyright (c) Microsoft Corporation.
|
||||||
# Licensed under the MIT License.
|
# Licensed under the MIT License.
|
||||||
|
|
||||||
import mlflow
|
import mlflow, logging
|
||||||
import shutil, os, pickle, tempfile, codecs, pickle
|
import shutil, os, pickle, tempfile, codecs, pickle
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from ..utils.objm import FileManager
|
from ..utils.objm import FileManager
|
||||||
from ..log import get_module_logger
|
from ..log import get_module_logger
|
||||||
|
|
||||||
logger = get_module_logger("workflow", "INFO")
|
logger = get_module_logger("workflow", logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
class Recorder:
|
class Recorder:
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Copyright (c) Microsoft Corporation.
|
# Copyright (c) Microsoft Corporation.
|
||||||
# Licensed under the MIT License.
|
# Licensed under the MIT License.
|
||||||
|
|
||||||
import sys, traceback, signal, atexit
|
import sys, traceback, signal, atexit, logging
|
||||||
from . import R
|
from . import R
|
||||||
from .recorder import Recorder
|
from .recorder import Recorder
|
||||||
from ..log import get_module_logger
|
from ..log import get_module_logger
|
||||||
|
|
||||||
logger = get_module_logger("workflow", "INFO")
|
logger = get_module_logger("workflow", logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
# function to handle the experiment when unusual program ending occurs
|
# function to handle the experiment when unusual program ending occurs
|
||||||
|
|||||||
Reference in New Issue
Block a user