Skip to content

create-params-file: include top-level schema parameters - #4619

Open
rpinho wants to merge 6 commits into
nf-core:devfrom
rpinho:fix-params-file-ungrouped
Open

rpinho wants to merge 6 commits into
nf-core:devfrom
rpinho:fix-params-file-ungrouped

Conversation

@rpinho

@rpinho rpinho commented Nov 16, 2026

Copy link
Copy Markdown

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

There's a bug in generate_params_file: it writes the parameters from the schema's grouped definitions but skips properties defined at the top level of the schema.

For a schema with {"properties": {"input": {"type": "string", "default": "reads.csv"}}}, nf-core pipelines create-params-file writes the header and no input entry. The commented template should have input: reads.csv.

This writes the top-level properties after the groups, under "Other parameters", so flat and mixed schemas get all their parameters.

Test: tests/pipelines/test_params_file_ungrouped.py (both schema drafts, grouped and hidden combinations) fails on dev, 8 of 8, and passes here; with tests/pipelines/test_params_file.py that is 12 passed. The pre-commit hooks pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

rpinho added a commit to rpinho/tools that referenced this pull request Nov 16, 2026
@mashehu

mashehu commented Nov 16, 2026

Copy link
Copy Markdown
Member

Please join the github org via the slack channel so the CI runs for you.

@rpinho

rpinho commented Nov 16, 2026

Copy link
Copy Markdown
Author

I'm in, thanks!

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.04%. Comparing base (41500d7) to head (46ac156).

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mashehu mashehu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks for the contribution. we don't really recommend ungrouped parameters in nf-core, that's why this might have slipped through

Comment thread nf_core/pipelines/params_file.py Resolved
@rpinho
rpinho requested a review from mashehu November 16, 2026 21:34

@mashehu mashehu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I made the tests a bit more like others in this repo.

Thanks for this contribution!

@rpinho

rpinho commented Nov 18, 2026

Copy link
Copy Markdown
Author

Thanks!

@mashehu

mashehu commented Nov 18, 2026

Copy link
Copy Markdown
Member

actually found another place where we use this and combined the logic now.

@mashehu
mashehu force-pushed the fix-params-file-ungrouped branch from ef5d418 to 5c40725 Compare November 18, 2026 14:19
@nf-core nf-core deleted a comment from codspeed Bot Nov 18, 2026
@nf-core nf-core deleted a comment from codspeed Bot Nov 18, 2026
@mashehu

mashehu commented Nov 18, 2026

Copy link
Copy Markdown
Member

feel free to merge, whenever you are happy 🙂

@codspeed

codspeed Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 30.76%

3 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ Upgrade your CodSpeed plugin for Python 3.15

pytest-codspeed 5.0.3 is only tested on Python 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14, so your Python 3.15 measurements may be inaccurate. Upgrade pytest-codspeed to 5.0.4 or later.

See affected benchmarks

⚠️ 9 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 9 improved benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_pipelines_schema_lint_startup 382.7 ms 283.8 ms +34.84%
⚡ test_cli_command_group_help_startup[subworkflows] 174.5 ms 131 ms +33.23%
⚡ test_pipelines_create_startup 998.2 ms 751 ms +32.91%
⚡ test_cli_help_startup 170.3 ms 129.5 ms +31.5%
⚡ test_import_main_startup 134.6 ms 103 ms +30.68%
⚡ test_modules_install_startup 2.3 s 1.8 s +28.88%
⚡ test_cli_command_group_help_startup[pipelines] 168.7 ms 131.1 ms +28.7%
⚡ test_cli_command_group_help_startup[test-datasets] 166.4 ms 129.3 ms +28.64%
⚡ test_cli_command_group_help_startup[modules] 171 ms 133.9 ms +27.63%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing rpinho:fix-params-file-ungrouped (46ac156) with dev (41500d7)

Open in CodSpeed

This branch has not been deployed

No deployments
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.

2 participants