-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conscious uncoupling / grouped naming-scheme #48
Comments
Agreed, agreed, agreed, agreed. I like consistency, and coherency. Two points to add:
But yes, I think it's a very good idea and I think the package needs it. |
Cool cool cool. I can work on keeping the function names brief. Rcompadre does use snake_case now, so I think we could switch Rage as well to standardize. |
I missed that change! Must have been during the move. No problem then |
Here are my suggestions for updating/standardizing the remaining function names. Feedback / suggestions encouraged!
|
They all look good to me and I agree with the move to snake case. I like continuity. Only query is about |
Ya, partly I'm trying to distinguish it from the similar-sounding function
A 'FIXME' note suggests it may eventually incorporate a 'dormant' class. So I think the former name |
This has been done now. |
A few Rage functions (primarily
vitalRates
,matrixElementPerturbation
, andvitalRatePerturbation
) involve a lot of intermediate steps, and have complex outputs. I suggest breaking these down into simpler functions to allow users more flexibility (following #20).Relatedly, I think we should consider transitioning to a naming scheme where groups of similar functions have the same prefix, so that they're easier for users to locate. E.g. Instead of
matrixElementPerturbation
andvitalRatePerturbation
, we could useperturb_transitions
andperturb_vitals
. The vital rate functions I propose below could all begin withvitals_
orvr_
, and @iainmstott's shape functions withshape_
.Break apart
vitalRates
I suggest three layers of functions:
(1.) matrix-returning functions (element-specific vital rates of growth, shrinkage, stasis, and reproduction, all conditional on survival)
vr_mat_U
andvr_mat_R
(2.) vector-returning functions (stage-specific vital rate sums)
vr_vec_survival
,vr_vec_growth
,vr_vec_shrinkage
,vr_vec_stasis
,vr_vec_reproduction
,vr_vec_dormancy
(3.) scalar-returning functions (average vital rates across all stages, possibly weighted)
vr_survival
,vr_growth
,vr_shrinkage
,vr_stasis
,vr_reproduction
,vr_dormancy
Each of these should allow the user to specify the set of possible transitions so that we can distinguish between structural zeros and sampled zeros, and to specify stages that should be excluded from calculation (e.g. dormant stages).
Break apart perturbation functions
I haven't thought as much about these, but we could start with pulling the nested loop that's common to both functions into a separate function (i.e. given
matA
return a sensitivity matrix based either on lambda or a user-supplieddemogstat
argument).I think we should also avoid returning both sensitivities and elasticities in a single functional call. The type of output could be specified with an additional argument
type
, or perhaps we could use separatesensitivity_
andelasticity_
functions.The text was updated successfully, but these errors were encountered: