-
Notifications
You must be signed in to change notification settings - Fork 287
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
[ENH] Dynamic citation boilerplate #1024
Conversation
Compose a citation boilerplate in a per-workflow basis, with up-to-date software versions and generated based on the actual workflows being run.
I have a feeling this would be very challenging to do if the goal is to provide a snippet of text ready to paste into the manuscript. A solution based on conditional statements mirroring the one we did on the website might be easier to implement (even though harder to maintain). |
IMHO implementation is fairly natural since each For this PR I didn't get to the bottom and generate the exact citation boilerplate we have currently online just for laziness, but this prototype is able to do that already. I think we could leverage duecredit to generate the lookup table of references (@yarikoptic can correct me if I'm wrong). On the other hand, I see some positive side effects:
I'll let this sit here while I focus on more urgent issues. |
Hey @satra, what do you think about this extension to nipype?. Particularly the magic: |
@oesteban - i think this a reasonable starting point that could then be edited by a human. i agree with @chrisfilo that this can get complicated. but this is at least a simple mechanism by which certain workflows could be described. how about adding a flag to allow ignoring nested workflows. |
Seems like a good idea. |
Ready for review! |
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.
The display looks off for Markdown and LaTeX:
Also, the text indicates that CIFTI files were created for all of the test datasets, which I think we only do for one dataset. So we may not be handling some conditionals properly.
docs/contributors.rst
Outdated
Once all the sub-workflows of a given workflow have | ||
been visited, then the ``__postdesc__`` attribute is appended | ||
and the execution pops out to higher level workflows. | ||
The dunder attributes are written in Markup language, and may contain |
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.
Markdown?
@@ -1,5 +1,7 @@ | |||
fmriprep | |||
fmriprep/logs | |||
fmriprep/logs/CITATION.html | |||
fmriprep/logs/CITATION.md |
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.
Add CITATION.tex
to expected outputs.
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.
Done!
workflow = Workflow(name=name) | ||
workflow.__desc__ = """\ | ||
The BOLD time-series were resampled on {tpl} standard space, | ||
generating a *preprocessed BOLD run on {tpl} space*. |
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.
s/on/in/
workflow = pe.Workflow(name=name) | ||
workflow = Workflow(name=name) | ||
workflow.__desc__ = """\ | ||
The BOLD time-series were resampled on {tpl} standard space, |
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.
s/on/to/
Yep, I'm working this out right now. |
Okay, with my last commit this should be ready to go.
This is how it looks now (locally, awaiting for tests in circle): |
@@ -92,6 +92,8 @@ def init_bold_surf_wf(mem_gb, output_spaces, medial_surface_nan, name='bold_surf | |||
workflow.__desc__ = """\ | |||
The BOLD time-series, were resampled to surfaces on the following | |||
spaces: {out_spaces}. | |||
*Grayordinates* files [@hcppipelines], which combine surface-sampled | |||
data and volume-sampled data, were also generated. |
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.
Do we want to make this conditional on cifti_output
? In which case, it might go better back in init_func_preproc_wf
, which has access to that variable.
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.
Thanks, I've just added it to init_func_preproc_wf
👍
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 good with this. You might want to update the GitHub Project, so that things done after 1.1.0 don't get accidentally labeled as such.
I'm merging this.
I'm assuming this comment is not meant to block merging the PR. I've opened #1229 to follow up on this problem. |
Compose a citation boilerplate in a per-workflow basis, with up-to-date software versions and generated based on the actual workflows being run.
This PR is more of a request for comments from @effigies, @chrisfilo.
Maybe this can be done already with duecredit (cc @yarikoptic), but the basic idea here is to place a mechanism to build literate descriptions of the workflow. My plan would be then collect all the references with duecredit.
How it works. Workflows in FMRIPREP will have a
__predesc__
and a__postdesc__
attributes (in this version the pre- dunder is just__desc__
as I was just prototyping). When writing a new workflow, these fields can be used to add the corresponding literate description of what that workflow does (allowing to dynamically replace version strings, optional parameters, etc).Let me know if you think this is worth exploring. The most challenging culprit happens with inhomogeneous datasets (e.g. fieldmap has
IntendedFor
only on 3 out of 5 runs). In that case the citation boilerplate will have two descriptions, as there's is not just one.Any comments will be very welcome.
EDIT
Results
This is how it looks
Links to more results
In the context of the reports