Skip to content

Commit

Permalink
Merge branch 'main' into 234-how-i-rebuilt-a-lost-ecg-data-script-in-r
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanThoma authored Oct 18, 2024
2 parents 59cafb9 + e3b8418 commit 1ba0e3b
Show file tree
Hide file tree
Showing 9 changed files with 625 additions and 23 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
teal
riskmetric
tidyCDISC
mirai
- name: Install tinytex
run: quarto install tool tinytex
Expand Down
34 changes: 11 additions & 23 deletions .github/workflows/update_post_dates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main # replace with the branch you want to checkout
ref: main
token: ${{ secrets.PHARMAVERSE_BOT }}

- name: Run update_post_dates
run: Rscript R/update_post_dates.R # running the R script with Rscript

- name: Configure Git safe directory
run: git config --global --add safe.directory /__w/blog/blog

- name: Check for changes
id: check_changes
shell: bash
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if [[ `git status --porcelain` ]]; then
echo "changes detected"
echo "changes=true" >> $GITHUB_ENV
else
echo "no changes"
echo "changes=false" >> $GITHUB_ENV
fi
- name: Commit results
if: env.changes == 'true'
run: |
git add .
git commit -m "Auto-update blog post date"
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[skip actions] Auto-update blog post date"
file_pattern: "."
commit_user_name: github-actions
commit_user_email: >-
41898282+github-actions[bot]@users.noreply.github.com
continue-on-error: true
27 changes: 27 additions & 0 deletions inst/WORDLIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,33 @@ astrazeneca
laura
MeetLaura
needleman
Alexandros
clusterSetRNGStream
CMRG
doFuture
elbersb
filelock
HPC
Kouretsis
L'Ecuyer
mirai
nanonext
opre
parallelization
Parallelization
parallelizes
parallelMap
pubsonline
reprovision
shikokuchuo
tensio
tidylog
tidyr
wlandau
zzz
axecute
readRDS
saveRDS
WEL
Parmar
RMarkdown
Expand Down
73 changes: 73 additions & 0 deletions posts/2024-10-16_the__tensio.../appendix.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
suppressMessages(library(dplyr))
# markdown helpers --------------------------------------------------------

markdown_appendix <- function(name, content) {
paste(paste("##", name, "{.appendix}"), " ", content, sep = "\n")
}
markdown_link <- function(text, path) {
paste0("[", text, "](", path, ")")
}



# worker functions --------------------------------------------------------

insert_source <- function(repo_spec, name,
collection = "posts",
branch = "main",
host = "https://github.com",
text = "Source",
file_name) {
path <- paste(
host,
repo_spec,
"tree",
branch,
collection,
name,
file_name,
sep = "/"
)
return(markdown_link(text, path))
}

insert_timestamp <- function(tzone = Sys.timezone()) {
time <- lubridate::now(tzone = tzone)
stamp <- as.character(time, tz = tzone, usetz = TRUE)
return(stamp)
}

insert_lockfile <- function(repo_spec, name,
collection = "posts",
branch = "main",
host = "https://github.com",
text = "Session info") {
path <- path <- "https://pharmaverse.github.io/blog/session_info.html"

return(markdown_link(text, path))
}



# top level function ------------------------------------------------------

insert_appendix <- function(repo_spec, name, collection = "posts", file_name) {
appendices <- paste(
markdown_appendix(
name = "Last updated",
content = insert_timestamp()
),
" ",
markdown_appendix(
name = "Details",
content = paste(
insert_source(repo_spec, name, collection, file_name = file_name),
# get renv information,
insert_lockfile(repo_spec, name, collection),
sep = ", "
)
),
sep = "\n"
)
knitr::asis_output(appendices)
}
Binary file added posts/2024-10-16_the__tensio.../cache_execution.rds
Binary file not shown.
26 changes: 26 additions & 0 deletions posts/2024-10-16_the__tensio.../mirai_workflow.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
library("mirai")
library("dplyr")
log_file <- tempfile()
mirai::daemons(4)
mirai::everywhere(
{
library("dplyr")
library("tidylog")
log_to_file <- function(txt) {
cat(txt,
file = log_file,
sep = "\n", append = TRUE
)
}
options(tidylog.display = list(message, log_to_file))
},
log_file = log_file
)
m <- mirai_map(letters[1:5], function(x) {
mutate(tibble(.rows = 1), `:=`("{x}", sample(1:100, 1)))
})
result <- bind_cols(m[])
mirai::daemons(0)
print(list(logs = readLines(log_file), result = result))
}
171 changes: 171 additions & 0 deletions posts/2024-10-16_the__tensio.../mirai_workflow.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
--------------------------------------------------------------------------------
- logrx Metadata -
--------------------------------------------------------------------------------
This log was generated using logrx 0.3.1
logrx package version: 0.3.1
logrx build: RSPM (R 4.3.0)
logrx link to repository: https://github.com/pharmaverse/logrx
--------------------------------------------------------------------------------
- User and File Information -
--------------------------------------------------------------------------------
User: ale
File Name: mirai_workflow.R
File Path: /home/ale/blog/posts/zzz_DO_NOT_EDIT_the__tensio...
File HashSum: 93e86d1e6a59ab5475d3c9fbd1948be36228a1fe
--------------------------------------------------------------------------------
- Session Information -
--------------------------------------------------------------------------------
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 4.3.2 (2023-10-31)
os Ubuntu 22.04.3 LTS
system x86_64, linux-gnu
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Etc/UTC
date 2024-10-07
pandoc 3.1.1 @ /usr/lib/rstudio-server/bin/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
backports 1.4.1 2021-12-13 [1] RSPM (R 4.3.0)
callr 3.7.3 2022-11-02 [1] RSPM (R 4.3.0)
cli 3.6.2 2023-12-11 [1] RSPM (R 4.3.0)
crayon 1.5.2 2022-09-29 [1] RSPM (R 4.3.0)
cyclocomp 1.1.1 2023-08-30 [1] RSPM (R 4.3.0)
data.table 1.15.0 2024-01-30 [1] RSPM (R 4.3.0)
desc 1.4.3 2023-12-10 [1] RSPM (R 4.3.0)
digest 0.6.34 2024-01-11 [1] RSPM (R 4.3.0)
dplyr * 1.1.4 2023-11-17 [1] RSPM (R 4.3.0)
evaluate 0.23 2023-11-01 [1] RSPM (R 4.3.0)
fansi 1.0.6 2023-12-08 [1] RSPM (R 4.3.0)
fastmap 1.2.0 2024-05-15 [1] RSPM (R 4.3.0)
generics 0.1.3 2022-07-05 [1] RSPM (R 4.3.0)
glue 1.7.0 2024-01-09 [1] RSPM (R 4.3.0)
htmltools 0.5.7 2023-11-03 [1] RSPM (R 4.3.0)
htmlwidgets 1.6.4 2023-12-06 [1] RSPM (R 4.3.0)
httpuv 1.6.15 2024-03-26 [1] RSPM (R 4.3.0)
jsonlite 1.8.8 2023-12-04 [1] RSPM (R 4.3.0)
knitr 1.45 2023-10-30 [1] RSPM (R 4.3.0)
later 1.3.2 2023-12-06 [1] RSPM (R 4.3.0)
lazyeval 0.2.2 2019-03-15 [1] RSPM (R 4.3.0)
lifecycle 1.0.4 2023-11-07 [1] RSPM (R 4.3.0)
lintr 3.1.2 2024-03-25 [1] RSPM (R 4.3.0)
logrx 0.3.1 2024-04-12 [1] RSPM (R 4.3.0)
magrittr 2.0.3 2022-03-30 [1] RSPM (R 4.3.0)
mime 0.12 2021-09-28 [1] RSPM (R 4.3.0)
miniUI 0.1.1.1 2018-05-18 [1] RSPM (R 4.3.0)
mirai * 1.2.0 2024-08-18 [1] RSPM (R 4.3.0)
nanonext 1.2.1 2024-08-19 [1] RSPM (R 4.3.0)
pillar 1.9.0 2023-03-22 [1] RSPM (R 4.3.0)
pkgconfig 2.0.3 2019-09-22 [1] RSPM (R 4.3.0)
processx 3.8.3 2023-12-10 [1] RSPM (R 4.3.0)
promises 1.3.0 2024-04-05 [1] RSPM (R 4.3.0)
ps 1.7.6 2024-01-18 [1] RSPM (R 4.3.0)
purrr 1.0.2 2023-08-10 [1] RSPM (R 4.3.0)
R6 2.5.1 2021-08-19 [1] RSPM (R 4.3.0)
Rcpp 1.0.12 2024-01-09 [1] RSPM (R 4.3.0)
remotes 2.5.0 2024-03-17 [1] RSPM (R 4.3.0)
rex 1.2.1 2021-11-26 [1] RSPM (R 4.3.0)
rlang 1.1.3 2024-01-10 [1] RSPM (R 4.3.0)
rmarkdown 2.28 2024-08-17 [1] RSPM (R 4.3.0)
rstudioapi 0.15.0 2023-07-07 [1] RSPM (R 4.3.0)
sessioninfo 1.2.2 2021-12-06 [1] RSPM (R 4.3.0)
shiny 1.9.1 2024-08-01 [1] RSPM (R 4.3.0)
stringi 1.8.3 2023-12-11 [1] RSPM (R 4.3.0)
stringr 1.5.1 2023-11-14 [1] RSPM (R 4.3.0)
tibble 3.2.1 2023-03-20 [1] RSPM (R 4.3.0)
tidyr 1.3.1 2024-01-24 [1] RSPM (R 4.3.0)
tidyselect 1.2.0 2022-10-10 [1] RSPM (R 4.3.0)
utf8 1.2.4 2023-10-22 [1] RSPM (R 4.3.0)
vctrs 0.6.5 2023-12-01 [1] RSPM (R 4.3.0)
waiter 0.2.5 2022-01-03 [1] RSPM (R 4.3.0)
withr 3.0.0 2024-01-16 [1] RSPM (R 4.3.0)
xfun 0.42 2024-02-08 [1] RSPM (R 4.3.0)
xml2 1.3.6 2023-12-04 [1] RSPM (R 4.3.0)
xtable 1.8-4 2019-04-21 [1] RSPM (R 4.3.0)
yaml 2.3.8 2023-12-11 [1] RSPM (R 4.3.0)

[1] /usr/local/lib/R/site-library
[2] /usr/local/lib/R/library

─ External software ──────────────────────────────────────────────────────────
setting value
cairo 1.16.0
cairoFT
pango 1.50.6
png 1.6.37
jpeg 8.0
tiff LIBTIFF, Version 4.3.0
tcl
curl 7.81.0
zlib 1.2.11
bzlib 1.0.8, 13-Jul-2019
xz 5.2.5
PCRE 10.39 2021-10-29
ICU 70.1
TRE TRE 0.8.0 R_fixes (BSD)
iconv glibc 2.35
readline 8.1
BLAS /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3

lapack /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so
lapack_version 3.10.0

─ Python configuration ───────────────────────────────────────────────────────
Python is not available

──────────────────────────────────────────────────────────────────────────────
--------------------------------------------------------------------------------
- Masked Functions -
--------------------------------------------------------------------------------
function `plot` from {package:base} by package:graphics
function `body<-` from {package:base} by package:methods
function `kronecker` from {package:base} by package:methods
--------------------------------------------------------------------------------
- Used Package and Functions -
--------------------------------------------------------------------------------
{!!! NOT FOUND !!!} `:=`
{package:base} library, tempfile, cat, options, list, print, readLines
{package:dplyr} mutate, bind_cols
{package:mirai} daemons, everywhere, mirai_map
{package:tidyr} tibble
--------------------------------------------------------------------------------
- Program Run Time Information -
--------------------------------------------------------------------------------
Start time: 2024-10-07 22:16:34 UTC
End time: 2024-10-07 22:16:36 UTC
Run time: 2 seconds
--------------------------------------------------------------------------------
- Errors and Warnings -
--------------------------------------------------------------------------------
Errors:


Warnings:

--------------------------------------------------------------------------------
- Messages, Output, and Result -
--------------------------------------------------------------------------------

Result:
$logs
[1] "mutate: new variable 'b' (character) with one unique value and 0% NAmutate: new variable 'a' (character) with one unique value and 0% NA"
[2] ""
[3] "mutate: new variable 'd' (character) with one unique value and 0% NA"
[4] "mutate: new variable 'e' (character) with one unique value and 0% NA"
[5] "mutate: new variable 'c' (character) with one unique value and 0% NA"

$result
# A tibble: 1 × 5
a b c d e
<chr> <chr> <chr> <chr> <chr>
1 foo foo foo foo foo

--------------------------------------------------------------------------------
- Log Output File -
--------------------------------------------------------------------------------
Log name: mirai_workflow.log
Log path: /home/ale/blog/posts/zzz_DO_NOT_EDIT_the__tensio...
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1ba0e3b

Please sign in to comment.