-
Notifications
You must be signed in to change notification settings - Fork 2
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
Include checks for data version, branch, sha and data hash in template script #129
Changes from all commits
fa6d0d1
0d53b21
e5e79a0
ce380af
b9e0d3c
410aacc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,10 +117,20 @@ remotes::install_git(file.path('cavd', 'Studies', 'cvdNNN', 'pdata', 'VDCNNN.git | |
lib = my_data_package_lib) | ||
``` | ||
|
||
```{r check_data_version} | ||
DataPackageR::assert_data_version("VDCNNNAnalysis",version_string = "data_version") | ||
testthat::expect_equal(packageDescription("VDCNNNAnalysis")$RemoteSha,"commit_sha") | ||
testthat::expect_equal(packageDescription("VDCNNNAnalysis")$RemoteRef,"branch_name") | ||
|
||
``` | ||
|
||
|
||
```{r data-processing} | ||
# For this template use VISCfunction example data | ||
data('exampleData_ICS', package = 'VISCfunctions', envir = environment()) | ||
|
||
testthat::expect_equal(digest::digest(exampleData_ICS),"data_hash") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. We can replace lines 114-116 with:
In case the data object (exampleData_ICS) is modified without being assigned a new name before the reproducibility table at the end, I would create the data_hash object immediately after loading in the data and call that in the reproducibility table. |
||
|
||
ICS_adata <- exampleData_ICS %>% | ||
filter(Population == "IFNg" & Group != 3) | ||
``` | ||
|
@@ -369,8 +379,9 @@ if (any(installed.packages()[,1] == 'rmarkdown')) suppressWarnings(library(rmark | |
|
||
my_session_info <- VISCfunctions::get_session_info() | ||
|
||
kable( | ||
my_session_info$platform_table, | ||
my_session_info$platform_table %>% | ||
add_row(name = "data hash", value = digest::digest(exampleData_ICS), .before = nrow(.)) %>% | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. replace 366 with lines:
|
||
kable( | ||
format = output_type, | ||
booktabs = TRUE, | ||
linesep = "", | ||
|
@@ -380,8 +391,17 @@ kable( | |
``` | ||
|
||
```{r Software-Package-Version-Information, results="asis", warning=kable_warnings} | ||
my_session_info$packages_table %>% | ||
left_join( | ||
sessioninfo::package_info() %>% filter(str_detect(source, pattern = "git2r")) %>% | ||
pull(package) %>% | ||
packageDescription() %>% | ||
.[c("Package","RemoteRef")] %>% | ||
as_tibble() %>% | ||
rename("package" = "Package", | ||
"branch" = "RemoteRef"), | ||
by = "package") %>% | ||
kable( | ||
my_session_info$packages_table, | ||
format = output_type, | ||
booktabs = TRUE, | ||
linesep = "", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if: instead of having a spot where the SRA manually includes the
commit_sha
andbranch_name
(which would still not be visible from the knitted PDF) it would make more sense to assign these values and add them in the reproducibility table at the end (next to thedata_hash
). i.e. lines 106-107 would be replaced with:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editing this further... shouldn't this be for the datapackage not for the analysis folder (since the analysis folder is not a package):