///|
pub fn demo_qrels_source() -> String {
  let source =
    #|q1	d1	3
    #|q1	d2	2
    #|q1	d3	0
    #|q2	d7	1
    #|q2	d8	1
    #|
  source
}

///|
pub fn demo_run_source() -> String {
  let source =
    #|q1	d3	0.95
    #|q1	d2	0.90
    #|q1	d9	0.40
    #|q1	d1	0.30
    #|q2	d8	0.80
    #|q2	d5	0.60
    #|q2	d7	0.55
    #|
  source
}

///|
pub fn demo_pool_source() -> String {
  let source =
    #|q1	d3
    #|q1	d2
    #|q1	d9
    #|q1	d1
    #|q2	d8
    #|q2	d5
    #|q2	d7
    #|
  source
}

///|
pub fn demo_fixture() -> BenchmarkCase {
  BenchmarkCase::new(
    name="demo",
    qrels=parse_qrels_tsv(demo_qrels_source()).unwrap(),
    run=parse_run_tsv(demo_run_source()).unwrap(),
  )
}

///|
pub fn demo_fixture_pools() -> Array[CandidatePool] {
  parse_candidate_pool_tsv(demo_pool_source()).unwrap()
}

///|
pub fn demo_report() -> BenchmarkReport {
  evaluate_benchmark(
    demo_fixture().qrels,
    demo_fixture().run,
    config=EvalConfig::new(cutoffs=[1, 3, 5], gain_scheme=GainScheme::exp2()),
  )
}

///|
pub fn demo_bundle() -> String {
  export_bundle(demo_fixture(), cutoffs=[1, 3, 5])
}

///|
pub fn demo_validation() -> ValidationSummary {
  validate_dataset(demo_fixture().qrels, demo_fixture().run)
}