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

srr not parsing standards found in .Rmd files #40

Open
abigailkeller opened this issue May 30, 2024 · 2 comments
Open

srr not parsing standards found in .Rmd files #40

abigailkeller opened this issue May 30, 2024 · 2 comments

Comments

@abigailkeller
Copy link

Hi! I'm creating this issue related to my ROpenSci statistical software package submission (submission issue here, package repo here).

I am working on including probability distribution statistical standards, and I'm hoping to document some of these in the inst folder that contains Stan code of my model specifications (since this would be the easiest way to connect the standards to the probability distributions used in the package).

I created a .Rmd file in the inst folder (see here) that is rendered into the folder README on Github. However, srr does not seem to be parsing these two standards (PD1.0, PD2.0).

Similarly, I have one standard in the overall package README (see the associated .Rmd file here) that also does not get parsed by srr.

I'm wondering if you have any tips to ensure that srr is recognizing the documentation of these standards?

@mpadge
Copy link
Member

mpadge commented May 31, 2024

Sorry for the inconvenience @abigailkeller. The above commits now catch all files in the inst/ directory, and also fix the small 🐛 that prevented picking up your README.Rmd in the main directory.

library (srr)
packageVersion ("srr")
#> [1] '0.1.2.13'

path <- "/<local>/<path>/<to>/eDNAjoint"
srr_stats_pre_submit (path) # does nothing if no missing standards
rep <- srr_report (path, view = FALSE, roxygenise = FALSE)
#> ✔ Downloaded general standards
#> ✔ Downloaded bayesian standards
#> ✔ Downloaded distributions standards
#> processing file: filea68930bac4b2.Rmd
#> output file: filea68930bac4b2.knit.md
#> Output created: /tmp/Rtmp34XtPp/filea68930bac4b2.html

head (rep, 15)
#>  [1] "# srr report for [eDNAjoint](https://github.com/abigailkeller/eDNAjoint)"                       
#>  [2] ""                                                                                               
#>  [3] "[Click here for full text of all standards](https://stats-devguide.ropensci.org/standards.html)"
#>  [4] ""                                                                                               
#>  [5] ""                                                                                               
#>  [6] ""                                                                                               
#>  [7] "## Standards with `srrstats` tag"                                                               
#>  [8] ""                                                                                               
#>  [9] "**Numbers of standards:**"                                                                      
#> [10] "-  BS :  25  /  56"                                                                             
#> [11] "-  G :  40  /  68"                                                                              
#> [12] "-  PD :  4  /  14"                                                                              
#> [13] "- Total : 69 / 138"                                                                             
#> [14] ""                                                                                               
#> [15] ""

Created on 2024-05-31 with reprex v2.1.0

No standards missing, and the three extra ones now successfully picked up. With that, you'll be able to call check package in the software review issue yourself to get the updated report - but not until I comment again here to let you know that our system has been rebuilt with the above changes. That might take until early next week, alas, so please bear with me.

mpadge added a commit that referenced this issue May 31, 2024
@mpadge
Copy link
Member

mpadge commented May 31, 2024

Note to self: Had to switch off windows tests which now fail because of these lines:

srr/R/roclet.R

Lines 242 to 244 in f751305

ptn <- paste0 ("^.*", dir, "\\/")
fpath <- regmatches (block$file, regexpr (ptn, block$file))
fpath_full <- gsub (fpath, paste0 (dir, "/"), block$file)

TODO:

Fix to accommodate windows path as well ("\", not just "/"), and reinstate all tests on windows.

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

No branches or pull requests

2 participants