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

Include checks for data version, branch, sha and data hash in template script #129

Closed
wants to merge 6 commits into from

Conversation

Sal4321
Copy link

@Sal4321 Sal4321 commented Feb 28, 2024

Resolved issue #108

@Sal4321 Sal4321 requested review from asatofh and mayerbry February 28, 2024 23:40
@valduran18 valduran18 marked this pull request as draft February 28, 2024 23:43
@valduran18
Copy link
Contributor

added data hash and installed DPR branch name to reproducibility table. Relates to issue #130

@mayerbry mayerbry requested a review from lemireg February 29, 2024 19:10
@valduran18 valduran18 marked this pull request as ready for review February 29, 2024 19:38
@kelliemac kelliemac requested a review from mayerbry March 19, 2024 22:01
Copy link

@lemireg lemireg left a 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")

Copy link

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

Copy link

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")
Copy link

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(.)) %>%
Copy link

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(.)) %>%

@slager
Copy link
Contributor

slager commented Sep 6, 2024

Closing this PR for now per VISCtemplates working group discussion on 5 Sept. This check is now mostly addressed by use of visc_load_pdata().

@slager slager closed this Sep 6, 2024
@slager
Copy link
Contributor

slager commented Sep 6, 2024

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.

@slager slager deleted the sha branch September 6, 2024 21:20
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.

4 participants