Regeneration delays ('delays' object) update #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suggesting this update to
CBM_core
that would simplify the job of specifying regeneration delays for data prep modules. @cboisvenue let's chat about this! I've added a couple specific questions at the bottom.Currently,
CBM_core
always requires thedelays
input object, which specifies post disturbance regeneration delays for each pixel group. This has to be the same length asnrow(level3DT)
even if all delays are set to the same number (e.g. 0). There is no default.Instead of always requiring the
delays
input object, this instead does 2 new things:regenDelay
parameter that allows for a default regeneration delay unless otherwise specified. This defaults to 0 but could be changed by the user.regenDelay
column with thelevel3DT
table so that delays can be specified individually for each pixel group. Where there are NAs, theregenDelay
parameter is used.This makes it easier to use
CBM_core
as the user can do any of:regenDelay
parameter).regenDelay
parameter).regenDelay
column oflevel3DT
), but with the benefit of having thelevel3DT
table structure define the required length of the vector. This also allows for the delays to stay closely linked with their pixel group ID.It seems that
CBM_dataPrep_SK
is creating thedelays
object only to set them all to 0 if not otherwise specified. Since there's no other special "SK-specific" behavior here I would say it would be best to leave this job toCBM_core
. If this is merged, this PR forCBM_dataPrep_SK
can also be merged: PredictiveEcology/CBM_dataPrep_SK#13Questions:
level3DT
table? This could be scrapped to instead keep thedelays
object, but just as an optional input. It seems ideal to me (my newbie eyes) to lean towards having pixel-group specific attributes all in one place, but I see that there are other similar cases (e.g.historicDMtype
is also a vector that needs to be the length ofnrow(level3DT)
), so it may make sense to take a step back and think about how all of these should be best handled. My concern is that having pixel group attributes outside of thelevel3DT
table without a key to link them back means that there may be opportunity for the rows & vectors to get reordered and misattributed somewhere down the line.