Skip to content

docs: Add documentation with example usage#27

Open
LKress wants to merge 1 commit intosnakemake:mainfrom
LKress:14-missing-documentation-how-to-use
Open

docs: Add documentation with example usage#27
LKress wants to merge 1 commit intosnakemake:mainfrom
LKress:14-missing-documentation-how-to-use

Conversation

@LKress
Copy link
Copy Markdown

@LKress LKress commented Mar 14, 2026

Add initial documentation with an example on how to use the plugin.

Closes #14

Summary by CodeRabbit

  • Documentation
    • Added an "Example setup" section showing how to configure the cluster-generic plugin with workflow variables embedded in cluster command arguments for custom cluster behavior.
    • Included a profile example demonstrating job submission and naming using rule-derived information for SLURM-style clusters.
    • Expanded the introduction to briefly describe the cluster-generic plugin’s role in submitting jobs to cluster systems.

@LKress LKress changed the title docs: Add documentation docs: Add documentation with example usage Mar 14, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 14, 2026

📝 Walkthrough

Walkthrough

Adds documentation for the cluster-generic plugin: a short mention in docs/intro.md and a new "Example setup" section in docs/further.md showing how to configure submit/cancel commands and embed workflow variables (e.g., {rule}, {threads}, {resources.mem_mb}) for a SLURM example.

Changes

Cohort / File(s) Summary
Documentation additions
docs/intro.md, docs/further.md
Adds a one-line description of the cluster-generic plugin to docs/intro.md and a new "Example setup" section in docs/further.md with a SLURM cluster-generic profile example (submit/cancel commands and variable interpolation patterns).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR partially addresses issue #14 by adding example documentation and explaining cluster-generic plugin usage, but does not comprehensively address all user questions about resource definition, command configuration methods, or non-SLURM cluster specifics. Ensure documentation clarifies how to define resources in config files, whether status/cancel commands can be configured via config, and provides examples for non-SLURM clusters like LSF as requested in issue #14.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: Add documentation with example usage' accurately summarizes the main change - adding documentation with examples for the cluster-generic plugin usage.
Out of Scope Changes check ✅ Passed All changes are within scope: docs/intro.md and docs/further.md additions directly address the documentation requirement from issue #14 without introducing unrelated code modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/further.md (1)

1-10: Consider adding a note about command-line usage.

The example shows a profile-based configuration, which addresses the Issue #14 question about config files. Consider adding a brief note mentioning that these settings can also be provided as command-line arguments (e.g., --executor cluster-generic --cluster-generic-submit-cmd "..."), which would provide users with both configuration approaches.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/further.md` around lines 1 - 10, Add a brief note under the Example
setup that, besides profile files, the same options can be supplied on the
command line; mention the relevant symbols such as executor,
cluster-generic-submit-cmd and cluster-generic-cancel-cmd and show that users
can pass them via flags (for example using --executor and
--cluster-generic-submit-cmd) so readers know both the profile and CLI
approaches are supported.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/further.md`:
- Line 4: Replace the misspelled word "followig" with "following" in the
sentence that introduces the Snakemake profile example (the sentence containing
"The followig example Snakemake profile..."), ensuring the rest of the sentence
remains unchanged so it reads "The following example Snakemake profile...".
- Around line 6-10: Update the fenced code block containing the executor and
cluster-generic settings so it includes a language identifier for syntax
highlighting (use "yaml"); locate the block that starts with the three backticks
followed by lines like "executor: cluster-generic", "cluster-generic-submit-cmd:
sbatch --cpus-per-task {threads} --mem={resources.mem_mb} --job-name=smk-{rule}
--parsable", and "cluster-generic-cancel-cmd: scancel", and change the opening
fence from ``` to ```yaml to enable proper rendering.

---

Nitpick comments:
In `@docs/further.md`:
- Around line 1-10: Add a brief note under the Example setup that, besides
profile files, the same options can be supplied on the command line; mention the
relevant symbols such as executor, cluster-generic-submit-cmd and
cluster-generic-cancel-cmd and show that users can pass them via flags (for
example using --executor and --cluster-generic-submit-cmd) so readers know both
the profile and CLI approaches are supported.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3fef6052-8e97-487f-97cf-0aabd772828f

📥 Commits

Reviewing files that changed from the base of the PR and between ce5fc82 and f247867.

📒 Files selected for processing (2)
  • docs/further.md
  • docs/intro.md

docs/further.md Outdated
### Example setup

The cluster generic plugin enables access to workflow variables (such as `rule`, `resources`, or `threads`) within the strings used to define cluster generic plugin arguments.
This makes it possible to create custom configurations for running workflows on various cluster systems that support a submission command accepting the path to a job script. The followig example Snakemake profile (see [Profiles](https://snakemake.readthedocs.io/en/stable/executing/cli.html#profiles)) shows this for a custom SLURM execution configuration setup. Submitting jobs with this setup would result in having the rule name of the current job contained in the SLURM job name.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix typo: "followig" → "following".

There's a spelling error in the word "following".

📝 Proposed fix
-This makes it possible to create custom configurations for running workflows on various cluster systems that support a submission command accepting the path to a job script. The followig example Snakemake profile (see [Profiles](https://snakemake.readthedocs.io/en/stable/executing/cli.html#profiles)) shows this for a custom SLURM execution configuration setup. Submitting jobs with this setup would result in having the rule name of the current job contained in the SLURM job name.
+This makes it possible to create custom configurations for running workflows on various cluster systems that support a submission command accepting the path to a job script. The following example Snakemake profile (see [Profiles](https://snakemake.readthedocs.io/en/stable/executing/cli.html#profiles)) shows this for a custom SLURM execution configuration setup. Submitting jobs with this setup would result in having the rule name of the current job contained in the SLURM job name.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
This makes it possible to create custom configurations for running workflows on various cluster systems that support a submission command accepting the path to a job script. The followig example Snakemake profile (see [Profiles](https://snakemake.readthedocs.io/en/stable/executing/cli.html#profiles)) shows this for a custom SLURM execution configuration setup. Submitting jobs with this setup would result in having the rule name of the current job contained in the SLURM job name.
This makes it possible to create custom configurations for running workflows on various cluster systems that support a submission command accepting the path to a job script. The following example Snakemake profile (see [Profiles](https://snakemake.readthedocs.io/en/stable/executing/cli.html#profiles)) shows this for a custom SLURM execution configuration setup. Submitting jobs with this setup would result in having the rule name of the current job contained in the SLURM job name.
🧰 Tools
🪛 LanguageTool

[grammar] ~4-~4: Ensure spelling is correct
Context: ...accepting the path to a job script. The followig example Snakemake profile (see [Profile...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/further.md` at line 4, Replace the misspelled word "followig" with
"following" in the sentence that introduces the Snakemake profile example (the
sentence containing "The followig example Snakemake profile..."), ensuring the
rest of the sentence remains unchanged so it reads "The following example
Snakemake profile...".

@LKress LKress force-pushed the 14-missing-documentation-how-to-use branch from f247867 to 74e704f Compare March 14, 2026 19:06
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/further.md`:
- Around line 3-10: Add a new short subsection under the cluster generic plugin
docs that explicitly answers the three acceptance points: explain that the
cluster-generic executor is adapter-agnostic and show how to replace the example
"sbatch" command with other schedulers (mention LSF's "bsub" as an example)
while keeping the {threads}/{resources.mem_mb}/{rule} placeholders; state that
required resources should be declared in the Snakemake rule blocks (resources:
mem_mb: ..., threads: ...) and referenced from the profile via
cluster-generic-submit-cmd placeholders; and clarify configuration precedence by
saying submit/status/cancel commands (cluster-generic-submit-cmd,
cluster-generic-cancel-cmd and any status command) are typically set in the
profile or config.yaml for reproducibility but can be overridden on the CLI,
referencing the executor: cluster-generic entry and the three cluster-generic-*
keys so readers know exactly where to change them.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3ee4368b-c785-4626-9ebf-59ef230f0edd

📥 Commits

Reviewing files that changed from the base of the PR and between f247867 and 74e704f.

📒 Files selected for processing (2)
  • docs/further.md
  • docs/intro.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/intro.md

Comment on lines +3 to +10
The cluster generic plugin enables access to workflow variables (such as `rule`, `resources`, or `threads`) within the strings used to define cluster generic plugin arguments.
This makes it possible to create custom configurations for running workflows on various cluster systems that support a submission command accepting the path to a job script. The following example Snakemake profile (see [Profiles](https://snakemake.readthedocs.io/en/stable/executing/cli.html#profiles)) shows this for a custom SLURM execution configuration setup. Submitting jobs with this setup would result in having the rule name of the current job contained in the SLURM job name.

```yaml
executor: cluster-generic
cluster-generic-submit-cmd: sbatch --cpus-per-task {threads} --mem={resources.mem_mb} --job-name=smk-{rule} --parsable
cluster-generic-cancel-cmd: scancel
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Documentation is still incomplete vs Issue #14 acceptance criteria.

This section adds a good SLURM example, but it does not yet answer the key “how to use” questions from the linked issue: (1) how to adapt for non-Slurm clusters (e.g., LSF), (2) where required resources should be defined, and (3) whether submit/status/cancel commands are configured in profile/config vs CLI. Please add a short subsection that explicitly covers those points so closing #14 is fully justified.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/further.md` around lines 3 - 10, Add a new short subsection under the
cluster generic plugin docs that explicitly answers the three acceptance points:
explain that the cluster-generic executor is adapter-agnostic and show how to
replace the example "sbatch" command with other schedulers (mention LSF's "bsub"
as an example) while keeping the {threads}/{resources.mem_mb}/{rule}
placeholders; state that required resources should be declared in the Snakemake
rule blocks (resources: mem_mb: ..., threads: ...) and referenced from the
profile via cluster-generic-submit-cmd placeholders; and clarify configuration
precedence by saying submit/status/cancel commands (cluster-generic-submit-cmd,
cluster-generic-cancel-cmd and any status command) are typically set in the
profile or config.yaml for reproducibility but can be overridden on the CLI,
referencing the executor: cluster-generic entry and the three cluster-generic-*
keys so readers know exactly where to change them.

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.

Missing documentation/ How to use

1 participant