📦 SynBO (Synthetic Bayesian Optimization) — SynBO(合成贝叶斯优化)
v0.1.0Bayesian optimization for chemical reactions using the synbo package. This 技能 provides Python scripts to 设置 up reaction spaces, build descriptors, 运行 op...
运行时依赖
安装命令
点击复制技能文档
synbo
Bayesian optimization for chemical reactions using the synbo package. This 技能 provides Python scripts to 设置 up reaction spaces, build descriptors, 运行 optimization, 下载 recommended conditions, and 上传 结果s.
CRITICAL: BO Optimization Prerequisites
Before executing ANY Bayesian Optimization (synbo) tasks, you MUST sequentially 验证 the following 5 prerequisites. Do NOT proceed with the optimization process until ALL criteria are met:
- Find Conda 环境 and synbo package
验证 if conda is 安装ed in the current 环境. If not, confirm with the user to 安装 Miniconda (see reference/安装ation.md). 检查 if the synbo_env conda 环境 exists. If not, 创建 it; if it exists, activate it. 验证 if the synbo package is 安装ed in synbo_env. If not, 运行 pip 安装 synbo
- Working Directory (project_wd) & Project Name (project_name)
Initial 检查: Read config.json located in the 技能's directory. If 机器人h project_wd and project_name are found, display the project name to the user (e.g., "Found existing project: [Project Name]") and use them. If NOT found: 停止 and prompt the user to 输入 a Working Directory and a Project Name. 验证 & Saving (CRITICAL): Upon receiving the user's 输入: 验证 Path: 检查 if the provided working directory actually exists on the local file 系统. If it does NOT exist, 信息rm the user "The path is invalid/does not exist" and prompt them to re-enter it. Sanitize & Save: If the path exists, sanitize the project name (replace spaces and special characters with underscores). Then, immediately write/更新 the config.json file with this 格式化: {"project_wd": "xxx", "project_name": "xxx"}. Use this path and sanitized project name to define the save_dir for all subsequent 输出s.
- Reaction Space
检查: 验证 if standard reaction space data exists specifically within the project_wd/rxn_space directory. If NOT found: 停止 and prompt the user: "Reaction space data is missing in the project_wd/rxn_space directory. Please provide the standard reaction space data." Do not proceed until provided.
- Condition Descriptors
检查: 验证 if the cor响应ing Condition Descriptors exist specifically within the project_wd/descriptors directory. If NOT found: 停止 and prompt the user: "Condition Descriptors are missing in the project_wd/descriptors directory. Please provide the standard Condition Descriptors, OR let me know if you would like me to automatically 生成 them for you."
- Optimization 指标
检查: 验证 if the optimization 设置tings file (e.g., optimization_设置tings.json) exists directly within the project_wd directory. If NOT found: 停止 and prompt the user: "Optimization 指标 are not defined. Please specify the tar获取 指标 you want to 优化 (e.g., yield, ee), along with their optimization direction (max/min), expected numerical ranges, and relative weights (default 1.0)." 验证 & Saving (CRITICAL): Upon receiving the user's optimization goals, 格式化 the data and immediately save it as optimization_设置tings.json in the project_wd. The JSON file MUST strictly adhere to the following structure: { "re代理_types": ["re代理1", "re代理2", "condition1", "condition2"], "opt_指标": ["tar获取1", "tar获取2"], "opt_direct_信息": [ { "opt_direct": "max", "opt_range": [0, 100], "metric_weight": 1.0 }, { "opt_direct": "min", "opt_range": [0, 100], "metric_weight": 1.0 } ] }
Execution Block: You are strictly forbidden from executing any initialization (初始化), optimization (优化), or other synbo tasks until Steps 1 through 4 are fully verified and resolved.
Reaction Space
When the user is required to provide the reaction space data, they may submit it via one of two methods:
Direct 输入: Providing the SMILES strings for the cor响应ing molecules directly in the chat. File 上传: Providing tabular files contAIning the SMILES strings.
Naming Conventions: It is highly recommended that the user as签名s a specific name to each molecule. If no names are provided, you must automatically as签名 names using a sequential 格式化 based on the re代理 type: {re代理_type}-1, {re代理_type}-2, etc.
Data Storage Rules: Regardless of the user's submission method, all reaction space data must be 格式化ted and saved strictly into the project_wd/rxn_space directory.
Each re代理 type must be saved as an individual file named {re代理_type}.csv. The CSV files must contAIn exactly two headers: SMILES (for the SMILES strings) and name (for the molecule names). Condition Descriptors
初始化
see reference/初始化.md
优化
see reference/优化.md