Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release 1.2.0 #20

Merged
merged 23 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3111000
updates: added new JavaStics version/java version, info about how to …
plecharpent Feb 20, 2024
600ed33
Merge branch 'main' into new-release
plecharpent Feb 20, 2024
83438d1
Update CITATION.cff
plecharpent Feb 20, 2024
c026395
Merge branch 'main' into new-release
plecharpent Feb 20, 2024
429781d
updates for a new release + little fix about a note about a global va…
plecharpent Feb 21, 2024
90b9245
Update CITATION.cff
plecharpent Feb 21, 2024
620f029
fix: SticsRFiles in imports
plecharpent Feb 21, 2024
53e0b43
Merge branch 'new-release' of https://github.com/SticsRPacks/SticsOnR…
plecharpent Feb 21, 2024
7edc40d
Update CITATION.cff
plecharpent Feb 21, 2024
9d60174
SticsRFiles in suggests
plecharpent Feb 21, 2024
e640a90
Merge branch 'new-release' of https://github.com/SticsRPacks/SticsOnR…
plecharpent Feb 21, 2024
0e9e895
Update CITATION.cff
plecharpent Feb 21, 2024
e510e37
trying to force main install in checks as in CroptimizR
plecharpent Feb 21, 2024
0003254
Merge branch 'new-release' of https://github.com/SticsRPacks/SticsOnR…
plecharpent Feb 21, 2024
7476518
let SticsRFiles in Imports and Remotes
plecharpent Feb 22, 2024
2f739a9
Update CITATION.cff
plecharpent Feb 22, 2024
d5e9508
restoring previous install config for SticsRFiles@main
plecharpent Feb 22, 2024
0c2078c
Merge branch 'new-release' of https://github.com/SticsRPacks/SticsOnR…
plecharpent Feb 22, 2024
091b07a
SticsRFiles again in Imports
plecharpent Feb 22, 2024
f45330e
Update CITATION.cff
plecharpent Feb 22, 2024
2e868aa
new release 1.2.0
plecharpent Feb 23, 2024
482bc66
Merge branch 'new-release' of https://github.com/SticsRPacks/SticsOnR…
plecharpent Feb 23, 2024
5ba7817
Update CITATION.cff
plecharpent Feb 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 52 additions & 36 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message: 'To cite package "SticsOnR" in publications use:'
type: software
license: LGPL-3.0-or-later
title: 'SticsOnR: Manage STICS Simulations Running the Executable or JavaStics,'
version: 1.1.0
version: 1.2.0
abstract: 'Running simulations with the ''STICS'' crop model. Different ways of performing
simulations are available and based on three use-cases: 1/ Calling ''JavaStics''
command line to run simulations on given situations. ''JavaStics'' handles text
Expand Down Expand Up @@ -37,7 +37,7 @@ authors:
orcid: https://orcid.org/0000-0002-9310-2377
repository-code: https://github.com/SticsRPacks/SticsOnR
url: https://doi.org/10.5281/zenodo.4443130
date-released: '2023-07-12'
date-released: '2024-02-22'
contact:
- family-names: Lecharpentier
given-names: Patrice
Expand All @@ -52,7 +52,7 @@ references:
- name: R Core Team
location:
name: Vienna, Austria
year: '2023'
year: '2024'
institution:
name: R Foundation for Statistical Computing
version: '>= 3.6.0'
Expand All @@ -66,7 +66,7 @@ references:
- family-names: Csárdi
given-names: Gábor
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: crayon
abstract: 'crayon: Colored Terminal Output'
Expand All @@ -77,7 +77,7 @@ references:
- family-names: Csárdi
given-names: Gábor
email: [email protected]
year: '2023'
year: '2024'
version: '>= 1.3.4'
- type: software
title: doParallel
Expand All @@ -90,7 +90,7 @@ references:
given-names: Microsoft
- family-names: Weston
given-names: Steve
year: '2023'
year: '2024'
- type: software
title: dplyr
abstract: 'dplyr: A Grammar of Data Manipulation'
Expand All @@ -114,7 +114,7 @@ references:
given-names: Davis
email: [email protected]
orcid: https://orcid.org/0000-0003-4777-038X
year: '2023'
year: '2024'
- type: software
title: foreach
abstract: 'foreach: Provides Foreach Looping Construct'
Expand All @@ -125,7 +125,7 @@ references:
- name: Microsoft
- family-names: Weston
given-names: Steve
year: '2023'
year: '2024'
- type: software
title: lifecycle
abstract: 'lifecycle: Manage the Life Cycle of your Package Functions'
Expand All @@ -135,12 +135,12 @@ references:
authors:
- family-names: Henry
given-names: Lionel
email: lionel@rstudio.com
email: lionel@posit.co
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
email: hadley@posit.co
orcid: https://orcid.org/0000-0003-4757-117X
year: '2023'
year: '2024'
- type: software
title: magrittr
abstract: 'magrittr: A Forward-Pipe Operator for R'
Expand All @@ -154,7 +154,7 @@ references:
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: parallel
abstract: 'R: A Language and Environment for Statistical Computing'
Expand All @@ -163,7 +163,7 @@ references:
- name: R Core Team
location:
name: Vienna, Austria
year: '2023'
year: '2024'
institution:
name: R Foundation for Statistical Computing
- type: software
Expand All @@ -185,7 +185,7 @@ references:
- family-names: Ritchie
given-names: Gary
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: stats
abstract: 'R: A Language and Environment for Statistical Computing'
Expand All @@ -194,9 +194,40 @@ references:
- name: R Core Team
location:
name: Vienna, Austria
year: '2023'
year: '2024'
institution:
name: R Foundation for Statistical Computing
- type: software
title: tibble
abstract: 'tibble: Simple Data Frames'
notes: Imports
url: https://tibble.tidyverse.org/
repository: https://CRAN.R-project.org/package=tibble
authors:
- family-names: Müller
given-names: Kirill
email: [email protected]
orcid: https://orcid.org/0000-0002-1416-3412
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2024'
- type: software
title: tidyr
abstract: 'tidyr: Tidy Messy Data'
notes: Imports
url: https://tidyr.tidyverse.org
repository: https://CRAN.R-project.org/package=tidyr
authors:
- family-names: Wickham
given-names: Hadley
email: [email protected]
- family-names: Vaughan
given-names: Davis
email: [email protected]
- family-names: Girlich
given-names: Maximilian
year: '2024'
- type: software
title: SticsRFiles
abstract: 'SticsRFiles: Read and Modify ''STICS'' Input/Output Files'
Expand All @@ -220,23 +251,8 @@ references:
given-names: Michel
email: [email protected]
orcid: https://orcid.org/0000-0002-9310-2377
year: '2023'
year: '2024'
version: '>= 1.1.3'
- type: software
title: tibble
abstract: 'tibble: Simple Data Frames'
notes: Imports
url: https://tibble.tidyverse.org/
repository: https://CRAN.R-project.org/package=tibble
authors:
- family-names: Müller
given-names: Kirill
email: [email protected]
orcid: https://orcid.org/0000-0002-1416-3412
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2023'
- type: software
title: covr
abstract: 'covr: Test Coverage for Packages'
Expand All @@ -247,7 +263,7 @@ references:
- family-names: Hester
given-names: Jim
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: knitr
abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
Expand All @@ -259,7 +275,7 @@ references:
given-names: Yihui
email: [email protected]
orcid: https://orcid.org/0000-0003-0645-5666
year: '2023'
year: '2024'
- type: software
title: rmarkdown
abstract: 'rmarkdown: Dynamic Documents for R'
Expand Down Expand Up @@ -302,7 +318,7 @@ references:
given-names: Richard
email: [email protected]
orcid: https://orcid.org/0000-0003-3925-190X
year: '2023'
year: '2024'
- type: software
title: spelling
abstract: 'spelling: Tools for Spell Checking in R'
Expand All @@ -317,7 +333,7 @@ references:
- family-names: Hester
given-names: Jim
email: [email protected]
year: '2023'
year: '2024'
- type: software
title: testthat
abstract: 'testthat: Unit Testing for R'
Expand All @@ -328,4 +344,4 @@ references:
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2023'
year: '2024'
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: SticsOnR
Title: Manage STICS Simulations Running the Executable or JavaStics,
Version: 1.1.0
Date: 2023-07-12
Version: 1.2.0
Date: 2024-02-22
Authors@R: c(
person("Patrice", "Lecharpentier", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4044-4322")),
Expand Down Expand Up @@ -46,9 +46,9 @@ Imports:
parallel,
rstudioapi,
stats,
SticsRFiles (>= 1.1.3),
tibble,
tidyr
tidyr,
SticsRFiles (>= 1.1.3)
Suggests:
covr,
knitr,
Expand All @@ -61,4 +61,4 @@ ByteCompile: true
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.3.1
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export(run_stics)
export(stics_wrapper)
export(stics_wrapper_options)
importFrom(doParallel,registerDoParallel)
importFrom(foreach,"%do%")
importFrom(foreach,"%dopar%")
importFrom(magrittr,"%>%")
importFrom(parallel,clusterCall)
Expand Down
17 changes: 17 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# SticsOnR 1.2.0 _2024-02-22_

MAIN CHANGES:
* paralellization in the wrapper is now optional (cluster deactivation)
* README update with latest JavaStics/STICS versions and information
about executable installation on MacOS systems


FIXES:
* tidyr package was missing in imports
* checking if the JavaStics folder is given when forcing parameters values
in the wrapper
* for several years simulations, the wrapper now is returning specific values
for stages for each year, not the same one for all the years
* limitation of sub-dirs discovering (recursivity deactivated) in the
workspace for the run_system function

# SticsOnR 1.1.0 _2023-07-12_

MAIN CHANGES:
Expand Down
1 change: 1 addition & 0 deletions R/global.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
utils::globalVariables(".")
34 changes: 27 additions & 7 deletions R/stics_exe_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@
# saving a previous version
file.copy(xml_path, xml_path_prev)


xml_pref <- SticsRFiles:::xmldocument(xml_path)
xml_pref <- get_xml_doc(xml_path)

Check warning on line 166 in R/stics_exe_utilities.R

View check run for this annotation

Codecov / codecov/patch

R/stics_exe_utilities.R#L166

Added line #L166 was not covered by tests


# Getting the existing list in pref file
Expand Down Expand Up @@ -214,7 +213,9 @@
names(stics_exe_list$stics_list),
stics_exe_list$stics_list
), collapse = "")
xml_pref <- SticsRFiles:::xmldocument(xml_path)

xml_pref <- get_xml_doc(xml_path)

Check warning on line 217 in R/stics_exe_utilities.R

View check run for this annotation

Codecov / codecov/patch

R/stics_exe_utilities.R#L217

Added line #L217 was not covered by tests

SticsRFiles:::set_values(
xml_pref,
'//entry[@key="model.last"]', new_stics_name
Expand Down Expand Up @@ -274,7 +275,9 @@
} else {
# If the preferences is availabble, control that it is complete
# (it is not on at install)
xml_pref <- SticsRFiles:::xmldocument(config_pref)

xml_pref <- get_xml_doc(config_pref)

Check warning on line 279 in R/stics_exe_utilities.R

View check run for this annotation

Codecov / codecov/patch

R/stics_exe_utilities.R#L279

Added line #L279 was not covered by tests

current_stics <- SticsRFiles:::get_values(
xml_pref,
'//entry[@key="model.last"]'
Expand All @@ -286,7 +289,8 @@
}
}

xml_pref <- SticsRFiles:::xmldocument(config_pref)
xml_pref <- get_xml_doc(config_pref)

Check warning on line 292 in R/stics_exe_utilities.R

View check run for this annotation

Codecov / codecov/patch

R/stics_exe_utilities.R#L292

Added line #L292 was not covered by tests

current_stics <- SticsRFiles:::get_values(
xml_pref,
'//entry[@key="model.last"]'
Expand Down Expand Up @@ -447,7 +451,8 @@
# saving a previous version
file.copy(xml_path, xml_path_prev)

xml_pref <- SticsRFiles:::xmldocument(xml_path)
xml_pref <- get_xml_doc(xml_path)

Check warning on line 454 in R/stics_exe_utilities.R

View check run for this annotation

Codecov / codecov/patch

R/stics_exe_utilities.R#L454

Added line #L454 was not covered by tests

current_model <- SticsRFiles:::get_values(
xml_pref,
'//entry[@key="model.last"]'
Expand Down Expand Up @@ -555,7 +560,7 @@
stics_exe_list$stics_list
), collapse = "")

xml_pref <- SticsRFiles:::xmldocument(xml_path)
xml_pref <- get_xml_doc(xml_path)

Check warning on line 563 in R/stics_exe_utilities.R

View check run for this annotation

Codecov / codecov/patch

R/stics_exe_utilities.R#L563

Added line #L563 was not covered by tests

# removing model from last if needed
if (stics_exe_list$current == stics_exe) {
Expand All @@ -576,3 +581,18 @@
# writing file
SticsRFiles:::save_xml_doc(xml_pref, xml_path)
}


#' Getting a xml_document from an XML file
#'
#' @param file
#'
#' @return a SticsRFiles xml_document object
#' @keywords internal
#'
#' @noRd

get_xml_doc <- function(file) {
suppressMessages(doc <- SticsRFiles:::xmldocument(file))
doc

Check warning on line 597 in R/stics_exe_utilities.R

View check run for this annotation

Codecov / codecov/patch

R/stics_exe_utilities.R#L596-L597

Added lines #L596 - L597 were not covered by tests
}
3 changes: 1 addition & 2 deletions R/stics_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ stics_wrapper <- function(model_options,
# + handle the case when simulations does not reach the asked stages ...)
#


if (lifecycle::is_present(sit_names)) {
lifecycle::deprecate_warn(
"1.0.0", "stics_wrapper(sit_names)",
Expand Down Expand Up @@ -181,10 +182,8 @@ stics_wrapper <- function(model_options,
registerDoParallel(cl)
clusterCall(cl, function(x) .libPaths(x), .libPaths())

#`%doparornot%` <- `%dopar%`
`%do_par_or_not%` <- foreach::`%dopar%`
} else {
#`%doparornot%` <- `%do%`
`%do_par_or_not%` <- foreach::`%do%`

}
Expand Down
Loading
Loading