File size: 1,441 Bytes
33d7314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[module]
name = "pubtime"
title = "Publication likelihood and timeliness"
runtime = "python"
entrypoint = "modules.pubtime:summarize_from_archive"
imported_source = "modules/pubtime"

[dependencies]
required = ["pandas>=2.0"]
optional = ["lifelines>=0.30"]

[parity]
reference_language = "R"
reference_scripts = [
    "modules/pubtime/analysis_Code/Cancer_code/0924_cancer analysis.Rmd",
    "modules/pubtime/analysis_Code/Covid_code/0924_covid analysis.Rmd",
    "modules/pubtime/analysis_Code/CVD_code/0924_cvd_analysis.Rmd",
]
cox_model_status = "not-translated"
data_prep_status = "verified-against-R"
parity_harness = "tests/test_pubtime_r_parity.py"
parity_report = "docs/ai/pubtime_parity.md"
# Data prep matches R exactly except publication-date parsing of malformed strings,
# where R's lubridate parse_date_time(exact=FALSE) is context-dependent and buggy (mangles
# trailing-period dates, drops bare years, and parses the same month-range string to either
# a date or NA depending on its neighbours). The Python port parses each string
# independently and resolves month ranges to their first month, so it is at least as
# correct as R on every value and strictly more correct on the divergences. Divergence is
# bounded (11 cancer / 0 covid / 72 cvd trials) and fully attributable to malformed
# pub_date values. See parity_report.
known_divergence = "pub_date parsing of malformed strings (Python strictly more correct than R)"