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

Create NMFS completion certificates & use quarto for certificates #146

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

ateucher
Copy link
Contributor

@ateucher ateucher commented Dec 10, 2024

This updates create_certificate() and create_batch_certificates() to create a certificate for the NMFS Openscapes champions using a nmfs-specific template, using Quarto with typst pdf output. It also switches the original certificate creation to use Quarto + typst instead of Rmarkdown + LaTeX.

The template (NMFS or standard Openscapes) is chosen via the new parameter cohort_type ("standard", the default, or "nmfs").

Because Quarto doesn't support writing to a different directory, I added code to match existing behaviour to move the file to a specified directory once it's created.

I also added some robustness to create_batch_certificates() with a tryCatch() inside the loop, and some more basic type checking and handling of dates.

Still TODO: Move pathways template here as well (#99) (NOTE: Will do in a separate PR after this is merged)

Closes #144

@ateucher ateucher marked this pull request as ready for review December 10, 2024 22:33
@stefaniebutland
Copy link
Member

Dec 20

Thanks @ateucher for the screenshare to resolve this. I updated Quarto & RStudio & create_batch_certificates worked.

create_certificate gave error Error: argument "cohort_type" is missing, with no default

Out of date:

Error in my setup preventing me from testing.

create_certificate gives Error running quarto cli. I've got a newer version of Quarto installed but RStudio still using 1.4.4 (i.e. without typst?). Likely the source of error. I'll get Andy's help to clean up my setup

Session info
────────────────────────────────────────────────────────
 setting  value
 version  R version 4.4.1 (2024-06-14)
 os       macOS Ventura 13.7.1
 system   aarch64, darwin20
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/Vancouver
 date     2024-12-16
 rstudio  2024.09.0+375 Cranberry Hibiscus (desktop)
 pandoc   3.2 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)

─ Packages ────────────────────────────────────────────────────────────
 ! package       * version  date (UTC) lib source
   askpass         1.2.1    2024-10-04 [1] CRAN (R 4.4.1)
   brio            1.1.5    2024-04-24 [1] CRAN (R 4.4.0)
   cachem          1.1.0    2024-05-16 [1] CRAN (R 4.4.0)
   cellranger      1.1.0    2016-07-27 [1] CRAN (R 4.4.0)
   cli             3.6.3    2024-06-21 [1] CRAN (R 4.4.0)
   credentials     2.0.2    2024-10-04 [1] CRAN (R 4.4.1)
   curl            6.0.1    2024-11-14 [1] CRAN (R 4.4.1)
   desc            1.4.3    2023-12-10 [1] CRAN (R 4.4.0)
   devtools      * 2.4.5    2022-10-11 [1] CRAN (R 4.4.0)
   digest          0.6.37   2024-08-19 [1] CRAN (R 4.4.1)
   dplyr         * 1.1.4    2023-11-17 [1] CRAN (R 4.4.0)
   ellipsis        0.3.2    2021-04-29 [1] CRAN (R 4.4.0)
   evaluate        1.0.1    2024-10-10 [1] CRAN (R 4.4.1)
   fansi           1.0.6    2023-12-08 [1] CRAN (R 4.4.0)
   fastmap         1.2.0    2024-05-15 [1] CRAN (R 4.4.0)
   fs              1.6.5    2024-10-30 [1] CRAN (R 4.4.1)
   gargle          1.5.2    2023-07-20 [1] CRAN (R 4.4.0)
   generics        0.1.3    2022-07-05 [1] CRAN (R 4.4.0)
   gert            2.1.4    2024-10-14 [1] CRAN (R 4.4.1)
   gh              1.4.1    2024-03-28 [1] CRAN (R 4.4.0)
   gitcreds        0.1.2    2022-09-08 [1] CRAN (R 4.4.0)
   glue            1.8.0    2024-09-30 [1] CRAN (R 4.4.1)
   googledrive     2.1.1    2023-06-11 [1] CRAN (R 4.4.0)
   googlesheets4 * 1.1.1    2023-06-11 [1] CRAN (R 4.4.0)
   htmltools       0.5.8.1  2024-04-04 [1] CRAN (R 4.4.0)
   htmlwidgets     1.6.4    2023-12-06 [1] CRAN (R 4.4.0)
   httpuv          1.6.15   2024-03-26 [1] CRAN (R 4.4.0)
   httr            1.4.7    2023-08-15 [1] CRAN (R 4.4.0)
   jsonlite        1.8.9    2024-09-20 [1] CRAN (R 4.4.1)
   knitr           1.49     2024-11-08 [1] CRAN (R 4.4.1)
 P kyber         * 0.1.0    2024-12-09 [?] Github (openscapes/kyber@ee5f27d)
   later           1.4.1    2024-11-27 [1] CRAN (R 4.4.1)
   lifecycle       1.0.4    2023-11-07 [1] CRAN (R 4.4.0)
   lubridate       1.9.4    2024-12-08 [1] CRAN (R 4.4.1)
   magrittr        2.0.3    2022-03-30 [1] CRAN (R 4.4.0)
   memoise         2.0.1    2021-11-26 [1] CRAN (R 4.4.0)
   mime            0.12     2021-09-28 [1] CRAN (R 4.4.0)
   miniUI          0.1.1.1  2018-05-18 [1] CRAN (R 4.4.0)
   openssl         2.2.2    2024-09-20 [1] CRAN (R 4.4.1)
   parsermd        0.1.3    2024-01-16 [1] CRAN (R 4.4.0)
   pillar          1.9.0    2023-03-22 [1] CRAN (R 4.4.0)
   pkgbuild        1.4.5    2024-10-28 [1] CRAN (R 4.4.1)
   pkgconfig       2.0.3    2019-09-22 [1] CRAN (R 4.4.0)
   pkgload         1.4.0    2024-06-28 [1] CRAN (R 4.4.0)
   processx        3.8.4    2024-03-16 [1] CRAN (R 4.4.0)
   profvis         0.4.0    2024-09-20 [1] CRAN (R 4.4.1)
   promises        1.3.2    2024-11-28 [1] CRAN (R 4.4.1)
   ps              1.8.1    2024-10-28 [1] CRAN (R 4.4.1)
   purrr           1.0.2    2023-08-10 [1] CRAN (R 4.4.0)
   quarto        * 1.4.4    2024-07-20 [1] CRAN (R 4.4.0)
   R6              2.5.1    2021-08-19 [1] CRAN (R 4.4.0)
   rappdirs        0.3.3    2021-01-31 [1] CRAN (R 4.4.0)
   Rcpp            1.0.13-1 2024-11-02 [1] CRAN (R 4.4.1)
   remotes         2.5.0    2024-03-17 [1] CRAN (R 4.4.0)
   rlang           1.1.4    2024-06-04 [1] CRAN (R 4.4.0)
   rmarkdown       2.29     2024-11-04 [1] CRAN (R 4.4.1)
   rprojroot       2.0.4    2023-11-05 [1] CRAN (R 4.4.0)
   rstudioapi      0.17.1   2024-10-22 [1] CRAN (R 4.4.1)
   sessioninfo     1.2.2    2021-12-06 [1] CRAN (R 4.4.0)
   shiny           1.9.1    2024-08-01 [1] CRAN (R 4.4.0)
   stringi         1.8.4    2024-05-06 [1] CRAN (R 4.4.0)
   stringr         1.5.1    2023-11-14 [1] CRAN (R 4.4.0)
   sys             3.4.3    2024-10-04 [1] CRAN (R 4.4.1)
   testthat      * 3.2.1.1  2024-04-14 [1] CRAN (R 4.4.0)
   tibble          3.2.1    2023-03-20 [1] CRAN (R 4.4.0)
   tidyselect      1.2.1    2024-03-11 [1] CRAN (R 4.4.0)
   timechange      0.3.0    2024-01-18 [1] CRAN (R 4.4.0)
   urlchecker      1.0.1    2021-11-30 [1] CRAN (R 4.4.0)
   usethis       * 3.1.0    2024-11-26 [1] CRAN (R 4.4.1)
   utf8            1.2.4    2023-10-22 [1] CRAN (R 4.4.0)
   vctrs           0.6.5    2023-12-01 [1] CRAN (R 4.4.0)
   withr           3.0.2    2024-10-28 [1] CRAN (R 4.4.1)
   xfun            0.49     2024-10-31 [1] CRAN (R 4.4.1)
   xtable          1.8-4    2019-04-21 [1] CRAN (R 4.4.0)
   yaml            2.3.10   2024-07-26 [1] CRAN (R 4.4.0)

 [1] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library

Copy link
Member

@stefaniebutland stefaniebutland left a comment

Choose a reason for hiding this comment

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

UPDATE: copied from comment above

create_certificate gave error Error: argument "cohort_type" is missing, with no default

Worked well for me in our late-Dec screenshare. Thank you @ateucher !

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.

Create NMFS-specific completion certificate
2 participants