Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vignette on how to handle deprecations with $format() #644

Merged
merged 8 commits into from
Apr 15, 2022

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

Merging #644 (ba3ba38) into master (b62ad1f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #644   +/-   ##
=======================================
  Coverage   92.63%   92.63%           
=======================================
  Files          12       12           
  Lines        3406     3406           
=======================================
  Hits         3155     3155           
  Misses        251      251           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b62ad1f...ba3ba38. Read the comment docs.

@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_

R/model.R Outdated Show resolved Hide resolved
@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.

3 participants