Skip to content

Commit 7123c36

Browse files
适配BaseDataSource,兼容Python3.12 (#17) (#18)
* 适配BaseDataSource,兼容Python3.12 * 修改install_requires --------- Co-authored-by: 周嘉俊 <[email protected]>
1 parent 62bd202 commit 7123c36

File tree

5 files changed

+658
-486
lines changed

5 files changed

+658
-486
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rqalpha>=5.3.5

rqalpha_mod_incremental/mod.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from rqalpha.utils.logger import system_log
2020
from rqalpha.interface import AbstractMod
21-
from rqalpha.const import PERSIST_MODE
21+
from rqalpha.const import PERSIST_MODE, DEFAULT_ACCOUNT_TYPE
2222
from rqalpha_mod_incremental.persist_providers import DiskPersistProvider
2323
from rqalpha.utils.i18n import gettext as _
2424
from rqalpha.data.base_data_source import BaseDataSource
@@ -46,7 +46,12 @@ def start_up(self, env, mod_config):
4646

4747
config = self._env.config
4848
if not env.data_source:
49-
env.set_data_source(BaseDataSource(config.base.data_bundle_path, getattr(config.base, "future_info", {})))
49+
env.set_data_source(BaseDataSource(
50+
config.base.data_bundle_path,
51+
getattr(config.base, "future_info", {}),
52+
DEFAULT_ACCOUNT_TYPE.FUTURE in env.config.base.accounts and env.config.base.futures_time_series_trading_parameters,
53+
env.config.base.end_date
54+
))
5055

5156
self._set_env_and_data_source()
5257

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[metadata]
77
name = rqalpha-mod-incremental
8-
version = 0.0.8
8+
version = 0.0.9
99

1010
[versioneer]
1111
VCS = git

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
package_data={'': ['*.*']},
3232
install_requires=[
3333
'pymongo',
34+
'rqalpha>=5.3.5'
3435
],
3536
zip_safe=False,
3637
)

0 commit comments

Comments
 (0)