Metadata-Version: 2.4
Name: ml2026-base
Version: 0.2.1
Summary: ML 量化策略训练框架层（功能基类 + 统一实现）
Author: ML2026 工作区
Project-URL: Homepage, https://pypi.org/project/ml2026-base/
Project-URL: Repository, https://gitee.com/frequently-mentioned/ml2026-base
Project-URL: Changelog, https://gitee.com/frequently-mentioned/ml2026-base/blob/master/CHANGELOG.md
Keywords: quant,backtest,framework,ml2026
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: torch>=2.0

# ml2026-base — ML 量化策略训练框架层

功能基类 + 统一实现，不含任何实例（业务）内容。
分发名 `ml2026-base`，导入名 `base`。

## 安装

```powershell
pip install ml2026-base
python -c "import base; print(base.__version__, base.__file__)"
```

本仓开发（editable）：

```powershell
pip install -e .
```

> 从旧包名 `base` 迁移时须先 `pip uninstall base`，否则旧 editable 安装的 `.pth` 查找器会遮蔽新包。
> 不要用 Gitee Release 直链安装：该站 WAF 会拦截 pip 的 User-Agent，恒返 403。

## 内容

- `step.py`：Step 统一规范（name + run(ctx)）
- `context.py`：Ctx 上下文键契约（TypedDict 文档化，仅静态提示）
- `data.py`：DataStep 基类（load_quote / load_base_info）
- `feature.py`：FeatureStep 基类（build + inspect_sample 抽查）、Samples（实例内部样本集容器）、SampleSet（跨项目数组字典形态）、SampleStore（npz 版本化样本仓库）
- `model.py`：ModelStep 基类（train_mode: retrain/continue/skip）、ModelStore（模型版本管理）
- `backtest.py`：BacktestStep 统一回测（加载模型参数 → make_predictor 预测 → 净盈亏 → 绩效）

## 测试

```powershell
python -m pytest tests/ -v
```

## 发布（维护者）

```powershell
python release.py                 # 校验 + 构建 + 产物自检 + 安装回归 + SHA256SUMS
python release.py --pypi          # 另：上传 PyPI（需 PYPI_TOKEN）
python release.py --gitee         # 另：创建 Gitee Release 归档（需 GITEE_TOKEN）
```

版本规则与完整发布流程见 `AGENTS.md`，变更记录见 `CHANGELOG.md`。
