Function stan_model refers to field Date of packageDescription which doesn't exist
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.1k
- Forks
- 266
- Avg merge
- 2h 56m
- Merged PRs (30d)
- 1
Description
Function stan_model in rstan.R refers to field Date in the return value of packageDescription, and there is no such field.
R function packageDescription just returns whatever is in the DESCRIPTION file in the installed package, so the available fields depend on what was written there. The R version I am using (R 4.0.3 on macOS) doesn't write a field named "Date", so there is no such field available in the value returned by packageDescription.
I'm unable to construct a small, reproducible example. I bumped into the error when I was working with an existing model, but the error goes away after removing the .rds file (the reference to packageDescription("rstan")$Date occurs when checking the modification time of the .rds file). I wasn't able to construct a smaller example which showed the error -- the line of code in question is nested within some conditionals and I wasn't able to to deduce what combination of circumstances would lead to packageDescription("rstan")$Date being evaluated.
Maybe packageDescription("rstan")$Date should be changed to asDateBuilt (packageDescription ("rstan")$Built) since I see that there is a field Built in DESCRIPTION. However, if the fields stored in DESCRIPTION can vary from version to version of R, then I don't know how to future-proof this test.
packageVersion("rstan") reports 2.26.1.
R.version.string reports "R version 4.0.3 (2020-10-10)".
Operating system: macOS Catalina 10.15.7.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in rstan.R at stan_model, where packageDescription("rstan")$Date is used while checking an .rds file's modification time. Inspect the surrounding conditionals and compare the available DESCRIPTION fields, including Built, on the reported R version. Done means the existing model-cache path no longer assumes a missing Date field and still performs its timestamp check correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100