1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-05 12:00:58 +08:00

Fix C.provider_uri

This commit is contained in:
zhupr
2020-09-30 16:10:28 +08:00
committed by you-n-g
parent 9637dc540e
commit 1f23eb9a30
2 changed files with 7 additions and 3 deletions

View File

@@ -459,7 +459,7 @@ class DatasetProvider(object):
return data
@staticmethod
def expression_calculator(inst, start_time, end_time, freq, column_names, spans=None, C=None):
def expression_calculator(inst, start_time, end_time, freq, column_names, spans=None, g_config=None):
"""
Calculate the expressions for one instrument, return a df result.
If the expression has been calculated before, load from cache.
@@ -467,6 +467,9 @@ class DatasetProvider(object):
return value: A data frame with index 'datetime' and other data columns.
"""
# FIXME: Windows OS or MacOS using spawn: https://docs.python.org/3.8/library/multiprocessing.html?highlight=spawn#contexts-and-start-methods
global C
C = g_config
# NOTE: This place is compatible with windows, windows multi-process is spawn
if getattr(ExpressionD, "_provider", None) is None:
register_all_wrappers()