Metadata-Version: 2.4
Name: kaiwu
Version: 1.4.0
Summary: Kaiwu SDK for CIM or QUBO.
Author: Qboson Inc
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy==2.2.6
Requires-Dist: pandas==2.2.3
Requires-Dist: requests==2.32.3
Requires-Dist: pyjwt[crypto]==2.10.1
Requires-Dist: portion==2.6.1
Requires-Dist: Deprecated==1.2.18
Requires-Dist: matplotlib==3.10.3
Requires-Dist: httpx==0.28.1
Requires-Dist: nest-asyncio==1.6.0
Requires-Dist: kaiwu-community==1.0.6
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Kaiwu SDK
* 企业发布版本，需要到开发者平台注册账号获取授权后使用

## SDK使用教程

### 目录结构

* 源码位于[kaiwu](src%2Fcom%2Fqboson%2Fkaiwu)

### 发版流程，SDK和文档版本独立管理
* SDK版本号形如v1.0.0，并打v1.0.0的tag以作记录
* 每次新版内容都需要更新 [CHANGELOG.md](CHANGELOG.md)
* 文档版本号形如：1.0.0-doc, 如果仅更新文档，基于tag进行更新，更新后重新生成一个相同tag用于文档发布

### 环境依赖

* Python3.8 <https://www.python.org/downloads/release/python-3810/> .
* pip3 install -i https://mirrors.aliyun.com/pypi/simple -r requirements/devel.txt

### 构建whl
* 生成的发布文件位于 `dist` 目录下，可直接用于 PyPI 上传或 `pip` 安装
* `python setup.py sdist bdist_wheel`

### 二进制编译
* 对代码进行二进制编译达到加密的效果
* `python build.py build_ext --inplace`

### 安装说明
* 使用上面构建的 whl 文件进行安装，例如：`pip install dist/kaiwu-1.4.0-py3-none-any.whl`
* 直接将 [kaiwu](src%2Fcom%2Fqboson%2Fkaiwu) 目录拷贝到项目根路径下

### 日志使用说明
* SDK默认日志输出级别为warning，如果需要更多日志内容可以自行调整日志输出级别

```python
import numpy as np
import kaiwu as kw

if __name__ == '__main__':
    # 调整日志级别, 默认INFO
    kw.common.set_log_level("DEBUG")
    matrix = -np.array(
        [[0., 1., 0., 1., 1.],
         [1., 0., 0., 1., 1.],
         [0., 0., 0., 1., 1.],
         [1., 1., 1., 0., 1.],
         [1., 1., 1., 1., 0.]])

    worker = kw.classical.SimulatedAnnealingOptimizer(initial_temperature=100,
                                                      alpha=0.99,
                                                      cutoff_temperature=0.001,
                                                      iterations_per_t=10,
                                                      size_limit=10)
    worker.solve(matrix)
```


## SDK文档部署说明

### 文档地址

* kaiwu pre文档：
    * 中文：http://10.3.147.155:90/zh/
    * 英文：http://10.3.147.155:90/en/

* kaiwu prod文档：
    * 中文：https://kaiwu-sdk-docs.qboson.com/zh/
    * 英文：https://kaiwu-sdk-docs.qboson.com/en/

* kaiwu 海外版文档：
    * https://cpqc-docs.qboson.com/en/ 

### 生成文档

#### 新版本迭代步骤：
1. 建立新分支，分支名形如：v1.1.2
2. 修改 `common/config.py` 与 `setup.py` 中的版本号，使其与待发布版本保持一致
3. 修改预发布环境版本配置文件：http://10.3.147.155:90/_static/switcher_en.json 和 http://10.3.147.155:90/_static/switcher_en.json
4. 修改生产环境版本配置文件：https://kaiwu-sdk-docs.qboson.com/_static/switcher_en.json 和 https://kaiwu-sdk-docs.qboson.com/_static/switcher_en.json
5. 如果修复某个版本文档的bug，比如修复v1.1.2版本的文档，需要在v1.1.2分支上进行修复，要不要合并到main分支，由文档维护者决定

#### 本地生成文档命令

```bash
# SDK使用sphinx构建文档，执行命令如下
cd docs
make html
```

### 国际化
```bash
cd docs
# 将可翻译的消息提取到pot文件中
make gettext
# 生成po文件，并翻译
sphinx-intl update -p _build/gettext -l zh -l en
```

## SDK版本清单
* kaiwu_dev main分支
* kaiwu_dev 交付客户版本见tag
* Kaiwu SDK 企业发布版，带license
