-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve ModelParameters
ergonomics with functors and Julia's pipe operator |>
#73
Comments
(big up to @ilajaait for having made use of this fancy |
Better implement this after #84 have been addressed. |
16 tasks
16 tasks
16 tasks
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We've gone a good way along our "builder" pattern to create
ModelParameter
values without the user needing to input all content at once, with good defaults etc.Today I think I've found the last piece of it, so it could becomes really comfy for user. Here is an example with a simplified version of
ModelParameters
:What we do today is to write functions supposed to edit the various fields in
ModelParameters
the correct way, without the user having to manually edit thebiorates.a
orenvironment.d
values by themself:Or
set_stochasticity!
,set_temperature!
,set_nontrophic_interactions!
,set_mortality!
or whatever. The advantage of these functions is that they abstract details ofModelParameters
away from the user, so they can focus on what they are actually doing.The problem is that using them is not very comfortable.
(very hard to write and to read correctly)
Nice and readable, but verbose, and it's annoying that the
parameters
variable needs to be passed around all the time.Now, I've just realized that, with the following simple additions to the package:
With all similar functions correctly adapted, sophisticated models settings would become very neat to read and write:
Maybe I can craft that along the next sequence of merges :)
The text was updated successfully, but these errors were encountered: