- Package releases now use standard R semver (starting at
7.0.0). The former{CLI engine}-{R wrapper}form (e.g.6.5.3-1.0.1on CRAN) is retired.
- Fix seed string alloc/dealloc mismatch in
RunWebVersion(new[]/delete[]consistently). - Fix uninitialized error message when the legacy error file cannot be opened.
- Resolve
fast_itoaODR conflict between R wrapper and simulation engine.
- Default table subfolders renamed from
smoking/andmortality/tosmok/andmort/underinst/extdata/2018/and in factory defaults. - Test fixtures moved from
tests/testdata/NHIS-1965-2018/totests/testdata/2018/. shg_load_params()still accepts legacysmoking//mortality/layouts in downloaded zips and normalizes them tosmok//mort/in the cache.
- Legacy config files may omit
RACE=(defaults to 0). - CSV parameter tables may omit a
RACEcolumn (header starts withSEX; all rows treated as race 0). shg_run()already defaulted omittedraceandsexto 0 in config lists.
- Add
./tools/check-docker-asan.shfor local CRAN-faithful gcc-ASAN checks (Docker). - README: CRAN-first install and minimal
shg_run()quick start with bundled extdata. - Maintainer docs no longer reference shg-cli sync as source of truth.
- Removed
params_bundle_sourceand single-zipshg_load_params(url = ...). - Required separate smoking and mortality releases:
smok_params_source,mort_params_source, andmort_params_type("acm"or"ocm"; wasparams_mortality). shg_load_params()downloads/caches each zip, mergesparams/tables into engine layoutsmoking/+mortality/.- Portable YAML and
getConfig()/getReproConfig()use the new provenance field names.
- Synced core engine from shg-cli v6.5.3.
- Windows: open bundled CSV tables in binary mode so
ftell/fseekdimension scans work; strip CR/LF on all CSV lines in CPD, initiation/cessation, and mortality loaders so missing"."fields parse correctly with CRLF.
- Bundled inputs: Default factory
input_data_folderissystem.file("extdata", "2018", package = "SmokingHistoryGenerator")(NHIS-1965–2018 csv-partial with cohort columns 1940, 1950, 2010). Removed transitionalinst/extdata/2016/, NHIS-1965–2016 test fixtures, andtests/fixtures/2016/XML goldens; tests and docs use the 2018 tree only. Regenerate the 2018 partial fromtests/testdata/2018/csv-complete/usingRscript tools/refresh-nhis-2018-csv-partial.R. - Layout: Under each year folder, smoking tables live in
smoking/, mortality inmortality/; factory defaults use relative paths (smoking/initiation.csv, …). - Portable / written YAML groups
params_bundle_source,params_mortality, and optional folder paths under aparams:map;shg_load_config/shg_apply_configaccept nested or flat keys.
getReproConfig()/ portable YAML omitnum_threads(effective segment count and seeds define the run; thread count defaults to auto on reload).getReproConfig()exportspackage_reproasr_package_versiononly (full install metadata remains internal for fingerprint checks).- Run bundles with
attach_run_info = TRUEenrichrepro_configwith a nestedresultsblock (content_md5, compactsummary) and a singlerepro_digest(engine settings plus R session). Legacy flatresults_*/repro_engine_md5/r_session_md5keys in YAML are merged or dropped on load. - Summaries omit sentinel
-999;age_at_deathis split for never vs ever death-age stats (mean,sd,n_obs). Top-levelever_smokersholdscount,fraction, and integercpd_mode(most common rounded CPD among ever smokers). Keyscount(never/ever totals) andn_obs(rows contributing to each mean/sd) replace baren(YAML 1.1 reservesn). Initiation and cessation means use ever smokers only;age_at_death$ever_smokersis only death-age statistics (not the same list as top-levelever_smokers). shg_save_config(..., results = )optionally writes those verification fields (includingcontent_md5and compact results summary metadata whenresultsis supplied).
-
CLI sync metadata:
src/shg-cli-info.txt(YAML mapshg-cli:withMostRecentTag,CommitHash,SrcHash; listed in.Rbuildignoreso it is not shipped in CRAN source tarballs);python tools/shg-sync.py update-descriptionrefreshes it from the sibling shg-cli checkout. R merges these into thepackageDescription()list asSHGMostRecentTag,SHGCommitHash, andSHGsrcHashwhen the file is present (for exampledevtools::load_all()from a checkout). The oldRWrapperVersionfield is dropped. -
shg_load_params()(URLs):shg.params.download.timeout_sec(default 600) andshg.params.download.connect_sec(default 60) when httr2 is installed; clearer HTTP/network errors; HTML and non-zip responses detected before unzip. -
shg_reset_defaults()/shg$reset_to_factory_defaults()restore engine fields to the same defaults as a freshSHGInterface. -
shg_apply_config(shg, config)resets defaults, then applies a sparse or full named list viauseConfig(), so partial YAML/intent configs do not inherit stale instance state. -
shg_apply_config()withparams_bundle_sourcenow callsshg_load_params()the same way asshg_load_config()(clears derived paths, restores the bundle). Without a bundle, explicitinput_data_folder/ table filenames in the list are still applied. -
shg_load_config()now starts from factory defaults before applying the YAML bundle (viareset_to_factory_defaults()in the bundle applier). -
shg_write_config_yaml(config, path)serializes any config list: drops audit keys, and strips redundant table paths whenparams_bundle_sourceis present (shape-driven "portable" output). -
Config lists and YAML may use
mortalityas an alias forparams_mortality. Normalization uses[[only so it does not partially matchmortality_filename. -
Factory defaults: mortality file is
mortality/acm.csv, matchingshg_load_params(..., mortality = "acm")bundle layout.
shg$runSimFromFixedValues(..., attach_run_info, original_config)andshg$runSimFromDataFrame(..., attach_run_info, original_config)(6-argument forms): whenattach_run_infoisTRUE, the return value is a list withresults,original_config(sparse intent; default for fixed cohort = repeat/race/sex/cohort_year),repro_config(post-rungetReproConfig(FALSE)), andrun_info(host/software/audit).- The 4- and 1-argument forms keep the previous behavior: a
data.frameof simulation output (attach_run_info = FALSE). shg_run()/shg$runSim()acceptattach_run_info(defaultTRUE; setFALSEfor data-frame-only return).shg_run()/shg$runSim(): ifrepeat,individuals, andNare all omitted,repeatdefaults to 1000.
Direct shg$useConfig() without shg_apply_config() still overlays on the current instance (legacy). Prefer shg_apply_config() for defaults-first semantics.