Skip to content

Profiling vignette #435

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

Merged
merged 21 commits into from
Jan 25, 2021
Merged

Profiling vignette #435

merged 21 commits into from
Jan 25, 2021

Conversation

jgabry
Copy link
Member

@jgabry jgabry commented Jan 21, 2021

Note: this branch branches off of the profiling branch (so it looks like there are more files changed than there really are)

@rok-cesnovar Here's a template for the profiling vignette. To generate the html run:

withr::with_envvar(c("NOT_CRAN" = "true"), {
  pkgdown::build_articles_index() 
  pkgdown::build_article("profiling")
})

contents:
- cmdstanr-internals
- profiling
Copy link
Member Author

Choose a reason for hiding this comment

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

When creating a new vignette you need to add the file name (without the .Rmd) to the articles section of _pkgdown.yml

---

```{r child="children/settings-knitr.Rmd"}
```
Copy link
Member Author

Choose a reason for hiding this comment

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

brings in the knitr settings we use in all the vignettes

Comment on lines 2 to 14
title: "Profiling Stan programs with CmdStanR"
author: "Rok Češnovar and Jonah Gabry"
output:
rmarkdown::html_vignette:
toc: true
toc_depth: 4
params:
EVAL: !r identical(Sys.getenv("NOT_CRAN"), "true")
vignette: >
%\VignetteIndexEntry{Profiling Stan programs with CmdStanR}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Copy link
Member Author

Choose a reason for hiding this comment

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

I just copied all this from the other vignettes (but I put your name first in the authors)

Comment on lines 19 to 36
## Introduction

As of version 2.26.0 CmdStan supports profiling Stan programs ...

## Adding profiling statements to a Stan program

Profiling Stan programs requires adding `profile` statements to the
Stan program ...

## Accessing profiling information after running Stan

### Load profile data into R

The `$profiles()` method ...

### Saving profile files

The `$save_profile_files()` method ...
Copy link
Member Author

Choose a reason for hiding this comment

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

Feel free to change these section titles and order. Just wanted to show that we've been using ## for the main sections (# is used automatically for the title) and ### for subsections (#### for subsubsections if necessary).

@jgabry
Copy link
Member Author

jgabry commented Jan 21, 2021

Note: I made this as a PR so I could add review comments

@jgabry jgabry mentioned this pull request Jan 21, 2021
@rok-cesnovar
Copy link
Member

Thank you so much!

@jgabry
Copy link
Member Author

jgabry commented Jan 21, 2021

Oh and after you run

withr::with_envvar(c("NOT_CRAN" = "true"), {
  pkgdown::build_articles_index() 
  pkgdown::build_article("profiling")
})

you can run

pkgdown::preview_site()

to see what it looks like

@bbbales2
Copy link
Member

@jgabry two questions:

  1. I added the Stan models as files (instead of being inline in the vignette). Where do those go? I left them in the vignettes folder.
  2. I wanna add a workflow citation to the beginning and am too lazy to look this up. Do you know how off hand? Will I just make a .bib somewhere? If not, I will dig more. Just being lazy.

@jgabry
Copy link
Member Author

jgabry commented Jan 23, 2021

  1. I added the Stan models as files (instead of being inline in the vignette). Where do those go? I left them in the vignettes folder.

That's fine, although I would slightly prefer creating a separate folder (inside the vignettes folder) for those.

  1. I wanna add a workflow citation to the beginning and am too lazy to look this up. Do you know how off hand? Will I just make a .bib somewhere? If not, I will dig more. Just being lazy.

Yeah there's an example in the rstanarm vignettes:

https://github.com/stan-dev/rstanarm/tree/master/vignettes

Check out mrp.Rmd, which references the .bib file in the separate mrp-files folder:

https://github.com/stan-dev/rstanarm/blob/dee0a2d45bf42b2df791072041151b753edd6af9/vignettes/mrp.Rmd#L8

and then includes the citations like this:

https://github.com/stan-dev/rstanarm/blob/dee0a2d45bf42b2df791072041151b753edd6af9/vignettes/mrp.Rmd#L30-L38

@codecov-io
Copy link

codecov-io commented Jan 23, 2021

Codecov Report

Merging #435 (92753e3) into master (deeebdc) will increase coverage by 0.76%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #435      +/-   ##
==========================================
+ Coverage   92.22%   92.99%   +0.76%     
==========================================
  Files          12       12              
  Lines        2870     2870              
==========================================
+ Hits         2647     2669      +22     
+ Misses        223      201      -22     
Impacted Files Coverage Δ
R/install.R 68.51% <0.00%> (-2.63%) ⬇️
R/args.R 99.34% <0.00%> (+0.43%) ⬆️
R/fit.R 98.42% <0.00%> (+1.18%) ⬆️
R/path.R 83.01% <0.00%> (+3.77%) ⬆️
R/run.R 96.95% <0.00%> (+4.05%) ⬆️

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 deeebdc...92753e3. Read the comment docs.

@rok-cesnovar
Copy link
Member

Tests pass, should be ready for review.

@jgabry
Copy link
Member Author

jgabry commented Jan 25, 2021

Cool, taking a look now

@jgabry
Copy link
Member Author

jgabry commented Jan 25, 2021

Tests pass, should be ready for review.

Technically I opened this PR so it won't let me add a review. But I pushed a few minor edits and I think this is ready to go. The only thing is that I think it will fail on testcoverage because that runs the vignettes but doesn't have the release candidate.

Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

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

Approving for @jgabry

@rok-cesnovar
Copy link
Member

Thanks. Should pass now.

@rok-cesnovar rok-cesnovar merged commit 9bc4cb4 into master Jan 25, 2021
@rok-cesnovar rok-cesnovar deleted the profiling-vignette branch January 25, 2021 20:53
@rok-cesnovar rok-cesnovar mentioned this pull request Jan 26, 2021
11 tasks
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