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_v6_generation_scope.py64 linesDownload Raw Back to tests
1"""databasev6 §21:v6 Generation Scope contract 测试。2 3- plan 不含 area(frozen)/ set_relation(removed)4- REGISTRY 不再注册 set_relation/upset5- assert_v6_plan_scope 对注入 area/set_relation 的行抛错6- effective quota 总样本量精确 = target_n7"""8 9from __future__ import annotations10 11import pytest12 13from databasev1.generation_plan import (14    GenerationPlanRow,15    assert_v6_plan_scope,16    build_plan,17    scope_quota_v6,18    load_yaml,19)20from databasev1 import constants as C21from databasev1.recipes import REGISTRY22 23 24@pytest.mark.parametrize("target_n", [100, 5000, 40000])25def test_plan_has_no_area_or_set_relation(target_n):26    rows = build_plan(target_n=target_n)27    assert len(rows) == target_n28    assert not any(r.chart_family == "area" for r in rows)29    assert not any(r.chart_family == "matrix" for r in rows)30    assert not any(r.chart_family == "set_relation" for r in rows)31    assert_v6_plan_scope(rows)32 33 34def test_set_relation_removed_from_registry():35    assert not any(f == "set_relation" for f, _ in REGISTRY)36    assert not any(s == "upset" for _, s in REGISTRY)37    assert ("area", "area") in REGISTRY  # 源码保留,仅冻结生成38    assert ("matrix", "heatmap") in REGISTRY  # matrix 同 area:源码保留,冻结生成39 40 41def test_scope_quota_exact_total_and_provenance():42    qcfg = load_yaml(C.QUOTA_CONFIG_PATH)43    for n in (100, 1000, 40000):44        scoped = scope_quota_v6(qcfg, n)45        assert sum(s["total"] for s in scoped["families"].values()) == n46        assert "area" not in scoped["families"]47        assert "matrix" not in scoped["families"]48        assert "set_relation" not in scoped["families"]49        assert scoped["scope"]["frozen_families"] == ["area", "matrix"]50        assert scoped["scope"]["removed_families"] == ["set_relation"]51 52 53def test_assert_v6_plan_scope_raises_on_injection():54    def _row(fam):55        return GenerationPlanRow(56            sample_id="t", global_seed=1, sample_seed=1, chart_family=fam,57            chart_subtype="x", layout_type="single", difficulty="simple",58            style_group="scientific_default", parameter_group="p",59            template_group="t", recipe_id="x/x", shard_id=0, param_variant="")60 61    for fam in ("area", "matrix", "set_relation"):62        with pytest.raises(AssertionError):63            assert_v6_plan_scope([_row(fam)])64 
ZZoutian/figure2data-database-v2 · Team Ai