{
  "_id": "6ace2995a14063b82c3b09eb",
  "Package": "flexstanr",
  "Title": "Portable Backend Layer for 'Stan' Models",
  "Version": "0.2.0.9000",
  "Authors@R": "c(person(\"Carl\", \"Pearson\", email = \"carl.ab.pearson@gmail.com\", role = c(\"aut\", \"cre\"),\ncomment = c(ORCID = \"0000-0003-0701-7860\")),\nperson(\"Weston\", \"Voglesonger\", email = \"westonvogle@gmail.com\", role = \"aut\"))",
  "Description": "Gives a 'Stan'-based R package one interface for fitting\nits models through either 'rstan' or 'cmdstanr', neither of\nwhich is required to install this package (install whichever\nyou use). Collects and validates sampler options, guarding\nagainst mixing one backend's argument vocabulary into the\nother, dispatches the fit to the chosen backend, and exposes\nbackend-agnostic accessors for reading posterior draws,\nextracting parameters, reporting convergence and sampler\ndiagnostics, and running generated quantities. The host package\nsupplies its own compiled models; flexstanr resolves them from\nthe calling package at run time, so the same code works\nwhichever backend is installed.",
  "License": "MIT + file LICENSE",
  "Encoding": "UTF-8",
  "Language": "en-US",
  "Roxygen": "list(markdown = TRUE)",
  "RoxygenNote": "7.3.3",
  "VignetteBuilder": "knitr",
  "Additional_repositories": "https://stan-dev.r-universe.dev",
  "Remotes": [
    "stan-dev/cmdstanr"
  ],
  "Config/testthat/edition": "3",
  "URL": "https://accidda.github.io/flexstanr/,\nhttps://github.com/ACCIDDA/flexstanr",
  "BugReports": "https://github.com/ACCIDDA/flexstanr/issues",
  "Repository": "https://accidda.r-universe.dev",
  "Date/Publication": "2026-10-13 05:10:09 UTC",
  "RemoteUrl": "https://github.com/accidda/flexstanr",
  "RemoteRef": "HEAD",
  "RemoteSha": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-10-13 12:19:54 UTC",
    "User": "root"
  },
  "Author": "Carl Pearson [aut, cre] (ORCID:\n<https://orcid.org/0000-0003-0701-7860>),\nWeston Voglesonger [aut]",
  "Maintainer": "Carl Pearson <carl.ab.pearson@gmail.com>",
  "_user": "accidda",
  "_type": "src",
  "_file": "flexstanr_0.2.0.9000.tar.gz",
  "_fileid": "https://r2.ropensci.org/8ffbd44cc680fe080f75116ca676aa86a9ff8017a5747d3047c1b97aa0685c36",
  "_filesize": 112502,
  "_sha256": "8ffbd44cc680fe080f75116ca676aa86a9ff8017a5747d3047c1b97aa0685c36",
  "_expires": "2027-01-21T12:52:35.000Z",
  "_created": "2026-10-13T12:19:54.000Z",
  "_published": "2026-10-13T12:52:37.603Z",
  "_buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_jobs": [
    {
      "job": 115293119371,
      "time": 256,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "11812277925"
    },
    {
      "job": 115293119474,
      "time": 239,
      "config": "linux-release-x86_64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11812452838"
    },
    {
      "job": 115293119308,
      "time": 125,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "11813984377"
    },
    {
      "job": 115293119282,
      "time": 114,
      "config": "macos-release-arm64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11814072920"
    },
    {
      "job": 115290867966,
      "time": 324,
      "config": "source",
      "r": "4.6.1",
      "check": "OK",
      "artifact": "11811607735"
    },
    {
      "job": 115293119334,
      "time": 228,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "11811913240"
    },
    {
      "job": 115293119310,
      "time": 129,
      "config": "windows-devel-x86_64",
      "r": "4.7.0",
      "check": "WARNING",
      "artifact": "11811608130"
    },
    {
      "job": 115293119331,
      "time": 148,
      "config": "windows-oldrel-x86_64",
      "r": "4.5.3",
      "check": "WARNING",
      "artifact": "11812815062"
    },
    {
      "job": 115293119458,
      "time": 121,
      "config": "windows-release-x86_64",
      "r": "4.6.1",
      "check": "WARNING",
      "artifact": "11812352415"
    }
  ],
  "_upstream": "https://github.com/accidda/flexstanr",
  "_commit": {
    "id": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
    "author": "Weston Voglesonger <69158595+WestonVoglesonger@users.noreply.github.com>",
    "committer": "GitHub <noreply@github.com>",
    "message": "Add `backend_diagnostics()`: backend-agnostic convergence and sampler diagnostics (#41)\n\n* Add backend_diagnostics(): backend-agnostic convergence and sampler diagnostics (#40)\n\nReports per-parameter R-hat and bulk/tail ESS (via posterior) and per-chain\ndivergent transitions, max treedepth hits, and E-BFMI, in the same shape for\nrstan and cmdstanr fits. Both backends are normalized to posterior draws and an\niterations x chains x variables sampler array before anything is computed, using\nrstan's and cmdstanr's own definitions. No thresholds or warnings; judging a fit\nis left to the host package.\n\n* Import backend_diagnostics() into host files; fix CI's live rstan test\n\n- Add backend_diagnostics to the internal-import list use_flexstanr()\n  generates, with a guard test that every exported backend_*() accessor is on\n  it (Codex review).\n- The live rstan parity test ran in every R-CMD-check job (r-lib's check\n  action sets NOT_CRAN=true) and failed where rstan is a binary install\n  without its LinkingTo headers (\"Boost not found\"). Skip it unless BH,\n  StanHeaders, RcppEigen, and RcppParallel are installed, and cover the rstan\n  branch toolchain-free by mocking rstan::get_sampler_params() and building a\n  bare stanfit.\n- README: list backend_diagnostics() among the accessors.\n\n* Fix runtime edge cases in backend diagnostics\n\nHandle CmdStanR fixed-parameter fits and explicitly request sampler arrays;\npreserve rstan singleton dimensions. Keep posterior ESS reports silent and\nreturn NA consistently for undefined E-BFMI, with corrected documentation.\nAdd regressions for these cases and supported CmdStanR draw formats.\n\n* Delegate sampler diagnostics to public backend summaries\n\nGuard backend availability and check posterior before parameter validation.\nPreserve per-chain and undefined-energy contracts with narrow adapters,\nand cover the public CmdStanR and RStan reference APIs.",
    "time": 1791868209
  },
  "_maintainer": {
    "name": "Carl Pearson",
    "email": "carl.ab.pearson@gmail.com",
    "login": "pearsonca",
    "orcid": "0000-0003-0701-7860",
    "description": "STEM researcher.",
    "uuid": 1828039
  },
  "_distro": "resolute",
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 4.1.0",
      "role": "Depends"
    },
    {
      "package": "methods",
      "role": "Imports"
    },
    {
      "package": "parallelly",
      "role": "Imports"
    },
    {
      "package": "tools",
      "role": "Imports"
    },
    {
      "package": "cmdstanr",
      "version": ">= 0.5.0",
      "role": "Suggests"
    },
    {
      "package": "desc",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "pkgload",
      "role": "Suggests"
    },
    {
      "package": "posterior",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "roxygen2",
      "role": "Suggests"
    },
    {
      "package": "rstan",
      "version": ">= 2.18.1",
      "role": "Suggests"
    },
    {
      "package": "spelling",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.2.0",
      "role": "Suggests"
    },
    {
      "package": "withr",
      "role": "Suggests"
    }
  ],
  "_owner": "accidda",
  "_selfowned": true,
  "_usedby": 1,
  "_updates": [
    {
      "week": "2026-27",
      "n": 7
    },
    {
      "week": "2026-28",
      "n": 9
    },
    {
      "week": "2026-30",
      "n": 1
    },
    {
      "week": "2026-31",
      "n": 3
    },
    {
      "week": "2026-32",
      "n": 2
    },
    {
      "week": "2026-33",
      "n": 1
    },
    {
      "week": "2026-42",
      "n": 1
    }
  ],
  "_tags": [],
  "_stars": 1,
  "_contributors": [
    {
      "user": "westonvoglesonger",
      "count": 24,
      "uuid": 69158595
    }
  ],
  "_userbio": {
    "uuid": 165699822,
    "type": "organization",
    "name": "Atlantic Coast Center for Infectious Disease Dynamics and Analytics",
    "followers": 24
  },
  "_downloads": {
    "count": 348,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/flexstanr"
  },
  "_devurl": "https://github.com/accidda/flexstanr",
  "_pkgdown": "https://accidda.github.io/flexstanr/",
  "_searchresults": 3,
  "_rbuild": "4.6.1",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/flexstanr.html",
    "extra/manual.pdf",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "LICENSE"
  ],
  "_homeurl": "https://github.com/accidda/flexstanr",
  "_realowner": "accidda",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2026-07-17"
    },
    {
      "version": "0.2.0",
      "date": "2026-08-25"
    }
  ],
  "_exports": [
    "backend_diagnostics",
    "backend_draws_array",
    "backend_extract",
    "backend_generate_quantities",
    "backend_has_draws",
    "fit_model",
    "stan_options",
    "test_threaded",
    "use_flexstanr"
  ],
  "_help": [],
  "_readme": "https://github.com/accidda/flexstanr/raw/HEAD/README.md",
  "_rundeps": [
    "parallelly"
  ],
  "_vignettes": [
    {
      "source": "getting-started.Rmd",
      "filename": "getting-started.html",
      "title": "Getting started with flexstanr",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Wiring it into your package",
        "Building sampler options",
        "Fitting a model",
        "Reading a fit",
        "Choosing cmdstanr"
      ],
      "created": "2026-07-08 15:59:57",
      "modified": "2026-08-07 19:33:18",
      "commits": 5
    },
    {
      "source": "parallel-hpc.Rmd",
      "filename": "parallel-hpc.html",
      "title": "Parallel and threaded fitting (including HPC)",
      "engine": "knitr::rmarkdown",
      "headings": [
        "What threading = TRUE does",
        "Capping the cores",
        "Model authors: warn when threads can't be used",
        "How flexstanr decides how many cores to use",
        "Compiling your model for threading",
        "On a laptop or workstation",
        "On an HPC cluster",
        "The trap to avoid",
        "Single node: let flexstanr split your allocation",
        "Many chains across nodes: one chain per array task"
      ],
      "created": "2026-07-27 17:08:50",
      "modified": "2026-07-27 17:08:50",
      "commits": 1
    }
  ],
  "_score": 5.3222192947339195,
  "_indexed": true,
  "_nocasepkg": "flexstanr",
  "_universes": [
    "accidda",
    "pearsonca"
  ],
  "_previous": "0.2.0",
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.2.0.9000",
      "date": "2026-10-13T12:23:53.000Z",
      "distro": "resolute",
      "commit": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
      "fileid": "https://r2.ropensci.org/d496a2f12c722458a6c6f25300e13a4129e846556a1ed0b5e5fa4e4213f9cf96",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979"
    },
    {
      "r": "4.6.1",
      "os": "linux",
      "version": "0.2.0.9000",
      "date": "2026-10-13T12:23:41.000Z",
      "distro": "resolute",
      "commit": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
      "fileid": "https://r2.ropensci.org/9893e9c255250cadb0dc82acf62884b1e17ff84f3e0b4067beeb9667b3611341",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.2.0.9000",
      "date": "2026-10-13T12:51:45.000Z",
      "commit": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
      "fileid": "https://r2.ropensci.org/c6bbbdcc7891cfe9e14100eab3eaf04a41396abfa20f2298836ea1e0ab6084da",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979"
    },
    {
      "r": "4.6.1",
      "os": "mac",
      "version": "0.2.0.9000",
      "date": "2026-10-13T12:45:12.000Z",
      "commit": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
      "fileid": "https://r2.ropensci.org/1f0c3721acb269bbb1a2ef5c2f1cd9df8dc927fad3b5277df92903cdb98a0919",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.2.0.9000",
      "date": "2026-10-13T12:24:06.000Z",
      "commit": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
      "fileid": "https://r2.ropensci.org/649d4871099caa6f6b3c6e9224d348a4df48e533a7cf0faf027c2ba5f07ca547",
      "status": "success",
      "buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.2.0.9000",
      "date": "2026-10-13T12:21:37.000Z",
      "commit": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
      "fileid": "https://r2.ropensci.org/3644445fe1e0219abdae70c2a5dc6e6fb1c5d3b6acc0576918543b1f09aa702b",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.2.0.9000",
      "date": "2026-10-13T12:22:08.000Z",
      "commit": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
      "fileid": "https://r2.ropensci.org/a04b5ea074b64cae982349afc215cb7875a5debad419fdb6b523274b776ed803",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979"
    },
    {
      "r": "4.6.1",
      "os": "win",
      "version": "0.2.0.9000",
      "date": "2026-10-13T12:21:28.000Z",
      "commit": "5505d17dadfeb49a6a1713c90b67d3c90d51635b",
      "fileid": "https://r2.ropensci.org/72a28c6775a9013c4ef8c6a7d852b4dce9cf07b84f7c24b9de28685a89f0209b",
      "status": "success",
      "check": "WARNING",
      "buildurl": "https://github.com/r-universe/accidda/actions/runs/38395850979"
    }
  ]
}