traitecoevo/plant

Error in test when trying to install a new strategy

Closed this issue · 3 comments

To port a strategy I implemented in the old plant version I tried to use the code described in the Developer Notes

"To install a new strategy using the scaffolder, run the following code from an R session at the project root:

source('inst/scripts/new_strategy_scaffolder.R')
create_strategy_scaffold("XX99", "FF16")

where XX99 is the name of your new strategy and FF16 is the strategy that you want to copy from. If run without FF16, the scaffolder copies from the FF16 strategy by default.

This will create the code-base for a new template. Then run make clean; make; make test to recompile and run the test suite with your new strategy template."

I ran

source('inst/scripts/new_strategy_scaffolder.R')
create_strategy_scaffold("FVCB", "FF16")

and then make cleanand makebut get errors in make test

There were several errors with the new strategy here is an example

Error (test-individual-runner.R:79:5): grow_plant_to_size
Error: Invalid type 'FVCB'; expected one of:
	FF16, FF16_Env
	FVCB, FVCB_Env
	FF16r, FF16_Env
	K93, K93_Env
Backtrace:
 1. plant::Individual(x, e) test-individual-runner.R:79:4
 2. plant::check_type(type, valid) /Users/kunstler/Dropbox/Falster/plant/R/RcppR6.R:881:2
```

Not sure if having an error in the test is crucial at this stage?

Hi Georges,

Great you're giving this a try and sorry it didn't work. Seems like it mostly worked. I'm heading away for a week but perhaps @aornugent can take a look? Otherwise I'll investigate when I get back.

Hey @kunstler - sorry for the delay. This should be resolved in #289 which we'll get merged into develop soon.

Thank you, Andrew! The branch "Update scaffolder" is solving the issue.