Closed kevinwolz closed 4 years ago
Unfortunately, hisafer does not yet support direct modification of exportFrequencies
. You can only specify the output profile names you want to include via the profiles
argument of define_hisafe()
, and then the defaults are applied. That's what the error message was trying to tell you, but it seems that there is a typo it in so it says build_hisafe()
instead - sorry about that! I have updated the error message to fix this typo. It now reads: "-- profileNames and exportFrequencies cannot be defined using define_hisafe(). Use the 'profiles' argument of define_hisafe()."
I have added issue https://github.com/kevinwolz/hisafer/issues/143 for us to explore how to integrate this functionality, as it has been something that I have also wanted for a long time. In the meantime, however, here is what you need to do:
(1) Use copy_hisafe_template()
to copy one of the hisafer templates to a new folder on your computer. All of the export profiles that hisafer has will be included.
(2) Edit the profileNames
and exportFrequencies
lines of the .sim file yourself in a text editor and save the file.
(3) Use this template directory as your template in define_hisafe()
rather than one of the built-in templates.
I test this solution before but it doesn't work. I will do it handmade for the moment.
Even if you specified, in your own template (after using copy_hisafe_template()
), the profileNames and exportFrequencies define_hisafe()
will overwrite it.
If you specified the argument profiles in define_hisafe()
, it will use the default values of exportFrequencies for that profiles.
In the template use :
profileNames = cells,plot,voxels exportFrequencies = 10,10,10
hip_CC <- define_hisafe(path = Dossier_local, template = paste(way_template,Nom_template[i], sep = ""), profiles = c("cells","plot","voxels"), SimulationName = Nom_simu[i], nbSimulations = 5 )
Result :
profileNames = cells,plot,voxels exportFrequencies = 1,1,1
If you didn't specifie the argument profiles in define_hisafe()
, it will use the default values of profiles and exportFrequencies for that simulation.
` hip_CC <- define_hisafe(path = Dossier_local, template = paste(way_template,Nom_template[i], sep = ""), SimulationName = Nom_simu[i], nbSimulations = 5 ) '
profileNames = cells,climate,plot,trees,voxelsMonth exportFrequencies = 1,1,1,1,30
Ah, yes, I see now where it is overwritten. See #143 for the beginnings of a solution to this.
FROM THOMAS GENDRON:
I have some difficulties to define hisafe simulation with hisafer. I want to write directly from the script, the exportFrequencies of output profile.
BUT this doesn't work well ... "Use 'profiles' argument of build_hisafe()" but there is no 'profiles' argument in build_hisafe function.
"Run
rlang::last_error()
to see where the error occurred." I understand nothing ...The solution ? Directly from the template ? other ways ?
The code is just below.
Merci d'avance, even if you don't know.
Bonne journée.
Thomas Gendron