Skip to content

Add docstrings to nextflow functions, modules, and workflows - #62

Merged
SkepticRaven merged 6 commits into
mainfrom
YODA-193-add-docstrings-to-nextflow-functions-modules-and-workflows
Sep 22, 2025
Merged

Add docstrings to nextflow functions, modules, and workflows#62
SkepticRaven merged 6 commits into
mainfrom
YODA-193-add-docstrings-to-nextflow-functions-modules-and-workflows

Conversation

@SkepticRaven

Copy link
Copy Markdown
Contributor

My attempt to meld javadoc style/intent into nextflow documentation.

Changes from javadoc:

  • tuple type structure. tuples adopt a YAML-style docstring to indicate contents of tuple.
  • Add @publish tag to indicate when a workflow or process publishes data outside its workdir.
  • Allow multiple @return tag, since nextflow is MIMO.
  • Added newline between tags to enhance readability.

Features that might be useful in docstrings but not added:

  • Global parameters (e.g. config param.*) used in processes/workflows not listed. javadoc has a @note tag, which could be used for noteworthy parameters.
  • File extension hints. nf-core has hints for extensions of files produced. This both doesn't make as much sense to our pipeline and doesn't have an appropriate field in javadoc.

Base automatically changed from remote-nextflow-hooks to main August 26, 2025 19:09
@SkepticRaven
SkepticRaven marked this pull request as ready for review August 26, 2025 19:11
@SkepticRaven SkepticRaven self-assigned this Aug 26, 2025
Comment thread nextflow/modules/utils.nf Outdated
Comment thread nextflow/modules/utils.nf
fi
else
echo "\${file} exists, adding to process list."
echo "\${file}" >> files_to_process.txt

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a missing fi after this else block?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also does the while loop need to be closed with a done ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both should be there, but github might be hiding your context.

This patch should have been separate, but it fixes behavior when you want to ignore invalid inputs -- it used to place the file in the list to process and would just crash later.

Comment thread nextflow/modules/jabs_classifiers.nf Outdated
* @param tuple
* - in_pose The input pose file.
* - feature_cache The directory containing the generated features.
* @param classifiers A map of classifier names to their respective parameters.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You document the tuples, it might be nice to document what the map looks like.

e.g.

@param classifiers A map where each entry contains:
  - key: classifier name (string)
  - value: object 🤷 

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

 * @param classifiers A map of classifiers:
 *  - classifier_name: a list of classifier parameter maps:
 *    - stitch_value: the gap size for stitching behavior bouts
 *    - filter_value: the minimum length for behavior bouts

I think the nested maps might get a bit verbose...

@SkepticRaven
SkepticRaven merged commit 026f81f into main Sep 22, 2025
3 checks passed
@SkepticRaven
SkepticRaven deleted the YODA-193-add-docstrings-to-nextflow-functions-modules-and-workflows branch September 22, 2025 13:10
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