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

Design of helper functions #5

Open
pratikunterwegs opened this issue Jan 9, 2023 · 0 comments
Open

Design of helper functions #5

pratikunterwegs opened this issue Jan 9, 2023 · 0 comments
Assignees
Labels
discussion For package design discussions

Comments

@pratikunterwegs
Copy link
Collaborator

This issue is intended as a design discussion for helper functions in {scenarios}.

These functions are intended to be used within comparisons objects, but could also be made available to users for more ad hoc use. 

  • are_comparable(): Function that takes two or more scenario class objects as input and checks which pair-wise comparisons are possible. This depends on whether the same function was called, and whether the parameter list has the same elements (throw warnings if the parameter list is identical).
  • Should check whether some user specified parameters are identical among scenarios (e.g. if comparing different R0 in the same population, do not allow comparison where demography is different; such as when demographic groups have different age limits).  Could be used for only two objects, in which case it should return a single boolean; otherwise, a boolean matrix of whether any pair of scenarios are comparable. 
  • select_comparable(): Function that takes two or more scenario class objects as input, as well as an optional string or integer specifying which should be considered the ‘baseline’ object. Runs are_comparable() and returns only those scenarios which are comparable as a list; the ‘baseline’ object is returned as the first element of the list. If no ‘baseline’ is specified, the first object is assumed to be the baseline with a warning or message to the user. 
  • make_scenario_names(): Function to make informative names for scenario objects, based on their parameter combinations, and/or other user-specified name components. 
  • read_scenario() / write_scenario(): Functions to read in and save a scenario specification from or to a file (structured Excel, JSON, YAML). 
  • More helper functions as required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion For package design discussions
Projects
None yet
Development

No branches or pull requests

1 participant