Add input validation to make_intervention()
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Find the definition of make_intervention() and read its existing sdlog validation alongside the suggested checks in the issue. Run the related tests for this function, then add checks for the listed inputs and verify that invalid values fail with clear errors while valid inputs still work.
Written by the indexing model from the issue text.
Description
Raised by @tbreweric in #142.
make_intervention() currently builds the intervention list without validating its inputs (only sdlog is checked). Many problems are probably caught by downstream functions, but basic checks here would fail earlier, with clearer errors, and reduce the work those functions have to do.
Suggested checks (from Tom):
stopifnot(
is.character(name),
length(name) == 1L,
!is.na(name),
nzchar(name),
is.logical(delta_depends_on_baseline_ach),
length(delta_depends_on_baseline_ach) == 1L,
!is.na(delta_depends_on_baseline_ach),
is.function(delta_function),
is.list(delta_params),
is.logical(variation),
length(variation) == 1L,
!is.na(variation),
!variation || is.function(variation_function),
is.list(variation_params),
is.numeric(coverage),
length(coverage) == 1L,
!is.na(coverage),
is.finite(coverage),
coverage >= 0,
coverage <= 1
)
- Dominant language
- R
- Stars
- 8
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from petal-code/helios
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
petal-code/helios#173 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
petal-code/helios#166 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
petal-code/helios#161 ·
-
run_simulation() is not reproducible from seed: the leisure draw uses dqrng's own RNGPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
petal-code/helios#157 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
petal-code/helios#175 ·
All issues in petal-code/helios
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Open-Systems-Pharmacology/OSPSuite.Core#3049 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
NovoNordisk-OpenSource/mighty#88 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
beginner-task
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Rdatatable/data.table#7948 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
datacarpentry/semester-biology#1294 ·
Maintainers usually reply within 1 day