Skip to content

Commit

Permalink
Update Version 3.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shinny-pack authored and shinny-mayanqiong committed Jul 12, 2023
1 parent c91522b commit bcd03a8
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: tqsdk
Version: 3.4.3
Version: 3.4.4
Summary: TianQin SDK
Home-page: https://www.shinnytech.com/tqsdk
Author: TianQin
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = u'3.4.3'
version = u'3.4.4'
# The full version, including alpha/beta/rc tags.
release = u'3.4.3'
release = u'3.4.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 5 additions & 0 deletions doc/version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

版本变更
=============================
3.4.4 (2023/07/12)

* 修复: 升级 numpy 后,tafunc.barlast 报错的问题


3.4.3 (2023/07/06)

* 增加: 支持获取 CSI 指数行情
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='tqsdk',
version="3.4.3",
version="3.4.4",
description='TianQin SDK',
author='TianQin',
author_email='[email protected]',
Expand Down
2 changes: 1 addition & 1 deletion tqsdk/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.4.3'
__version__ = '3.4.4'
26 changes: 13 additions & 13 deletions tqsdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3349,18 +3349,18 @@ def _update_serial_single(self, serial):
array[0:serial["width"] - shift] = array[shift:serial["width"]]
for ext in serial["extra_array"].values():
ext[0:serial["width"] - shift] = ext[shift:serial["width"]]
if np.issubdtype(ext.dtype, np.floating):
if np.issubdtype(ext.dtype, np.timedelta64):
ext[serial["width"] - shift:] = np.timedelta64('nat')
elif np.issubdtype(ext.dtype, np.integer):
ext[serial["width"] - shift:] = 0
elif np.issubdtype(ext.dtype, np.floating):
ext[serial["width"] - shift:] = np.nan
elif np.issubdtype(ext.dtype, np.object_):
ext[serial["width"] - shift:] = None
elif np.issubdtype(ext.dtype, np.integer):
ext[serial["width"] - shift:] = 0
elif np.issubdtype(ext.dtype, np.bool_):
ext[serial["width"] - shift:] = False
elif np.issubdtype(ext.dtype, np.datetime64):
ext[serial["width"] - shift:] = np.datetime64('nat')
elif np.issubdtype(ext.dtype, np.timedelta64):
ext[serial["width"] - shift:] = np.timedelta64('nat')
else:
ext[serial["width"] - shift:] = np.nan
serial["update_row"] = max(serial["width"] - shift - 1, 0)
Expand Down Expand Up @@ -3505,18 +3505,18 @@ def _update_serial_multi(self, serial):
remain = max(2 * serial["width"] - 1 - new_data_index, 0)
for ext in serial["extra_array"].values():
ext[:remain] = ext[serial["width"] - remain:]
if ext.dtype == np.float:
if np.issubdtype(ext.dtype, np.timedelta64):
ext[remain:] = np.timedelta64('nat')
elif np.issubdtype(ext.dtype, np.integer):
ext[remain:] = 0
elif np.issubdtype(ext.dtype, np.floating):
ext[remain:] = np.nan
elif ext.dtype == np.object:
elif np.issubdtype(ext.dtype, np.object_):
ext[remain:] = None
elif ext.dtype == np.int:
ext[remain:] = 0
elif ext.dtype == np.bool:
elif np.issubdtype(ext.dtype, np.bool_):
ext[remain:] = False
elif ext.dtype == np.datetime64:
elif np.issubdtype(ext.dtype, np.datetime64):
ext[remain:] = np.datetime64('nat')
elif ext.dtype == np.timedelta64:
ext[remain:] = np.timedelta64('nat')
else:
ext[remain:] = np.nan

Expand Down
2 changes: 1 addition & 1 deletion tqsdk/tafunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ def barlast(cond):
"""
cond = cond.to_numpy()
v = np.array(~cond, dtype=np.int)
v = np.array(~cond, dtype=int)
c = np.cumsum(v)
x = c[cond]
d = np.diff(np.concatenate(([0], x)))
Expand Down

0 comments on commit bcd03a8

Please sign in to comment.