From bbeb95a6a8c1cc0fd67f4a5d42463f9e35212a25 Mon Sep 17 00:00:00 2001 From: Patrice Lecharpentier Date: Mon, 13 Jan 2020 19:00:35 +0100 Subject: [PATCH] fix: removing intercrop_pea_barley dir added code of conduct complements README --- README.Rmd | 27 +++++++++++++++++++++++++-- README.md | 55 +++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 63 insertions(+), 19 deletions(-) diff --git a/README.Rmd b/README.Rmd index aaa1e57..c6235e7 100644 --- a/README.Rmd +++ b/README.Rmd @@ -65,7 +65,14 @@ We need for that a JavaStics installed and a JavaStics workspace folder. For example using the last distribution version for Stics 9.1, (JavaSTICS-1.41-stics-9.1 downloadable [here](https://www6.paca.inrae.fr/stics_eng/Download)). It contains an `example` folder with a set of runnable usms. -For running simulations from it, we can use the `run_javastics` function as follows: + +For running simulations from it, we can use the `run_javastics` function. + +In this SticsOnR package, for the moment, only one Stics version can be used with it (i.e. the one delivered with the JavaStics installation archive). JavaStics GUI, allows to manage several Stics executables, but in that case one must take care of consistency between executables version and input files format (advanced use case). + +So, at this point, it is at your own risk if you try to use another version than the JavaStics distribution one. + + ```{r echo = FALSE} javastics_path <- params$javastics_path @@ -101,10 +108,11 @@ runs_info ``` +In the returned information, the error field name gives a list of messages got from JavaStics commandline interface. If any `Error` key word appears in a message, the corresponding simulation failed. But, at the moment it is impossible to identify what is the the error's origin. Things must be checked manually in the workspace, after running again the faulty usm (because the model input files are overwritten at each usms simulation). ### Converting JavaStics workspace files -For using the model directly neither using the JavaStics graphical interface nor the run_javastics function interface, we provide a function, `gen_usms_xml2txt`, for converting JavasStics XML files to Stics text files from a JavaStics workspace. +For using the model directly neither using the JavaStics graphical interface nor the `run_javastics` function interface, we provide a function, `gen_usms_xml2txt`, for converting JavasStics XML files to Stics text files from a JavaStics workspace. Observation files may also be copied if they have a standard name as an usm name and a `.obs` extension. If not, they must be renamed to do so. @@ -156,6 +164,11 @@ gen_usms_xml2txt(javastics_path, workspace_path, usms_list = "banana", ``` +```{r, echo=F} + +unlink(x = file.path(output_path, "intercrop_pea_barley"), recursive = T) + +``` ### Running the model @@ -163,6 +176,9 @@ We need for that a JavaStics folder and a directory, or a folder containing usms The `run_stics` function can be used as follows with one folder or multiple sub-folders. + + + ```{r run_stics} # Spefifying the Stics executable file path @@ -351,3 +367,10 @@ results <- stics_wrapper(model_options = sim_options) ``` +## Code of conduct + +Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. + +## Authors and acknowledgments + +The SticsOnR package is developed by Patrice Lecharpentier, Rémi Vezy and the [SticsOnR Team](https://github.com/orgs/SticsRPacks/teams/sticsonr). diff --git a/README.md b/README.md index 11f6fbf..2a1a242 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,17 @@ For example using the last distribution version for Stics 9.1, [here](https://www6.paca.inrae.fr/stics_eng/Download)). It contains an `example` folder with a set of runnable usms. -For running simulations from it, we can use the `run_javastics` function -as follows: +For running simulations from it, we can use the `run_javastics` +function. + +In this SticsOnR package, for the moment, only one Stics version can be +used with it (i.e. the one delivered with the JavaStics installation +archive). JavaStics GUI, allows to manage several Stics executables, but +in that case one must take care of consistency between executables +version and input files format (advanced use case). + +So, at this point, it is at your own risk if you try to use another +version than the JavaStics distribution one. ``` r @@ -121,14 +130,22 @@ runs_info #> [1] "banana" "wheat" #> #> $error -#> [1] "[11/01/20]-[18:17:46] INFO - Modulostics files generation..\n[11/01/20]-[18:17:46] INFO - Generating txt files ...\n[11/01/20]-[18:17:46] INFO - Files generated under /home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example\nFiles generated :\n\t/home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example/mod_bbanana.sti\n\t/home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example/modhistory.sti" -#> [2] "[11/01/20]-[18:17:47] INFO - Modulostics files generation..\n[11/01/20]-[18:17:47] INFO - Generating txt files ...\n[11/01/20]-[18:17:48] INFO - Files generated under /home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example\nFiles generated :\n\t/home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example/mod_bwheat.sti\n\t/home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example/modhistory.sti" +#> [1] "[13/01/20]-[15:52:22] INFO - Modulostics files generation..\n[13/01/20]-[15:52:22] INFO - Generating txt files ...\n[13/01/20]-[15:52:23] INFO - Files generated under /home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example\nFiles generated :\n\t/home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example/mod_bbanana.sti\n\t/home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example/modhistory.sti" +#> [2] "[13/01/20]-[15:52:23] INFO - Modulostics files generation..\n[13/01/20]-[15:52:23] INFO - Generating txt files ...\n[13/01/20]-[15:52:24] INFO - Files generated under /home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example\nFiles generated :\n\t/home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example/mod_bwheat.sti\n\t/home/plecharpent/Work/projet_tests_modulostics/JavaSTICS-v141-stics-v9.0/example/modhistory.sti" ``` +In the returned information, the error field name gives a list of +messages got from JavaStics commandline interface. If any `Error` key +word appears in a message, the corresponding simulation failed. But, at +the moment it is impossible to identify what is the the error’s origin. +Things must be checked manually in the workspace, after running again +the faulty usm (because the model input files are overwritten at each +usms simulation). + ### Converting JavaStics workspace files For using the model directly neither using the JavaStics graphical -interface nor the run\_javastics function interface, we provide a +interface nor the `run_javastics` function interface, we provide a function, `gen_usms_xml2txt`, for converting JavasStics XML files to Stics text files from a JavaStics workspace. @@ -269,7 +286,7 @@ goal, so apart from the CroptimizR package context. This `stics_wrapper` function allows: - - Configuring simulations run behaviour ( through a options list ) + - Configuring simulations run behaviour ( through an options list ) - Parameters forcing for usms (common or specific values) - Returning specific outputs daily data for each usm with possible dates and variables filtering @@ -329,8 +346,6 @@ stics_wrapper_options() ``` r results <- stics_wrapper(model_options = sim_options) -#> Warning: Error reading outputs for intercrop_pea_barley . -#> ``` - Filtering on usms list @@ -473,9 +488,7 @@ sim_options <- stics_wrapper_options(stics_path = stics_path, data_dir = output_ time_display = TRUE) results <- stics_wrapper(model_options = sim_options) -#> Time difference of 23.02378 secs -#> Warning: Error reading outputs for intercrop_pea_barley . -#> +#> Time difference of 21.86298 secs ``` - Activating parallel execution and execution time display In that @@ -492,9 +505,7 @@ sim_options <- stics_wrapper_options(stics_path = stics_path, data_dir = output_ parallel =TRUE, time_display = TRUE) results <- stics_wrapper(model_options = sim_options) -#> Time difference of 12.5628 secs -#> Warning: Error reading outputs for intercrop_pea_barley . -#> +#> Time difference of 14.46257 secs ``` - Specifying cores number to use @@ -506,7 +517,17 @@ sim_options <- stics_wrapper_options(stics_path = stics_path, data_dir = output_ parallel =TRUE, time_display = TRUE, cores = 2) results <- stics_wrapper(model_options = sim_options) -#> Time difference of 12.9956 secs -#> Warning: Error reading outputs for intercrop_pea_barley . -#> +#> Time difference of 15.09144 secs ``` + +## Code of conduct + +Please note that this project is released with a [Contributor Code of +Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree +to abide by its terms. + +## Authors and acknowledgments + +The SticsOnR package is developed by Patrice Lecharpentier, Rémi Vezy +and the [SticsOnR +Team](https://github.com/orgs/SticsRPacks/teams/sticsonr).