plant icon indicating copy to clipboard operation
plant copied to clipboard

Update scaffolder for strategy inheritance

Open aornugent opened this issue 4 years ago • 1 comments

The new approach to model inheritance (#267) requires some changes to the scaffolder.

  • [ ] Pass in an additional Environment template - e.g. FF16r uses the FF16_Environment
  • [ ] Use inheritance approach demonstrated in FF16r to overload the FF16 class, rather than copy the FF16 strategy wholesale
  • [ ] Don't add RcppR6 bindings or tests for components that are reused (i.e. the scaffolder should not generate any mention of FF16r_Environment because it doesn't exist)

aornugent avatar Oct 29 '20 00:10 aornugent

The inherited environmental also needs to be registered by the scaffolder. We can see why in the test-cohort.R logic:

for (x in names(strategy_types)) {
  s <- strategy_types[[x]]()
  e <- environment_types[[x]]
  ...
}

where the FF16r environment has been registered, but not FF16ppa:

> names(strategy_types)
[1] "FF16"    "FF16ppa" "FF16r"   "K93"    
> environment_types
$FF16
[1] "FF16_Env"

$FF16r
[1] "FF16_Env"

$K93
[1] "K93_Env"

EDIT: this part should be resolved in #289.

aornugent avatar Oct 30 '20 00:10 aornugent