Closed Guillaume-Blanchet closed 5 years ago
Any idea @mariegosme ?
Halleluja, I found the cause of the problem: something in the variety description was not working (or the end of file symbol was not the good one, or there was something corrupt at the end of the crop files). this works with the files I'll send you by email: default.exp <- define_hisafe(path = getwd(), SimulationName = c("0_barley_original_plant_file", "0_winter_barley_original_plant_file", "0_winter_barley_2017_calib_plant_file"), template = "./template_winter_barley_monocrop_A2", # Template "template_winter_barley_monocrop_A2" was created before using copy_hisafe_template() mainCropSpecies = c("proto_barley_AUGUSTA_v1_hisafe_format_modifvariete.plt", "proto_barley_hisafe_format_modifvariete.plt", "proto_barley_AUGUSTA_v1_hisafe_format_modifvariete.plt") ) build_hisafe(hip =default.exp)
@Guillaume-Blanchet can you close this issue?
Whew! I'm glad you figured it out before I could even get to it! If you figure out what was wrong with the .PLT file, maybe we can add a check to build_hisafe() so it can provide a more informative error message.
I figured out what was wrong: it's just that the "title" introducing the cultivar parameters section was # VARIETIES instead of ## VARIETIES !! hours of headache for a simple # !
Well, apparently, the # character is not the only reason the files are not accepted. If I only add the # character (so that I get ## VARIETIES) to the files I had, then I got another error message :
> build_hisafe(hip = hip)
Error: Result 1 is not a length 1 atomic vector
NB : I also paid attention to the errors induced by your script (for STICS .plt file conversion toward Hi-sAFe .plt format) @mariegosme , especially when several varieties are present in the .plt file (such as the original file of proto_barley.plt, where two varieties are present). I had different lines for each variety...
That's strange: on my computer, when I take your original files (proto_barley_AUGUSTA_v1_hisafe_format proto_barley_hisafe_format proto_winterbarley_hisafe_format), and just change #Varietes into ## VARIETIES, it works (even leaving multilines varieties like c("cork", "scarlett") c("380.", "400.0") in proto_barley_hisafe_format, but I think this will cause problems when running the model). Does it work with the files I sent you by email?
Hi @kevinwolz ! I am trying to create 3 simulation folders for a calibration procedure by using the following command in R :
hip is correctly created, but I get an error message when I use the function build_hisafe() that I don't understand at all...
Using
rlang::last_error()
gives that result :Pushing it forward with
rlang::last_trace
results in :Any idea of what's wrong with the code I propose ? Many thanks in advance !