Skip to content

Conversation

@rok-cesnovar
Copy link
Member

@rok-cesnovar rok-cesnovar commented Apr 9, 2022

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

Adds a vignette on handling deprecations with the canonicalizer available through the $format() method.

Online vignette can be seen here: https://rok-cesnovar.github.io/cmdstanr/articles/deprecations.html

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Rok Češnovar

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.16%. Comparing base (b62ad1f) to head (cc86f4e).
⚠️ Report is 994 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #644      +/-   ##
==========================================
- Coverage   92.63%   91.16%   -1.47%     
==========================================
  Files          12       12              
  Lines        3406     3419      +13     
==========================================
- Hits         3155     3117      -38     
- Misses        251      302      +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jgabry
Copy link
Member

jgabry commented Apr 13, 2022

Is there a bug in the format method? I don't think it's actually overwriting the Stan file when overwrite_file=TRUE. If I run

mod$format(
    canonicalize = list("deprecations"),
    overwrite_file = TRUE,
    backup = FALSE
)
mod$print()

Then mod$print() still prints the old version of the file.

@rok-cesnovar
Copy link
Member Author

I think print() might use a stored string of the file?

@jgabry
Copy link
Member

jgabry commented Apr 13, 2022

Yeah. I think we need to put the string of the new Stan code in private$stan_code_

@jgabry
Copy link
Member

jgabry commented Apr 13, 2022

Ok I think I fixed the printing issue. If that fix and my edits to the vignette look good to you then I think this is ready.

@jgabry
Copy link
Member

jgabry commented Apr 13, 2022

Actually I think we also still need to do this part of #626:

catch if any stanc3 message mentions deprecations and print an R warning pointing to the online vignette

@rok-cesnovar
Copy link
Member Author

Actually I think we also still need to do this part of #626:

Yeah, will merge this and then open another PR with the exact link.

Thanks @jgabry for the fixes!

@rok-cesnovar rok-cesnovar merged commit bfa83a4 into master Apr 15, 2022
@rok-cesnovar rok-cesnovar deleted the deprecations-vignette branch April 15, 2022 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants