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

Change add/update functions to have a consistent naming scheme and behaviour #227

Open
stevencarlislewalker opened this issue Jun 22, 2022 · 2 comments
Assignees

Comments

@stevencarlislewalker
Copy link
Collaborator

stevencarlislewalker commented Jun 22, 2022

Proposal:

  • use create_* when adding a component to a model that doesn't yet have that component
  • use replace_* when overwriting an existing component
  • use append_* for 'list components' (e.g. add_rate should be append_rate, vec_rate should be append_vec_rate)
  • use remove_* for removing items from 'list components'
  • use edit_* for modifying values of existing list/vector components (e.g. edit_params(beta = 0.2) instead of update_params(beta = 0.2)) -- not sure if there should be an edit_rate for modifying the formula for a particular rate
  • use reset_* for returning a model component to the default (typically this is a NULLish object like a zero-row data frame or a zero-length list)

Perhaps append_* should just be kept as add_* to minimize changes?

Perhaps there is no difference between create_* and replace_* and the latter is better?

Every model component should have all applicable verbs defined.

@stevencarlislewalker stevencarlislewalker self-assigned this Jun 22, 2022
@stevencarlislewalker
Copy link
Collaborator Author

FYI @papsti , @wzmli , @Flynn-Primrose , @evanjmitchell. Comments would be welcomed.

@evanjmitchell
Copy link
Collaborator

I think that all sounds good. For me personally the only point of confusion was add vs. update, but changing update to edit fixes that I think. I agree that you could just keep add to minimize changes (instead of changing it to append).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

2 participants