General Issue: Verify template results #2642
Replies: 15 comments 2 replies
-
I would be hesitant to make these into unit tests as they are very big files to run. The current CI check for the templates is a separate workflow. I was thinking we would build off that one - pharmaverse/admiralci/.github/workflows/check-templates.yml@main |
Beta Was this translation helpful? Give feedback.
-
I see your point. |
Beta Was this translation helpful? Give feedback.
-
What about how Edoardo approached that new check in the blog? He sources a file in the workflow - maybe something to consider? Then you could grab the file and run it |
Beta Was this translation helpful? Give feedback.
-
Yeah that would not be a bad idea. Let me experiment a bit. |
Beta Was this translation helpful? Give feedback.
-
We could implement a function which runs a specified list of templates and compares the results with the references datasets (in pharmaverseadam?). This function could then be used in the CI/CD workflow and also be called locally. |
Beta Was this translation helpful? Give feedback.
-
That sounds like a good idea. |
Beta Was this translation helpful? Give feedback.
-
So - pharmaverseadam got re-deployed last week so things might not line up that well with this method going forward. Feels like it is getting decoupled form admiral. I think we should compare templates runs via stuff in main and stuff in a branch. Could this action just run if code in the templates is updated in the branch? I feel like that is possible ???? |
Beta Was this translation helpful? Give feedback.
-
@bms63
Which gives us the following keys:
|
Beta Was this translation helpful? Give feedback.
-
Thanks! I’ll start making a list of our datasets and potential keys |
Beta Was this translation helpful? Give feedback.
-
@bms63 just FYI @jimrothstein has approached me to take this over, with some more input from my side. |
Beta Was this translation helpful? Give feedback.
-
No progress from my end, but eager to set this up as it causes a lot of consternation. Actually looking to do something similar in the Pliot R Submissions as well |
Beta Was this translation helpful? Give feedback.
-
Converting this to a discussion and will link in the Roadmap |
Beta Was this translation helpful? Give feedback.
-
Trying to collect some thoughts here, please feel free to chime in: I see two ways of going about:
Strategies to speed up:
How to compare
|
Beta Was this translation helpful? Give feedback.
-
I have attached the admiralroche script which runs templates and compares them with reference datasets.
|
Beta Was this translation helpful? Give feedback.
-
@StefanThoma @bms63 @manciniedoardo My notes jim *“Drop a goat exactly equidistant between 2 identical stacks of hay. The admiral_verify_templates.RToday’s Objectives
Useful Code Linksolder PR: #2662 latest GHA workflow: create_adams_data.R (re-generate and save ADaMs by calling each Status - overallThe script does run and produce output, as does the GHA workflow. But it Stefan has been extremely helpful but his availability is limited. I list several types of issues below. But the real problem, IMHO, is I Also, helpful: Itemize and prioritize todo/specification list, before coding? BackgroundBecause of overlap, the R file admiral_verify_templates.R inherited some However, I had hoped to “improve” the pharamaverseadam code by This is still a Script Usage?Pls clarify - Triggers to run GHA? (branch, PR) - Will developer modify intermediate filesNOW: Intermediate files are now stored in several temporary Proposed: Store intermediate results in permanent directories. Cleanup Related - Use tibble, not listsCurrently, using several names lists (for each ADaM, list for templates, Example:
REF: admiral/data-raw/admiral_verify_templates.R Lines 16 to 23 in 55c003d Propose Use tibble as lookup. One row for each ADaM, columns for USE RDS, not RDA?`load(dataset) puts symbol in environment. Need a few lines of code to non-intuitive example (to me): better? save(mtcars, file="mt.rda")
f <- function() { get(load("mt.rda"))}
f() |> head(n=3) .rda files are used in templates and put into user’s cache dir (os admiral/inst/templates/ad_adae.R Lines 149 to 157 in 9052fc3 Propose: Can we use RDS? GHA workflows
To pin down exact rda file changes, I am working through things like:
Unit testsNeeds unit tests. And more feedback from USER. diffdf
Use of key fields; removed Minor Issues, code checks?
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background Information
It would be ideal to have a way to verify whether the outputs of the templates have changed.
One idea would be to write unit tests, so that running the unit tests would already check that.
I think it could be done like this in a unit test:
Definition of Done
Either find a way of verifying the outputs of the templates, or to decide that this is not necessary.
Beta Was this translation helpful? Give feedback.
All reactions