Team Ai
Datasetpublic

ZZoutian/figure2data-database-v2

figure2data databasev2 — 40K v6 合成科研图表数据集(最终交付版) 生成日期:2026-09-17 生成器:generator 1.6.0 / dataset_generation_revision v6(含两次 hotfix) 规模:40,000 样本(10 图族 / 33 亚型;area、matrix 冻结不生成,set_relation 已删除) 目录结构 databasev2/ ├── figure2data.sqlite3 # 主数据库(2.0 GB:40,000 samples / 280,000 documents) ├── schema/ # sqlite schema ├── shards/ # 数据资产(shard = (样本序号-1)//1000) │ └── shard_000 .. shard_039/ │ ├── images/ # PNG… See the full description on the dataset page: https://huggingface.co/datasets/ZZoutian/figure2data-database-v2.

sourceHugging Faceupdated 24d agoView on Hugging Face
0likes6.3kdownloads
test_release_gate.py51 linesDownload Raw Back to tests
1"""database_yh §14.2 test_release_gate:release.eligible 只能由门禁计算(§15)。"""2 3from __future__ import annotations4 5from databasev1.adapter.quality import HARD_CONTRACTS, release_gate6 7 8def _auto(status="passed", **overrides):9    checks = {k: True for k in HARD_CONTRACTS}10    checks.update({"mixed_domain": None, "inset_transform": None,11                   "data_pixel_calibration": True, "render_roundtrip": True})12    checks.update(overrides)13    return {"checks": checks, "status": status, "metrics": {}}14 15 16def test_gate_requires_human_pass():17    g = release_gate(_auto(), {"status": "pending"})18    assert g["eligible"] is False and g["auto_passed"] is True and g["human_passed"] is False19 20 21def test_gate_requires_auto_pass():22    g = release_gate(_auto(status="failed"), {"status": "passed"})23    assert g["eligible"] is False24 25 26def test_gate_requires_hard_contracts():27    g = release_gate(_auto(bounds=False), {"status": "passed"})28    assert g["eligible"] is False and g["hard_contracts_passed"] is False29 30 31def test_gate_all_pass():32    g = release_gate(_auto(), {"status": "passed"})33    assert g["eligible"] is True34 35 36def test_gate_conditional_contract_failure_blocks():37    g = release_gate(_auto(mixed_domain=False), {"status": "passed"})38    assert g["eligible"] is False39 40 41def test_generated_quality_doc_uses_gate(make_docs):42    """生成期 quality 文档:硬契约 checks 齐全 + eligible 由门禁计算(human pending → False)。"""43    docs, _ = make_docs("curve", "single_line", seed=47)44    q = docs["quality"]45    for k in HARD_CONTRACTS:46        assert q["automatic"]["checks"].get(k) is True, f"生成期硬契约 {k} 未通过"47    assert q["human"]["status"] == "pending"48    expected = release_gate(q["automatic"], q["human"])49    assert q["release"] == expected50    assert q["release"]["eligible"] is False  # 人工未审 → 不可发布(§15.1)51 
ZZoutian/figure2data-database-v2 · Team Ai