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

Documentation: workflow.stats #4365

Closed
ewels opened this issue Oct 3, 2023 · 5 comments
Closed

Documentation: workflow.stats #4365

ewels opened this issue Oct 3, 2023 · 5 comments
Labels

Comments

@ewels
Copy link
Member

ewels commented Oct 3, 2023

I don't think that workflow.stats is documented anywhere. It was added way back in 2017 (see #534). It's used in a bunch of places in Nextflow itself, eg:

<% if ( workflow.success && workflow.stats.ignoredCount ){ %>

It'd be nice to document this under Workflow introspection.

@ewels ewels added the docs label Oct 3, 2023
@mribeirodantas
Copy link
Member

Quite interesting all these variables here: ./modules/nextflow/src/main/groovy/nextflow/trace/WorkflowStats.groovy. Now I know where Tower learns about this 😅

@pditommaso
Copy link
Member

This is an internal data structure, don't think it should be documented

@ewels
Copy link
Member Author

ewels commented Oct 4, 2023

Ok - use case on Slack was to detect if any errors had been ignored at the end of a run. Reason being to go past errorStrategy: finish - really go as far as possible in running the pipeline, but then exit 1 at the very end if any errors were ignored.

If not documenting workflow.stats, any possibility to make this summary info more accessible (documented) somehow?

@adamrtalbot
Copy link
Collaborator

really go as far as possible in running the pipeline, but then exit 1 at the very end if any errors were ignored.

This is a pretty useful feature. Imagine the scenario where you have 96 independent samples, if 1 fails and it brings the whole pipeline crashing down that's annoying, but if you use errorStrategy = 'ignore' then you have to write your own solution. We could have process.errorStrategy = 'catch'. This might be a separate ticket though.

Having some form of introspection on tasks in the workflow.onComplete block would also help for similar reasons and be more generally useful.

@ewels
Copy link
Member Author

ewels commented Oct 26, 2023

Closing, as no plans to document this for now. Might be something that turns up in the future if we ever spin up some (semi-) automated API docs for Nextflow. But it's a deliberate decision to omit from the prose docs for now.

@ewels ewels closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants