diff --git a/docs/conf.py b/docs/conf.py index f1377c140..7c638e736 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,7 +21,7 @@ import os import sys -import pkg_resources +from importlib.metadata import version as ver # -- General configuration ------------------------------------------------ @@ -63,9 +63,9 @@ author = "Microsoft" # built documents. # # The short X.Y version. -version = pkg_resources.get_distribution("pyqlib").version +version = ver("pyqlib") # The full version, including alpha/beta/rc tags. -release = pkg_resources.get_distribution("pyqlib").version +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/qlib/workflow/record_temp.py b/qlib/workflow/record_temp.py index 844914d46..79c4a78f8 100644 --- a/qlib/workflow/record_temp.py +++ b/qlib/workflow/record_temp.py @@ -476,7 +476,13 @@ class PortAnaRecord(ACRecordTemp): if self.backtest_config["start_time"] is None: self.backtest_config["start_time"] = dt_values.min() if self.backtest_config["end_time"] is None: - self.backtest_config["end_time"] = get_date_by_shift(dt_values.max(), 1) + self.backtest_config["end_time"] = get_date_by_shift(dt_values.max(), -1) + warnings.warn( + "No explicit backtest end_time provided. " + "Qlib requires one extra calendar step to determine the right boundary of a bar. " + "Therefore the end_time is shifted backward by one trading day from " + f"{dt_values.max()} -> {self.backtest_config['end_time']}." + ) artifact_objects = {} # custom strategy and get backtest