Files
MCM-ICM_Toolkit/src/mcm_toolkit/__init__.py
T
guzhujushi 5319589dfd chore: 初始化 MCM/ICM Toolkit 仓库骨架
审查并精简 ChatGPT 的建库建议后落地的第一版骨架,只定接口不写实现。

- 建议审查:14 个包 → 7 个;约 250 个函数 → 约 40 个;5 个 Result 类 → 1 个
  (docs/01-suggestion-review.md)
- docs/:架构、路线图(含永久不做清单)、环境、Git 工作流、函数卡片模板
- src/mcm_toolkit/:core / data / stats / models / solve / decision / viz
  共 23 个模块,均为签名 + docstring + NotImplementedError
- tests/:9 个文件,其中 test_api_surface.py 已通过(20 passed)
- examples/ problems/ notebooks/ figures/ tables/ 骨架
- pyproject.toml(核心依赖 4 个 + 6 组 extras)、environment.yml
- scripts/:setup-venv.ps1(ASCII + LF)、setup-conda.ps1、doctor.ps1
- 环境:.venv(system-site-packages)与 conda 环境 mcm-toolkit 均已建好,
  数值栈版本与 base 完全对齐(numpy 2.4.6 / scipy 1.18.1 / pandas 3.0.6,MKL 后端)
2026-10-01 17:43:48 +08:00

55 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""mcm_toolkit —— MCM/ICM 竞赛层工具箱。
设计原则见 docs/02-architecture.md:
* 薄封装优先:能一行转发 SciPy / sklearn / statsmodels / NetworkX / SALib 的,就不自己写。
* 自己实现是有目的的:只写"库里没有、或自己写才学得会"的算法。
* 统一出口:拟合 / 求解 / 模拟 / 评价类函数一律返回 :class:`Result`。
* 可复现:含随机的函数都接受 `random_state`。
顶层只导出子包与 6 个高频快捷函数,不做 `import *`,避免污染命名空间。
"""
from __future__ import annotations
# 子包:按 `import mcm_toolkit as mcm` 之后 `mcm.stats.xxx` 使用
from . import (
core, # noqa: F401
data, # noqa: F401
decision, # noqa: F401
models, # noqa: F401
solve, # noqa: F401
stats, # noqa: F401
viz, # noqa: F401
)
from ._version import __version__
# 高频快捷函数:比赛时最常用的几个,允许 `mcm.monte_carlo(...)` 直接用
from .core import Result, get_rng, set_seed # noqa: F401
from .decision import topsis # noqa: F401
from .models import compare_models # noqa: F401
from .solve import monte_carlo, parameter_sweep # noqa: F401
from .stats import bootstrap_ci # noqa: F401
# 公开 API 清单(不是"导出按钮",只列对外承诺稳定的名字)
__all__ = [
"__version__",
# 子包
"core",
"data",
"stats",
"models",
"solve",
"decision",
"viz",
# 快捷函数
"Result",
"get_rng",
"set_seed",
"bootstrap_ci",
"compare_models",
"monte_carlo",
"parameter_sweep",
"topsis",
]