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

Make model modification functions consistent #313

Closed
exaexa opened this issue Jun 8, 2021 · 3 comments
Closed

Make model modification functions consistent #313

exaexa opened this issue Jun 8, 2021 · 3 comments
Labels
quality improves maintainability and code clarity

Comments

@exaexa
Copy link
Collaborator

exaexa commented Jun 8, 2021

For adjusting the models, there should be 3 variants of functions that allow the users to make variants.

Let's assume verb such as "add" and object" such as reaction, the combined function would be called add_reactionoradd_reactions`.

We should have:

  1. verb_object and verb_objects with parameters (model, object_description) that returns a modified copy of the model, leaving the stuff in model intact
  2. verb_object! and verb_object! with the same parameters that modify the model in-place
  3. mod_verb_object with parameters (object_description) that returns a function that behaves like verb_object, for usage in screen().

This should be consistent across all modifications (where sensible). Plural names are preferred where it makes sense, singular ones should be a simple wrappers.

Naming of the 3rd kind of the modifications functions is to be discussed, some possible good choices include:

  • mod_add_reaction
  • with_added_reaction
  • just added_reaction
  • with_reaction (requires verb change though)

Cc @stelmo @laurentheirendt

@exaexa exaexa added this to the Release - v1.1 milestone Jun 8, 2021
@exaexa
Copy link
Collaborator Author

exaexa commented Jun 9, 2021

I'm going with the added_reaction scheme now, may change in the future. It's in 1 file anyway.

@exaexa
Copy link
Collaborator Author

exaexa commented Jun 9, 2021

EDIT, nah, with_ is better. :D

@exaexa exaexa added the quality improves maintainability and code clarity label Aug 4, 2021
@exaexa
Copy link
Collaborator Author

exaexa commented Aug 5, 2021

I see this kindof solved itself. :D

@exaexa exaexa closed this as completed Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality improves maintainability and code clarity
Projects
None yet
Development

No branches or pull requests

1 participant