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

Refactoring based on covr report #165

Closed
wants to merge 1 commit into from
Closed

Refactoring based on covr report #165

wants to merge 1 commit into from

Conversation

bahadzie
Copy link
Member

@bahadzie bahadzie commented Feb 7, 2024

No description provided.

Copy link
Member Author

@bahadzie bahadzie left a comment

Choose a reason for hiding this comment

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

This draft is based on the covr report of epidemics. I have changed the default parameters for model_default_cpp and model_default_rand removed some code that is no longer necessary due to this change.

@pratikunterwegs, I would like your opinion on this and whether it's a good idea to proceed with the rest of the report. It is related to issue #105

Copy link
Collaborator

@pratikunterwegs pratikunterwegs left a comment

Choose a reason for hiding this comment

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

Thanks for opening this @bahadzie - I would say this is not the way to go, for a couple of reasons:

  1. The convention in R functions we use is to indicate optional arguments as NULL. Due to the structure of internal C++ functions, we have to substitute NULL with no_*_intervention() within model_*_*(), but ideally this wouldn't be necessary. Here, the intervention set, vaccinations, and time dependence are all optional, and should be indicated by NULL.
  2. As you have found in the vignette, the function now requires a dummy contact intervention to be specified even when the intention is to have only a rate intervention. This adds (a little) work for the user that the package can/should do for them, as it's an optional argument overall.

What you could do is to adopt the approach used in {finalsize}, where the default control settings list has its elements replaced if they are passed by the user. This would indeed cut down on the cross-checking required in argument checker functions .check_args_model_*().

Overall, what I would say is also that the {epidemics} API is changing substantially - see #160. It might be good to revisit #105 once the API has stabilised in a few weeks, as otherwise a number of the changes made now would soon be overwritten.

@pratikunterwegs
Copy link
Collaborator

Closing this PR as #176 introduced much better testing for all ODE models, and future PRs will improve coverage for the Ebola model as well.

@pratikunterwegs pratikunterwegs deleted the bahadzie/coverage branch June 10, 2024 14:18
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