-
Notifications
You must be signed in to change notification settings - Fork 687
[Tqsdk-Ci] Update Version 3.7.3 #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughWalkthrough此次更新主要涉及 Changes
Possibly related PRs
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Outside diff range and nitpick comments (2)
tqsdk/tradeable/__init__.py (1)
8-8
: 考虑添加__all__
来显式地公开 API。由于这是一个
__init__.py
文件,通常用于公开包的公共 API,因此静态分析工具提示的未使用导入可能是误报。为了使意图更加明确并消除静态分析警告,建议添加
__all__
变量来显式地列出要公开的类。例如:__all__ = ['TqAccount', 'TqZq', 'TqKq', 'TqKqStock', 'TqCtp', 'TqRohon', 'TqJees', 'TqYida']这样,其他模块在从此文件导入时,就可以清楚地知道哪些类是公开的 API。
Tools
Ruff
8-8:
tqsdk.tradeable.otg.TqAccount
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqZq
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqKq
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqKqStock
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqCtp
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqRohon
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqJees
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqYida
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
tqsdk/tradeable/otg/tqjees.py (1)
31-31
: 将 'Example1::' 修改为 'Example::' 以符合文档规范在第 31 行,文档中使用了
Example1::
,根据惯例,应该使用Example::
或Examples::
。应用以下 diff 修复:
- Example1:: + Example::
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (18)
- PKG-INFO (1 hunks)
- doc/advanced/for_vnpy_user.rst (2 hunks)
- doc/conf.py (1 hunks)
- doc/enterprise.rst (1 hunks)
- doc/reference/index.rst (1 hunks)
- doc/reference/tqsdk.tqjees.rst (1 hunks)
- doc/reference/tqsdk.tqyida.rst (1 hunks)
- doc/tqsdk_llm.rst (1 hunks)
- doc/version.rst (1 hunks)
- setup.py (1 hunks)
- tqsdk/init.py (1 hunks)
- tqsdk/version.py (1 hunks)
- tqsdk/api.py (3 hunks)
- tqsdk/multiaccount.py (2 hunks)
- tqsdk/tradeable/init.py (1 hunks)
- tqsdk/tradeable/otg/init.py (1 hunks)
- tqsdk/tradeable/otg/tqjees.py (1 hunks)
- tqsdk/tradeable/otg/tqyida.py (1 hunks)
Files skipped from review due to trivial changes (5)
- PKG-INFO
- doc/conf.py
- doc/tqsdk_llm.rst
- setup.py
- tqsdk/version.py
Additional context used
Ruff
tqsdk/__init__.py
7-7:
tqsdk.tradeable.TqAccount
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqZq
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqKq
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqKqStock
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqSim
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqSimStock
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqCtp
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqRohon
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqJees
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqYida
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
tqsdk/tradeable/__init__.py
8-8:
tqsdk.tradeable.otg.TqAccount
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqZq
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqKq
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqKqStock
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqCtp
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqRohon
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqJees
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
8-8:
tqsdk.tradeable.otg.TqYida
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
tqsdk/tradeable/otg/__init__.py
11-11:
tqsdk.tradeable.otg.tqjees.TqJees
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
12-12:
tqsdk.tradeable.otg.tqyida.TqYida
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
Additional comments not posted (26)
doc/reference/tqsdk.tqyida.rst (1)
1-7
: 文档结构正确,没有问题。这个新文件使用 reStructuredText 格式正确地记录了
TqYida
类。它包括:
- 一个用于交叉引用的标签
- 类的标题
- 使用
autoclass
指令自动生成类的文档:members:
选项包括所有公共成员的文档:inherited-members:
选项包括从基类继承的成员的文档doc/reference/tqsdk.tqjees.rst (1)
1-7
: 文档结构清晰,信息完整这个新文件以 reStructuredText 格式提供了
TqJees
类的文档。文件结构清晰,包括了以下要点:
- 为交叉引用提供了标签
- 标题明确说明了
TqJees
是用于杰宜斯资管交易的类- 使用
autoclass
指令自动生成类的文档- 使用
:members:
选项包括类的所有公共成员- 使用
:inherited-members:
选项包括从基类继承的成员总的来说,这个文档文件的结构和内容都很完整,可以为用户提供清晰的
TqJees
类的使用信息。tqsdk/tradeable/otg/__init__.py (1)
11-12
: LGTM!新增的导入语句没有问题。这个文件的目的似乎是汇总和重新导出
otg
包中的类。虽然静态分析工具标记这些导入为未使用,但它们很可能是误报。导入的类TqJees
和TqYida
可能在依赖此文件的代码库其他部分中使用。根据提供的更改列表,这些新的类导入扩展了从
otg
包中可用的类集合,但不会改变文件中任何现有的功能或逻辑。因此,这些更改是合理的。Tools
Ruff
11-11:
tqsdk.tradeable.otg.tqjees.TqJees
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
12-12:
tqsdk.tradeable.otg.tqyida.TqYida
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
doc/reference/index.rst (2)
16-16
: 文档更新正确添加新模块
tqsdk.tqjees
的文档引用是正确的做法,有助于提高新功能的可发现性。
17-17
: 文档更新正确添加新模块
tqsdk.tqyida
的文档引用是正确的做法,有助于提高新功能的可发现性。doc/enterprise.rst (5)
3-5
: 标题和描述的更改看起来不错!标题从 "TqSdk2 企业版" 改为 "TqSdk 企业版",反映了产品名称的变更。同时,对专业版和企业版之间差异的描述进行了简化,突出了企业版支持直连的关键区别。
7-9
: 版本差异的描述更加清晰简洁了!简化后的描述清楚地传达了两个版本之间的关键区别:企业版支持直连各种交易平台,而专业版依赖中继连接。同时,提及具体的交易平台(CTP/融航/杰宜斯)为企业版的直连功能提供了示例。
11-21
: 直连功能的描述更新很好!将 TqSdk2 重命名为 TqSdk 确保了文档的一致性。直连模式的优势得到了清晰的阐述,让用户了解其带来的好处。同时,更新了对类和方法的引用,确保文档与实际代码保持一致。
24-45
: 资管平台连接功能的描述更加简洁了!将该部分内容进行了整合,提供了连接资管平台功能的总体概述。移除了杰宜斯和融航平台的具体代码示例,使文档更加简洁,专注于总体概念。同时,更新了代码示例,确保与新的命名约定和参数保持一致。
1-45
: 整体更改使文档更加简洁清晰!这些更改简化了文档,专注于 TqSdk 企业版的核心功能。整个文档中的命名和描述保持了一致性,提高了文档的清晰度和可读性。总体而言,这些更改非常好,使文档更加易于理解和使用。
tqsdk/multiaccount.py (3)
11-11
: 看起来不错!导入语句已正确更新,以包含支持杰宜斯和易达交易平台的新类
TqJees
和TqYida
。这与总结中提到的更改一致。
30-30
: 构造函数签名更新正确
TqMultiAccount
类的构造函数的accounts
参数的类型提示已正确更新,以包含新类TqJees
和TqYida
。这与总结和之前的导入语句更新一致,扩展了构造函数可接受的账户类型列表。
35-35
: 文档字符串更新正确构造函数的文档字符串已正确更新,以反映
TqJees
和TqYida
被添加到可接受的账户类型列表中。更新后的文档正确地指出,可选的账户列表现在可以包括TqJees
和TqYida
。doc/version.rst (2)
5-8
: 没有问题,可以合并。新增的账户类型扩展了 TqSdk 的功能,release notes 格式正确,是一个不错的改进。
10-11
: 无需评论。这部分代码没有改动。
doc/advanced/for_vnpy_user.rst (3)
34-34
: 信息清晰明了!这一段简洁地说明了 TqSdk 为有直连期货公司交易需求的用户提供了
TqCtp
模块的支持。
261-262
: 非常好的新增内容!为 TqSdk 的新用户提供推荐学习步骤是很有帮助的。这个小节标题也很清晰。
264-268
: 很棒的补充说明!提供天勤 AI 助手的信息,并列出它可以提供的几类帮助,这对需要支持的用户来说非常有用。而且还附上了助手的聊天链接,方便用户直接咨询,非常贴心。
tqsdk/api.py (6)
75-75
: **** 导入新的交易接口类 TqJees 和 TqYida,本身没有问题。后续 review 中需要留意这两个类的使用情况。
85-85
: **** 将新增的交易接口类 TqJees 和 TqYida 添加到 UnionTradeable 类型定义中,修改是合理的,与导入新类相匹配。
124-124
: **** 在文档字符串中新增了对 TqJees 账户类型的使用说明,与代码修改同步,有助于使用者理解。
126-126
: **** 在文档字符串中新增了对 TqYida 账户类型的使用说明,与代码修改同步,有助于使用者理解。
129-129
: **** 在 account 参数的文档字符串中新增了 TqRohon 和 TqJees 账户类型,与代码修改同步,保持了文档和代码的一致性。
130-130
: **** 在 account 参数的文档字符串中新增了 TqYida 账户类型,与代码修改同步,保持了文档和代码的一致性。tqsdk/tradeable/otg/tqyida.py (1)
59-71
: 登录请求包构建正确
_send_login_pack
方法中,登录请求包的构建包含了所有必要的字段,逻辑清晰。tqsdk/tradeable/otg/tqjees.py (1)
11-75
: 代码整体良好,符合预期该类的实现逻辑清晰,方法定义正确,无明显问题。
@@ -4,7 +4,7 @@ | |||
name = "tqsdk" | |||
|
|||
from tqsdk.api import TqApi | |||
from tqsdk.tradeable import TqAccount, TqZq, TqKq, TqKqStock, TqSim, TqSimStock, TqCtp, TqRohon | |||
from tqsdk.tradeable import TqAccount, TqZq, TqKq, TqKqStock, TqSim, TqSimStock, TqCtp, TqRohon, TqJees, TqYida |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
考虑将导入的类添加到 __all__
中或删除未使用的导入。
静态分析工具指出,新导入的类 TqJees
和 TqYida
未被使用。如果这些类是公共 API 的一部分,请将它们添加到 __all__
列表中以抑制未使用的导入警告。如果它们不是公共 API 的一部分,请考虑从导入列表中删除它们。
Tools
Ruff
7-7:
tqsdk.tradeable.TqAccount
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqZq
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqKq
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqKqStock
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqSim
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqSimStock
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqCtp
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqRohon
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqJees
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
7-7:
tqsdk.tradeable.TqYida
imported but unused; consider removing, adding to__all__
, or using a redundant alias(F401)
@@ -0,0 +1,71 @@ | |||
#!usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shebang行有拼写错误
Shebang行缺少一个斜杠,应该为#!/usr/bin/env python3
。
请应用以下修改:
-#!usr/bin/env python3
+#!/usr/bin/env python3
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
#!usr/bin/env python3 | |
#!/usr/bin/env python3 |
self._account_id = account_id | ||
self._front_url = front_url | ||
self._app_id = app_id | ||
self._auth_code = auth_code | ||
super(TqYida, self).__init__(broker_id="", account_id=account_id, password=password, td_url="zqotg://127.0.0.1:0/trade") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
缺少对self._password
的赋值
在__init__
方法中,self._password
未被赋值,但在_send_login_pack
方法中被使用,可能会导致AttributeError
。
建议在__init__
方法中添加self._password
的赋值:
def __init__(self, account_id: str, password: str, front_url: str, app_id: str, auth_code: str) -> None:
...
self._account_id = account_id
self._front_url = front_url
self._app_id = app_id
self._auth_code = auth_code
+ self._password = password
super(TqYida, self).__init__(broker_id="", account_id=account_id, password=password, td_url="zqotg://127.0.0.1:0/trade")
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
self._account_id = account_id | |
self._front_url = front_url | |
self._app_id = app_id | |
self._auth_code = auth_code | |
super(TqYida, self).__init__(broker_id="", account_id=account_id, password=password, td_url="zqotg://127.0.0.1:0/trade") | |
self._account_id = account_id | |
self._front_url = front_url | |
self._app_id = app_id | |
self._auth_code = auth_code | |
self._password = password | |
super(TqYida, self).__init__(broker_id="", account_id=account_id, password=password, td_url="zqotg://127.0.0.1:0/trade") |
@@ -0,0 +1,75 @@ | |||
#!usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正 shebang 行中的路径错误
第 1 行的 shebang 行缺少斜杠,应为 #!/usr/bin/env python3
。
应用以下 diff 修正 shebang 行:
-#!usr/bin/env python3
+#!/usr/bin/env python3
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
#!usr/bin/env python3 | |
#!/usr/bin/env python3 |
self._account_id = account_id | ||
self._front_broker = front_broker | ||
self._front_url = front_url | ||
self._app_id = app_id | ||
self._auth_code = auth_code | ||
super(TqJees, self).__init__(broker_id="", account_id=account_id, password=password, td_url="zqotg://127.0.0.1:0/trade") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议在 __init__
方法中保存密码为实例变量
在 __init__
方法中,您未将 password
参数赋值给 self._password
,但在 _send_login_pack
方法中使用了 self._password
。建议在 __init__
方法中添加 self._password = password
,以确保密码正确传递。
应用以下 diff 修复:
self._auth_code = auth_code
+self._password = password
super(TqJees, self).__init__(broker_id="", account_id=account_id, password=password, td_url="zqotg://127.0.0.1:0/trade")
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
self._account_id = account_id | |
self._front_broker = front_broker | |
self._front_url = front_url | |
self._app_id = app_id | |
self._auth_code = auth_code | |
super(TqJees, self).__init__(broker_id="", account_id=account_id, password=password, td_url="zqotg://127.0.0.1:0/trade") | |
self._account_id = account_id | |
self._front_broker = front_broker | |
self._front_url = front_url | |
self._app_id = app_id | |
self._auth_code = auth_code | |
self._password = password | |
super(TqJees, self).__init__(broker_id="", account_id=account_id, password=password, td_url="zqotg://127.0.0.1:0/trade") |
Automated changes by create-pull-request GitHub action
Summary by CodeRabbit
新功能
TqJees
和TqYida
账户类型,支持杰宜斯和易达交易平台。TqCtp
模块的说明,增强了用户对直接连接交易服务的理解。文档更新