-
Notifications
You must be signed in to change notification settings - Fork 693
[Tqsdk-Ci] Update Version 3.8.2 #508
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
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthrough本次更新主要包括版本号从3.8.1提升至3.8.2,文档内容和格式的多项修订,新增了关于在Cursor AI代码编辑器中使用TqSdk的详细指南,修正了部分文档链接和引用,完善了Sphinx文档配置以支持Google Analytics,并对部分代码实现进行了小幅改动,如WebSocket连接处理函数增加了返回值、期权查询方法的参数校验范围扩展等。 Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant TqWebHelper
participant WebSocket
Client->>TqWebHelper: 发起WebSocket连接请求
TqWebHelper->>WebSocket: 建立连接
TqWebHelper->>Client: 发送初始数据
loop 消息处理
Client->>TqWebHelper: 发送消息
TqWebHelper->>Client: 响应消息
end
TqWebHelper-->>Client: 关闭连接并返回ws对象
Poem
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 0
🧹 Nitpick comments (1)
tqsdk/api.py (1)
3072-3084
: 统一错误提示中的参数名称
当前错误提示使用了exercise_date 参数
,但是该接口实际接收的参数名为nearbys
。建议将提示修改为:if underlying_symbol in ["SSE.000300", "SSE.000852", "SSE.000016"]: if any(i not in [0, 1, 2, 3, 4, 5] for i in nearbys): raise Exception(f"股指期权标的为:{underlying_symbol},nearbys 参数应在 [0, 1, 2, 3, 4, 5] 之间。") else: if any(i not in [0, 1, 2, 3] for i in nearbys): raise Exception(f"ETF 期权标的为:{underlying_symbol},nearbys 参数应在 [0, 1, 2, 3] 之间。")这样可保持文档、参数和错误提示的一致性。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
PKG-INFO
(1 hunks)doc/conf.py
(3 hunks)doc/demo/base.rst
(30 hunks)doc/index.rst
(1 hunks)doc/tq_trading_unit.rst
(4 hunks)doc/tqsdk_cursor.rst
(1 hunks)doc/usage/jupyter.rst
(1 hunks)doc/version.rst
(4 hunks)setup.py
(1 hunks)tqsdk/__version__.py
(1 hunks)tqsdk/api.py
(3 hunks)tqsdk/tqwebhelper.py
(1 hunks)
🔇 Additional comments (19)
tqsdk/tqwebhelper.py (1)
290-290
: 修复 WebSocket 处理器的返回值正确添加了
return ws
语句,这符合 aiohttp WebSocket 处理器的标准模式。之前缺少返回值可能会导致框架无法正确处理 WebSocket 响应对象。PKG-INFO (1)
3-3
: 版本号更新正确版本从 3.8.1 更新到 3.8.2,与项目的版本发布一致。
tqsdk/__version__.py (1)
1-1
:✅ Verification successful
版本字符串更新正确
版本号已正确更新为 '3.8.2',与其他文件中的版本信息保持一致。
运行以下脚本验证版本号在整个项目中的一致性:
🏁 Script executed:
#!/bin/bash # 描述:检查项目中所有版本号引用是否一致 # 预期:所有版本号都应该是 3.8.2 echo "检查版本号一致性:" echo "=== __version__.py ===" cat tqsdk/__version__.py echo "=== PKG-INFO ===" grep "^Version:" PKG-INFO echo "=== setup.py ===" rg -A 3 -B 3 "version.*=" setup.py echo "=== 其他可能的版本引用 ===" rg "3\.8\.[0-9]" --type py --type rst --type mdLength of output: 930
版本号一致性验证通过
项目中所有主要版本引用均已正确更新为 3.8.2:
tqsdk/version.py
PKG-INFO
setup.py
doc/conf.py
doc/version.rst 中保留了历史版本记录(3.8.2、3.8.1、3.8.0),无需修改。
doc/tq_trading_unit.rst 中的最低版本要求
>= 3.8.0
对于 3.8.2 依然适用,无需调整。✅ 批准合并。
doc/index.rst (1)
24-24
:✅ Verification successful
文档索引更新正确
在目录树中添加了
tqsdk_cursor.rst
,这应该是新增的 Cursor AI 代码编辑器使用指南。验证新添加的文档文件是否存在:
🏁 Script executed:
#!/bin/bash # 描述:检查新添加的文档文件是否存在 # 预期:tqsdk_cursor.rst 文件应该存在 echo "检查文档文件:" if [ -f "doc/tqsdk_cursor.rst" ]; then echo "✓ doc/tqsdk_cursor.rst 存在" echo "文件大小:$(wc -l < doc/tqsdk_cursor.rst) 行" else echo "✗ doc/tqsdk_cursor.rst 不存在" fi echo "" echo "检查是否有其他相关的 LLM 或 Cursor 文档:" fd -e rst . doc/ | grep -i -E "(llm|cursor|ai)"Length of output: 402
文档索引更新已验证
- 已确认
doc/tqsdk_cursor.rst
文件存在(178 行)- 原有的
doc/tqsdk_llm.rst
仍在,新增文档与现有 LLM 文档可并存
批准合并,无其他问题。setup.py (1)
11-11
: 版本号更新 已将版本号从3.8.1更新至3.8.2,与__version__.py
、doc/conf.py
等保持一致,符合发布流程。doc/tq_trading_unit.rst (1)
8-8
: 统一格式调整:标题下划线 已将各段落标题的下划线长度调整为与标题文本长度一致,保持文档格式统一。Also applies to: 81-81, 93-93, 106-106, 113-113
doc/usage/jupyter.rst (1)
28-29
: 修复链接格式 已移除冗余冒号和空格,修正为正确的 reST 链接语法,确保文档引用链接准确可用。doc/demo/base.rst (1)
4-4
: 统一格式调整:标题下划线 已将演示文档中所有标题的下划线长度统一为与标题文本长度一致,提升可读性和一致性。Also applies to: 12-12, 21-21, 30-30, 39-39, 48-48, 57-57, 66-66, 74-74, 82-82, 89-89, 96-96, 103-103, 110-110, 117-117, 124-124, 131-131, 138-138, 145-145, 152-152, 159-159, 165-165, 173-173, 180-180, 187-187, 194-194, 201-201, 208-208
tqsdk/api.py (2)
870-871
: 在示例中显式导入datetime
以避免运行错误
添加from datetime import datetime
导入,使示例能正确识别datetime
类型,确保示例代码可运行。
942-943
: 在示例中显式导入datetime
以避免运行错误
添加from datetime import datetime
导入,使示例能正确识别datetime
类型,确保示例代码可运行。doc/version.rst (1)
5-10
: 版本变更日志条目格式正确新增的3.8.2版本条目格式规范,内容简洁明了,符合项目的变更日志标准。修复内容和文档改进的描述都很清晰。
doc/conf.py (3)
17-17
: 正确添加Google Analytics扩展在extensions列表中正确添加了
sphinxcontrib.googleanalytics
扩展,这将为文档站点提供访问分析功能。
51-53
: 版本号更新一致版本号从3.8.1正确更新为3.8.2,与其他文件中的版本更新保持一致。
82-84
: Google Analytics配置合理Google Analytics的配置设置合理:
- 使用了GA4格式的跟踪ID (
G-9SPL7ERCMF
)- 默认启用分析功能
- 配置简洁明了
doc/tqsdk_cursor.rst (5)
1-36
: 优秀的文档概述和介绍部分文档开头部分内容全面且结构清晰:
- 明确说明了文档目的和适用对象
- 对Cursor的介绍准确且有针对性
- 详细列出了在TqSdk开发中使用Cursor的具体好处
- 内容组织逻辑性强,便于用户理解
37-77
: 实用的安装和配置指南安装和初始配置部分提供了清晰的步骤指导:
- 安装步骤简明扼要
- 包含了重要的配置建议(如推荐购买会员)
- Python环境配置说明详细实用
- 验证安装的命令很有帮助
78-108
: 极佳的源码集成建议将TqSdk源码添加到工作区的建议非常有价值:
- 强调了这种做法的重要性
- 提供了两种获取源码的方法,适应不同用户需求
- 详细说明了操作步骤
- 清楚阐释了这样做的技术优势
这是一个非常实用的最佳实践建议。
109-173
: 全面的AI交互指南文档的核心部分内容丰富且实用:
- 提供了具体的使用快捷键和操作方法
- 包含了大量实际的提问示例,覆盖不同使用场景
- 调试指导简洁实用
- 高效提问技巧部分很有价值,能帮助用户更好地利用AI功能
174-179
: 恰当的总结部分文档结尾总结恰当:
- 重申了Cursor对TqSdk开发的价值
- 鼓励用户积极使用关键功能
- 语调积极正面,有助于用户采用
Automated changes by create-pull-request GitHub action
Summary by CodeRabbit