Skip to content

capwitf/My-MathModeling-skills / math-templates

math-templates

Verified

Use when 高教社杯/CUMCM mathematical modeling work needs lightweight reusable paper assets, national-prize style paragraph templates, section controls, per-question code/plot/test scaffolds, evidence registries, paper fragments, reproduction scripts, or safe reuse of prior contest project structure without copying old problem-specific content.

FileKindSize
SKILL.mdskill md6.8 KB
agents/openai.yamlconfig558 B
assets/contest-project-template/paper/fragments/fragment_protocol.mdmarkdown965 B
assets/contest-project-template/paper/paragraph_phrases_national.mdmarkdown4.8 KB
assets/contest-project-template/paper/problem_guide_template.mdmarkdown1.2 KB
assets/contest-project-template/paper/section_templates_national.mdmarkdown14.7 KB
assets/contest-project-template/problem_template/src/compute_template.pyscript2.5 KB
assets/contest-project-template/problem_template/src/plot_template.pyscript2.7 KB
assets/contest-project-template/problem_template/tests/test_pipeline_template.pyscript2.0 KB
assets/contest-project-template/project_manifest_template.mdmarkdown782 B
assets/contest-project-template/registries/figure_evidence.csvother294 B
assets/contest-project-template/registries/numerical_diagnostics.csvother104 B
assets/contest-project-template/registries/result_registry.csvother146 B
assets/contest-project-template/registries/run_record.csvother176 B
assets/contest-project-template/reproduce_all.pyscript615 B
references/asset-library-index.mdmarkdown3.6 KB
references/assumption-evaluation-controls.mdmarkdown5.5 KB
references/contest-language-guardrails.mdmarkdown3.2 KB
references/national-prize-style-profile.mdmarkdown2.1 KB
references/official-exemplar-notes.mdmarkdown1.6 KB
references/paragraph-flow.mdmarkdown3.1 KB
references/prior-contest-patterns.mdmarkdown1.8 KB
references/section-format-controls.mdmarkdown3.9 KB
references/template-usage.mdmarkdown3.6 KB

assets/contest-project-template/problem_template/tests/test_pipeline_template.py

View on GitHub
from __future__ import annotations

import sys
from pathlib import Path

import pandas as pd
import pytest


SRC_DIR = Path(__file__).resolve().parents[1] / "src"
if str(SRC_DIR) not in sys.path:
    sys.path.insert(0, str(SRC_DIR))

pytestmark = [
    pytest.mark.filterwarnings("ignore:.*parseString.*:DeprecationWarning"),
    pytest.mark.filterwarnings("ignore:.*resetCache.*:DeprecationWarning"),
    pytest.mark.filterwarnings("ignore:.*enablePackrat.*:DeprecationWarning"),
]


def test_compute_template_writes_summary(tmp_path: Path) -> None:
    from compute_template import run_compute

    data_dir = tmp_path / "q1" / "src" / "data"
    result_dir = tmp_path / "results" / "q1"
    data_dir.mkdir(parents=True)
    pd.DataFrame(
        [
            {"entity_id": "a", "value": 1.0},
            {"entity_id": "b", "value": 2.0},
        ]
    ).to_csv(data_dir / "input.csv", index=False, encoding="utf-8")

    result = run_compute(data_dir=data_dir, result_dir=result_dir, run_id="unit-q1")

    summary = pd.read_csv(result["summary_path"], encoding="utf-8-sig")
    assert summary.loc[0, "run_id"] == "unit-q1"
    assert summary.loc[0, "value"] == 3.0
    assert summary.loc[0, "validation_status"] == "computed"


def test_plot_template_writes_figure_and_plan(tmp_path: Path) -> None:
    from compute_template import run_compute
    from plot_template import run_plot

    data_dir = tmp_path / "q1" / "src" / "data"
    result_dir = tmp_path / "results" / "q1"
    data_dir.mkdir(parents=True)
    pd.DataFrame([{"entity_id": "a", "value": 1.0}]).to_csv(
        data_dir / "input.csv", index=False, encoding="utf-8"
    )

    run_compute(data_dir=data_dir, result_dir=result_dir, run_id="unit-q1")
    result = run_plot(result_dir=result_dir)

    assert result["figures"][0].stat().st_size > 0
    plan = pd.read_csv(result["figure_plan_path"], encoding="utf-8-sig")
    assert plan.loc[0, "figure_id"] == "q1_fig1_summary_bar"
    assert plan.loc[0, "validation_status"] == "generated"
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall