-
Notifications
You must be signed in to change notification settings - Fork 69
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
update templates #2193
update templates #2193
Conversation
@dgrassellyb @manciniedoardo Hi all I raised this in the previous PR. I don't think we should be using What was wrong with the previous |
oh also could i get taken off the PR review auto-assignment? I think @kaz462 should take my place |
I believe @dgrassellyb needed to change something to get the templates to update pharmaverseadam? A
I don't know if this is a massive issue. If users are running the template for the first time then the first thing they'll usually do is alter those final lines of code to save the resulting dataset wherever they need it? |
Hi @bms63 I will remove you from the automatic PR reviewers, sorry for the spam ! |
I actually don't think they will alter any lines - they will just run the entire code and see what happens - this is what I would do. They could end making datasets in their study folders and since we just use standard ADaM names overwrite their study datasets. Apologies for being nitpicky on this but I really don't think we should assume a user is going to change this part of the template. There is so much code already for them to work through. @dgrassellyb I don't fully understand your solution. I'd prefer not to alter the template code. Could you inject/delete some temporary code into the templates to help you with your workflow? |
My solution would be the following before saving results to the folder:
GITHUB_ACTIONS is an env variable defined from github workflows (we are already using this kind of logic in some other workflows to make distinction between local exec / user local env |
Hmmm, not sure I like this being at the bottom of the template - this could indeed confuse users i feel. |
@bms63 / @manciniedoardo I will create an issue and make some updates to handle this from the workflow (so putting back also temp dir) |
Thanks @dgrassellyb ! |
@manciniedoardo / @bms63 : (I am not completely aware of the final use of these data from users but it seems complex I guess to navigate every subfolders to get the produced data.. ) |
Just making also a quick test but something to consider also but tempdir() is creating a temporary folder that will be deleted after the R session - it seems that it is the behavior of tempdir func :
it will be only available during the R session (during the template execution) and then erased at the end (so we are not keeping rda data) (I don't know if it's a behavior depending of users os but it's what's happening for me)
(I made some tests and templates_data is not removed after R session) (and naming it templates_data would allow to get data in a fixed path and not with random ids generated) |
I think the intention of using |
If the files do get overwritten, then they should represent an up-to-date dataset at all times if the code and content is truly reproducible. In effect, if a user does overwrite content in that directory, the content shouldn't really change. Moreover, if a content is being written to a temporary directory, and if retention is specified, it'll lead to crowding of data on disk and could potentially lead to the user running out of disk space if this happens very frequently. Lastly, temporary directory locations are very difficult to infer during a GitHub Actions workflow, as @dgrassellyb mentioned in #2193 (comment). This PR proposes the deterministic locations for easier and definitive inference. |
There are two use cases for the templates. The primary use case is providing a starting point for an ADaM script. By default it should not overwrite or add anything to the user's directory. It should be a conscious decision of the user to write something to the directory. The secondary use case is to create the ADaM datasets in pharmaverseadam via a workflow. I would prefer to keep the template code as it is and modify the template on the fly when running it in the workflow. Is this possible? |
Maybe let's follow @dgrassellyb's advice here about tracking this in a separate issue. One possible solution has already been proposed. |
Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.
Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the
devel
branch until you have checked off each task.styler::style_file()
to style R and Rmd filesdevtools::document()
so all.Rd
files in theman
folder and theNAMESPACE
file in the project root are updated appropriatelyNEWS.md
under the header# admiral (development version)
if the changes pertain to a user-facing function (i.e. it has an@export
tag) or documentation aimed at users (rather than developers)pkgdown::build_site()
and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.lintr::lint_package()
R CMD check
locally and address all errors and warnings -devtools::check()