Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable passing #58

Closed
sbfnk opened this issue Nov 28, 2023 · 4 comments
Closed

Variable passing #58

sbfnk opened this issue Nov 28, 2023 · 4 comments

Comments

@sbfnk
Copy link
Contributor

sbfnk commented Nov 28, 2023

The model parameters are defined multiple times across the package. It would be good to have a single reference in the documentation and use @inheritParams elsewhere, and to pass variables via ... where appropriate rather than redefining which will make future extensions difficult.

@pearsonca
Copy link
Collaborator

n.b., switching to a ringbp::parameters() approach (per #65) might also deal with this handily.

@joshwlambert
Copy link
Collaborator

I've addressed the comment on inheriting documentation in ff399d1.

Currently, ... is not used by any function, so I was a bit confused by:

to pass variables via ... where appropriate rather than redefining which will make future extensions difficult

Let me know if you'd like any particular changes with respect to this comment.

@sbfnk
Copy link
Contributor Author

sbfnk commented Mar 3, 2025

Currently, ... is not used by any function, so I was a bit confused by:

What I meant was the opposite, outbreak_model could be defined as (side comment we should have consistent naming in snake_case) as

outbreak_model <- function(num.initial.cases, ...)

and later call

outbreak_step(...)

That said I think the approach suggested by @pearsonca in #58 (comment) is safer/preferable (also because we pass the parameters to two other functions).

github-merge-queue bot pushed a commit that referenced this issue Mar 4, 2025
* inherit rather than redefine function arg documentation, fixes #58

* add @return documentation to functions missing it, fixes #67

* fix typo in @return of outbreak_model

* update parameter_sweep @return from tibble to data.table output

* monospace data.table in documentation

* inherit documentation from outbreak_step in outbreak_setup

* monospace type in function documentation and add type to arguments missing it

* add column names and types of data.table returned by outbreak_model

* add column names and types of data.table returned by outbreak_setup

* Link to outbreak_setup in outbreak_step documentation

Co-authored-by: Carl A. B. Pearson <pearsonca@users.noreply.github.com>

* update outbreak_step.Rd

* format function argument documentation as: [a <sign> <type> <dimension>: <description>]

* indent continuation lines with two spaces in function documentation

* remove browser

---------

Co-authored-by: Carl A. B. Pearson <pearsonca@users.noreply.github.com>
@joshwlambert
Copy link
Collaborator

@sbfnk this can be closed now #78 is merged.

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

No branches or pull requests

3 participants