-
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
Conversation
added data hash and installed DPR branch name to reproducibility table. Relates to issue #130 |
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.
Let me know if you'd like me to go in and make these changes, or if @valduran18 or @Sal4321 want to (and if you agree with them of course). Thanks!
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") | ||
|
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
and branch_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 the data_hash
). i.e. lines 106-107 would be replaced with:
commit_sha <- packageDescription("VDCNNNAnalysis")$RemoteSha
branch_name <- packageDescription("VDCNNNAnalysis")$RemoteRef
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):
commit_sha <- packageDescription("VDCNNN")$RemoteSha
branch_name <- packageDescription("VDCNNN")$RemoteRef
```{r data-processing} | ||
# For this template use VISCfunction example data | ||
data(exampleData_ICS) | ||
|
||
testthat::expect_equal(digest::digest(exampleData_ICS),"data_hash") |
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.
Same here. We can replace lines 114-116 with:
exampleData_ICS <- visc_load_pdata(exampleData_ICS, proj_or_datapackage = "datapackage", criteria = "SRA_enter_data_hash")
data_hash <- digest::digest(exampleData_ICS)
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
replace 366 with lines:
add_row(name = "data hash", value = data_hash, .before = nrow(.)) %>%
add_row(name = "branch", value = branch_name, .before = nrow(.)) %>%
add_row(name = "commit", value = commit_sha, .before = nrow(.)) %>%
Closing this PR for now per VISCtemplates working group discussion on 5 Sept. This check is now mostly addressed by use of |
Deleting branch for now to tidy up the repo, but it can be un-deleted in the future from this page if we want to bring this back. |
Resolved issue #108