Skip to content

Commit 85c3582

Browse files
authored
New release 1.2.0 (#20)
* updates: added new JavaStics version/java version, info about how to handle the stics exe generation under MacOS (ref to the JavaStics doc), fixed internal page links. Fix: mask messages about common names of the SticsRFiles and xml2 xml_document class name. * Update CITATION.cff * updates for a new release + little fix about a note about a global variable "." * Update CITATION.cff * fix: SticsRFiles in imports * Update CITATION.cff * SticsRFiles in suggests * Update CITATION.cff * trying to force main install in checks as in CroptimizR * let SticsRFiles in Imports and Remotes * Update CITATION.cff * restoring previous install config for SticsRFiles@main * SticsRFiles again in Imports * Update CITATION.cff * new release 1.2.0 * Update CITATION.cff --------- Co-authored-by: plecharpent <[email protected]>
1 parent 4cd5168 commit 85c3582

9 files changed

+224
-162
lines changed

CITATION.cff

+52-36
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ message: 'To cite package "SticsOnR" in publications use:'
88
type: software
99
license: LGPL-3.0-or-later
1010
title: 'SticsOnR: Manage STICS Simulations Running the Executable or JavaStics,'
11-
version: 1.1.0
11+
version: 1.2.0
1212
abstract: 'Running simulations with the ''STICS'' crop model. Different ways of performing
1313
simulations are available and based on three use-cases: 1/ Calling ''JavaStics''
1414
command line to run simulations on given situations. ''JavaStics'' handles text
@@ -37,7 +37,7 @@ authors:
3737
orcid: https://orcid.org/0000-0002-9310-2377
3838
repository-code: https://github.com/SticsRPacks/SticsOnR
3939
url: https://doi.org/10.5281/zenodo.4443130
40-
date-released: '2023-07-12'
40+
date-released: '2024-02-22'
4141
contact:
4242
- family-names: Lecharpentier
4343
given-names: Patrice
@@ -52,7 +52,7 @@ references:
5252
- name: R Core Team
5353
location:
5454
name: Vienna, Austria
55-
year: '2023'
55+
year: '2024'
5656
institution:
5757
name: R Foundation for Statistical Computing
5858
version: '>= 3.6.0'
@@ -66,7 +66,7 @@ references:
6666
- family-names: Csárdi
6767
given-names: Gábor
6868
69-
year: '2023'
69+
year: '2024'
7070
- type: software
7171
title: crayon
7272
abstract: 'crayon: Colored Terminal Output'
@@ -77,7 +77,7 @@ references:
7777
- family-names: Csárdi
7878
given-names: Gábor
7979
80-
year: '2023'
80+
year: '2024'
8181
version: '>= 1.3.4'
8282
- type: software
8383
title: doParallel
@@ -90,7 +90,7 @@ references:
9090
given-names: Microsoft
9191
- family-names: Weston
9292
given-names: Steve
93-
year: '2023'
93+
year: '2024'
9494
- type: software
9595
title: dplyr
9696
abstract: 'dplyr: A Grammar of Data Manipulation'
@@ -114,7 +114,7 @@ references:
114114
given-names: Davis
115115
116116
orcid: https://orcid.org/0000-0003-4777-038X
117-
year: '2023'
117+
year: '2024'
118118
- type: software
119119
title: foreach
120120
abstract: 'foreach: Provides Foreach Looping Construct'
@@ -125,7 +125,7 @@ references:
125125
- name: Microsoft
126126
- family-names: Weston
127127
given-names: Steve
128-
year: '2023'
128+
year: '2024'
129129
- type: software
130130
title: lifecycle
131131
abstract: 'lifecycle: Manage the Life Cycle of your Package Functions'
@@ -135,12 +135,12 @@ references:
135135
authors:
136136
- family-names: Henry
137137
given-names: Lionel
138-
email: lionel@rstudio.com
138+
email: lionel@posit.co
139139
- family-names: Wickham
140140
given-names: Hadley
141-
email: hadley@rstudio.com
141+
email: hadley@posit.co
142142
orcid: https://orcid.org/0000-0003-4757-117X
143-
year: '2023'
143+
year: '2024'
144144
- type: software
145145
title: magrittr
146146
abstract: 'magrittr: A Forward-Pipe Operator for R'
@@ -154,7 +154,7 @@ references:
154154
- family-names: Wickham
155155
given-names: Hadley
156156
157-
year: '2023'
157+
year: '2024'
158158
- type: software
159159
title: parallel
160160
abstract: 'R: A Language and Environment for Statistical Computing'
@@ -163,7 +163,7 @@ references:
163163
- name: R Core Team
164164
location:
165165
name: Vienna, Austria
166-
year: '2023'
166+
year: '2024'
167167
institution:
168168
name: R Foundation for Statistical Computing
169169
- type: software
@@ -185,7 +185,7 @@ references:
185185
- family-names: Ritchie
186186
given-names: Gary
187187
188-
year: '2023'
188+
year: '2024'
189189
- type: software
190190
title: stats
191191
abstract: 'R: A Language and Environment for Statistical Computing'
@@ -194,9 +194,40 @@ references:
194194
- name: R Core Team
195195
location:
196196
name: Vienna, Austria
197-
year: '2023'
197+
year: '2024'
198198
institution:
199199
name: R Foundation for Statistical Computing
200+
- type: software
201+
title: tibble
202+
abstract: 'tibble: Simple Data Frames'
203+
notes: Imports
204+
url: https://tibble.tidyverse.org/
205+
repository: https://CRAN.R-project.org/package=tibble
206+
authors:
207+
- family-names: Müller
208+
given-names: Kirill
209+
210+
orcid: https://orcid.org/0000-0002-1416-3412
211+
- family-names: Wickham
212+
given-names: Hadley
213+
214+
year: '2024'
215+
- type: software
216+
title: tidyr
217+
abstract: 'tidyr: Tidy Messy Data'
218+
notes: Imports
219+
url: https://tidyr.tidyverse.org
220+
repository: https://CRAN.R-project.org/package=tidyr
221+
authors:
222+
- family-names: Wickham
223+
given-names: Hadley
224+
225+
- family-names: Vaughan
226+
given-names: Davis
227+
228+
- family-names: Girlich
229+
given-names: Maximilian
230+
year: '2024'
200231
- type: software
201232
title: SticsRFiles
202233
abstract: 'SticsRFiles: Read and Modify ''STICS'' Input/Output Files'
@@ -220,23 +251,8 @@ references:
220251
given-names: Michel
221252
222253
orcid: https://orcid.org/0000-0002-9310-2377
223-
year: '2023'
254+
year: '2024'
224255
version: '>= 1.1.3'
225-
- type: software
226-
title: tibble
227-
abstract: 'tibble: Simple Data Frames'
228-
notes: Imports
229-
url: https://tibble.tidyverse.org/
230-
repository: https://CRAN.R-project.org/package=tibble
231-
authors:
232-
- family-names: Müller
233-
given-names: Kirill
234-
235-
orcid: https://orcid.org/0000-0002-1416-3412
236-
- family-names: Wickham
237-
given-names: Hadley
238-
239-
year: '2023'
240256
- type: software
241257
title: covr
242258
abstract: 'covr: Test Coverage for Packages'
@@ -247,7 +263,7 @@ references:
247263
- family-names: Hester
248264
given-names: Jim
249265
250-
year: '2023'
266+
year: '2024'
251267
- type: software
252268
title: knitr
253269
abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
@@ -259,7 +275,7 @@ references:
259275
given-names: Yihui
260276
261277
orcid: https://orcid.org/0000-0003-0645-5666
262-
year: '2023'
278+
year: '2024'
263279
- type: software
264280
title: rmarkdown
265281
abstract: 'rmarkdown: Dynamic Documents for R'
@@ -302,7 +318,7 @@ references:
302318
given-names: Richard
303319
304320
orcid: https://orcid.org/0000-0003-3925-190X
305-
year: '2023'
321+
year: '2024'
306322
- type: software
307323
title: spelling
308324
abstract: 'spelling: Tools for Spell Checking in R'
@@ -317,7 +333,7 @@ references:
317333
- family-names: Hester
318334
given-names: Jim
319335
320-
year: '2023'
336+
year: '2024'
321337
- type: software
322338
title: testthat
323339
abstract: 'testthat: Unit Testing for R'
@@ -328,4 +344,4 @@ references:
328344
- family-names: Wickham
329345
given-names: Hadley
330346
331-
year: '2023'
347+
year: '2024'

DESCRIPTION

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Type: Package
22
Package: SticsOnR
33
Title: Manage STICS Simulations Running the Executable or JavaStics,
4-
Version: 1.1.0
5-
Date: 2023-07-12
4+
Version: 1.2.0
5+
Date: 2024-02-22
66
Authors@R: c(
77
person("Patrice", "Lecharpentier", , "[email protected]", role = c("aut", "cre"),
88
comment = c(ORCID = "0000-0002-4044-4322")),
@@ -46,9 +46,9 @@ Imports:
4646
parallel,
4747
rstudioapi,
4848
stats,
49-
SticsRFiles (>= 1.1.3),
5049
tibble,
51-
tidyr
50+
tidyr,
51+
SticsRFiles (>= 1.1.3)
5252
Suggests:
5353
covr,
5454
knitr,
@@ -61,4 +61,4 @@ ByteCompile: true
6161
Encoding: UTF-8
6262
Language: en-US
6363
Roxygen: list(markdown = TRUE)
64-
RoxygenNote: 7.2.1
64+
RoxygenNote: 7.3.1

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export(run_stics)
55
export(stics_wrapper)
66
export(stics_wrapper_options)
77
importFrom(doParallel,registerDoParallel)
8+
importFrom(foreach,"%do%")
89
importFrom(foreach,"%dopar%")
910
importFrom(magrittr,"%>%")
1011
importFrom(parallel,clusterCall)

NEWS.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# SticsOnR 1.2.0 _2024-02-22_
2+
3+
MAIN CHANGES:
4+
* paralellization in the wrapper is now optional (cluster deactivation)
5+
* README update with latest JavaStics/STICS versions and information
6+
about executable installation on MacOS systems
7+
8+
9+
FIXES:
10+
* tidyr package was missing in imports
11+
* checking if the JavaStics folder is given when forcing parameters values
12+
in the wrapper
13+
* for several years simulations, the wrapper now is returning specific values
14+
for stages for each year, not the same one for all the years
15+
* limitation of sub-dirs discovering (recursivity deactivated) in the
16+
workspace for the run_system function
17+
118
# SticsOnR 1.1.0 _2023-07-12_
219

320
MAIN CHANGES:

R/global.R

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
utils::globalVariables(".")

R/stics_exe_utilities.R

+27-7
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ set_stics_exe <- function(javastics,
163163
# saving a previous version
164164
file.copy(xml_path, xml_path_prev)
165165

166-
167-
xml_pref <- SticsRFiles:::xmldocument(xml_path)
166+
xml_pref <- get_xml_doc(xml_path)
168167

169168

170169
# Getting the existing list in pref file
@@ -214,7 +213,9 @@ set_stics_exe <- function(javastics,
214213
names(stics_exe_list$stics_list),
215214
stics_exe_list$stics_list
216215
), collapse = "")
217-
xml_pref <- SticsRFiles:::xmldocument(xml_path)
216+
217+
xml_pref <- get_xml_doc(xml_path)
218+
218219
SticsRFiles:::set_values(
219220
xml_pref,
220221
'//entry[@key="model.last"]', new_stics_name
@@ -274,7 +275,9 @@ list_stics_exe <- function(javastics) {
274275
} else {
275276
# If the preferences is availabble, control that it is complete
276277
# (it is not on at install)
277-
xml_pref <- SticsRFiles:::xmldocument(config_pref)
278+
279+
xml_pref <- get_xml_doc(config_pref)
280+
278281
current_stics <- SticsRFiles:::get_values(
279282
xml_pref,
280283
'//entry[@key="model.last"]'
@@ -286,7 +289,8 @@ list_stics_exe <- function(javastics) {
286289
}
287290
}
288291

289-
xml_pref <- SticsRFiles:::xmldocument(config_pref)
292+
xml_pref <- get_xml_doc(config_pref)
293+
290294
current_stics <- SticsRFiles:::get_values(
291295
xml_pref,
292296
'//entry[@key="model.last"]'
@@ -447,7 +451,8 @@ select_stics_exe <- function(javastics, stics_exe = "stics_modulo") {
447451
# saving a previous version
448452
file.copy(xml_path, xml_path_prev)
449453

450-
xml_pref <- SticsRFiles:::xmldocument(xml_path)
454+
xml_pref <- get_xml_doc(xml_path)
455+
451456
current_model <- SticsRFiles:::get_values(
452457
xml_pref,
453458
'//entry[@key="model.last"]'
@@ -555,7 +560,7 @@ remove_stics_exe <- function(javastics, stics_exe) {
555560
stics_exe_list$stics_list
556561
), collapse = "")
557562

558-
xml_pref <- SticsRFiles:::xmldocument(xml_path)
563+
xml_pref <- get_xml_doc(xml_path)
559564

560565
# removing model from last if needed
561566
if (stics_exe_list$current == stics_exe) {
@@ -576,3 +581,18 @@ remove_stics_exe <- function(javastics, stics_exe) {
576581
# writing file
577582
SticsRFiles:::save_xml_doc(xml_pref, xml_path)
578583
}
584+
585+
586+
#' Getting a xml_document from an XML file
587+
#'
588+
#' @param file
589+
#'
590+
#' @return a SticsRFiles xml_document object
591+
#' @keywords internal
592+
#'
593+
#' @noRd
594+
595+
get_xml_doc <- function(file) {
596+
suppressMessages(doc <- SticsRFiles:::xmldocument(file))
597+
doc
598+
}

R/stics_wrapper.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ stics_wrapper <- function(model_options,
114114
# + handle the case when simulations does not reach the asked stages ...)
115115
#
116116

117+
117118
if (lifecycle::is_present(sit_names)) {
118119
lifecycle::deprecate_warn(
119120
"1.0.0", "stics_wrapper(sit_names)",
@@ -181,10 +182,8 @@ stics_wrapper <- function(model_options,
181182
registerDoParallel(cl)
182183
clusterCall(cl, function(x) .libPaths(x), .libPaths())
183184

184-
#`%doparornot%` <- `%dopar%`
185185
`%do_par_or_not%` <- foreach::`%dopar%`
186186
} else {
187-
#`%doparornot%` <- `%do%`
188187
`%do_par_or_not%` <- foreach::`%do%`
189188

190189
}

0 commit comments

Comments
 (0)