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

verbose mode and replace regexpr #392

Merged
merged 9 commits into from
Dec 10, 2020
Merged

verbose mode and replace regexpr #392

merged 9 commits into from
Dec 10, 2020

Conversation

rok-cesnovar
Copy link
Member

Summary

Fixes #385
Fixes #391

I was in a slam dunk issue squashing mood so decided to squash these two.

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:

@jgabry
Copy link
Member

jgabry commented Dec 8, 2020

I was in a slam dunk issue squashing mood so decided to squash these two.

Nice, thanks!

This looks great except that the uses of is_verbose_mode all need to be is_verbose_mode() so that it actually calls the function. That's probably why there are errors. I can go ahead and make that change now.

@@ -14,6 +14,10 @@ os_is_macos <- function() {
isTRUE(Sys.info()[["sysname"]] == "Darwin")
}

is_verbose_mode <- function() {
getOption("cmdstanr_verbose", default = FALSE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way you had this function was totally fine, but to simplify things I changed it to use getOption(), which conveniently handles the NULL case with the default argument.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah didnt know that. Thanks!

@jgabry
Copy link
Member

jgabry commented Dec 8, 2020

Ok I changed is_verbose_mode to is_verbose_mode() so we'll see if all the tests pass now. We should also think about where to document that verbose mode is available. It's not really intended for regular users but we should probably mention it briefly somewhere.

@codecov-io
Copy link

codecov-io commented Dec 8, 2020

Codecov Report

Merging #392 (d59e446) into master (775d1e6) will decrease coverage by 0.15%.
The diff coverage is 89.58%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #392      +/-   ##
==========================================
- Coverage   88.20%   88.05%   -0.16%     
==========================================
  Files          12       12              
  Lines        2713     2720       +7     
==========================================
+ Hits         2393     2395       +2     
- Misses        320      325       +5     
Impacted Files Coverage Δ
R/install.R 51.64% <50.00%> (-0.32%) ⬇️
R/model.R 80.62% <100.00%> (+0.09%) ⬆️
R/read_csv.R 98.78% <100.00%> (ø)
R/run.R 95.06% <100.00%> (-0.54%) ⬇️
R/utils.R 93.54% <100.00%> (+0.04%) ⬆️

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 775d1e6...d59e446. Read the comment docs.

@rok-cesnovar
Copy link
Member Author

Maybe we add it to the internals vignette? Do we want to do it here or add to the vignette list?

@jgabry
Copy link
Member

jgabry commented Dec 9, 2020

Maybe we add it to the internals vignette? Do we want to do it here or add to the vignette list?

Sounds good. Either way is fine by me.

@rok-cesnovar
Copy link
Member Author

Will add it here tomorrow and then merge.

@jgabry
Copy link
Member

jgabry commented Dec 9, 2020

Ok cool, thanks!

@rok-cesnovar
Copy link
Member Author

@jgabry I updated the vignette, check whenever you have a few moments.

@jgabry
Copy link
Member

jgabry commented Dec 10, 2020

Looks great! I'm going to quickly add an example to the section you created so people can see what the verbose mode output looks like and then I'll merge this.

@jgabry jgabry merged commit af3a191 into master Dec 10, 2020
@jgabry jgabry deleted the verbose_grepl branch December 10, 2020 23:28
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.

Verbose mode Consistent usage of grepl and regexpr
3 participants