Skip to content

add bio helper utility#1055

Open
samhita-alla wants to merge 8 commits into
mainfrom
bio-task-wrapper
Open

add bio helper utility#1055
samhita-alla wants to merge 8 commits into
mainfrom
bio-task-wrapper

Conversation

@samhita-alla
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread examples/shell/01_basic.py Outdated
@k1sauce
Copy link
Copy Markdown
Contributor

k1sauce commented May 13, 2026

@samhita-alla some small fixes #1062 and adding a defaults={...} parameter on shell.create()

samhita-alla added a commit that referenced this pull request May 13, 2026
)

Stacked on top of #1055 — depends on the shell extra introduced there.

## Summary

- New `defaults={...}` parameter on `shell.create()` — per-input
fallback values applied when the caller omits an input, independent of
`T | None` (which controls flag suppression).
- Three rendering bugs found while building a `bedtools intersect`
wrapper:
- Positional indices ≥ 10 emitted as bare `$10`; bash parses that as
`$1` + literal `"0"`. Tasks with 10+ scalar/bool inputs had values 10..N
silently corrupted. Fixed by always-braced `${10}`.
- Optional File / Dir flags emitted unconditionally — the renderer
hardcoded `-flag /var/inputs/name` regardless of whether the caller
supplied the file. Now guarded with `if [ -e <path> ]; then …; else
<flag>=""; fi`.
- Inputs whose names differ only in case (e.g. `c` vs `C`, common in bio
CLIs) collided on the same `_VAL_*`/`_FLAG_*` bash variable and silently
overwrote each other. `create()` now rejects this at declaration time.
- New `examples/shell/12_bedtools_intersect_example.py` +
`examples/shell/modules/bedtools_intersect.py` demonstrating a
wider-flag-surface bedtools wrapper as a reference. This should probably
just go in your plugins but leaving for your reference.

## Test plan

- [x] 146 unit tests pass (28 new across the four areas above)
- [x] Local Docker run of the bedtools example produces correct output
for \`wa\`, \`v\`, \`count_overlaps\` against a small BED fixture
- [ ] Remote run against demo cluster (needs the dev wheel to land on
the cluster)

---------

Signed-off-by: Kyle Hazen <kyle@union.ai>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Co-authored-by: Samhita Alla <aallasamhita@gmail.com>
samhita-alla added a commit that referenced this pull request May 13, 2026
)

Stacked on top of #1055 — depends on the shell extra introduced there.

## Summary

- New `defaults={...}` parameter on `shell.create()` — per-input
fallback values applied when the caller omits an input, independent of
`T | None` (which controls flag suppression).
- Three rendering bugs found while building a `bedtools intersect`
wrapper:
- Positional indices ≥ 10 emitted as bare `$10`; bash parses that as
`$1` + literal `"0"`. Tasks with 10+ scalar/bool inputs had values 10..N
silently corrupted. Fixed by always-braced `${10}`.
- Optional File / Dir flags emitted unconditionally — the renderer
hardcoded `-flag /var/inputs/name` regardless of whether the caller
supplied the file. Now guarded with `if [ -e <path> ]; then …; else
<flag>=""; fi`.
- Inputs whose names differ only in case (e.g. `c` vs `C`, common in bio
CLIs) collided on the same `_VAL_*`/`_FLAG_*` bash variable and silently
overwrote each other. `create()` now rejects this at declaration time.
- New `examples/shell/12_bedtools_intersect_example.py` +
`examples/shell/modules/bedtools_intersect.py` demonstrating a
wider-flag-surface bedtools wrapper as a reference. This should probably
just go in your plugins but leaving for your reference.

## Test plan

- [x] 146 unit tests pass (28 new across the four areas above)
- [x] Local Docker run of the bedtools example produces correct output
for \`wa\`, \`v\`, \`count_overlaps\` against a small BED fixture
- [ ] Remote run against demo cluster (needs the dev wheel to land on
the cluster)

---------

Signed-off-by: Kyle Hazen <kyle@union.ai>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Co-authored-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
)

Stacked on top of #1055 — depends on the shell extra introduced there.

## Summary

- New `defaults={...}` parameter on `shell.create()` — per-input
fallback values applied when the caller omits an input, independent of
`T | None` (which controls flag suppression).
- Three rendering bugs found while building a `bedtools intersect`
wrapper:
- Positional indices ≥ 10 emitted as bare `$10`; bash parses that as
`$1` + literal `"0"`. Tasks with 10+ scalar/bool inputs had values 10..N
silently corrupted. Fixed by always-braced `${10}`.
- Optional File / Dir flags emitted unconditionally — the renderer
hardcoded `-flag /var/inputs/name` regardless of whether the caller
supplied the file. Now guarded with `if [ -e <path> ]; then …; else
<flag>=""; fi`.
- Inputs whose names differ only in case (e.g. `c` vs `C`, common in bio
CLIs) collided on the same `_VAL_*`/`_FLAG_*` bash variable and silently
overwrote each other. `create()` now rejects this at declaration time.
- New `examples/shell/12_bedtools_intersect_example.py` +
`examples/shell/modules/bedtools_intersect.py` demonstrating a
wider-flag-surface bedtools wrapper as a reference. This should probably
just go in your plugins but leaving for your reference.

## Test plan

- [x] 146 unit tests pass (28 new across the four areas above)
- [x] Local Docker run of the bedtools example produces correct output
for \`wa\`, \`v\`, \`count_overlaps\` against a small BED fixture
- [ ] Remote run against demo cluster (needs the dev wheel to land on
the cluster)

---------

Signed-off-by: Kyle Hazen <kyle@union.ai>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Co-authored-by: Samhita Alla <aallasamhita@gmail.com>
(cherry picked from commit f53a8bc)
@samhita-alla samhita-alla marked this pull request as ready for review May 13, 2026 05:52
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
Signed-off-by: Samhita Alla <aallasamhita@gmail.com>
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