Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
aac9377
some fixes in plt files, expand_stics_names (if header exists)
plecharpent Apr 11, 2024
e1507d6
Files updates and new xsd files added to exdata for version 11.0, and…
plecharpent Apr 15, 2024
3e52be1
Fix : last parameters updates for _tec, _sta, param_gen and _plt file…
plecharpent Apr 16, 2024
5ab3bd5
fix: csv files for V11.0
plecharpent Apr 16, 2024
b85e890
taking into account now a specific bracnh name for downloading data f…
plecharpent Apr 16, 2024
bce0d01
updates of tests according to changes
plecharpent Apr 16, 2024
93965a8
removed useless ::: in func calls
plecharpent Apr 16, 2024
21f70c8
fix: download_data man, calls with stics_version named arg
plecharpent Apr 16, 2024
c2e20e7
fix: irrig auto stage format
plecharpent May 7, 2024
a22199c
merge main into branch
plecharpent May 7, 2024
72e099a
Merge branch 'main' into add/xml-upgrades/v11
plecharpent May 31, 2024
4579e44
added functions documentation, fix tests
plecharpent May 31, 2024
9da11a4
fix: missing Rd files for functions doc generation
plecharpent May 31, 2024
2fbb1a7
missing arg doc and superfluous commented code
plecharpent May 31, 2024
a377a6d
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jun 3, 2024
b474082
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jul 19, 2024
e131a36
new function added for copying mod, obs, lai and weather files
plecharpent Jul 19, 2024
cc76c53
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jul 19, 2024
4fa644d
using a new func for copying files
plecharpent Jul 19, 2024
389a53f
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jul 23, 2024
96c578f
add missing verbose in upgrade_workspace_xml_10_11 (#110)
timflutre Sep 9, 2024
f3b6980
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Mar 4, 2025
e0c9d98
Update CITATION.cff
plecharpent Mar 4, 2025
241b4d4
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jul 28, 2025
3a83a10
merge main into the branch
plecharpent Jul 30, 2025
103a233
fix: handling data download and plt options number in tests for versi…
plecharpent Jul 30, 2025
4f744d3
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Nov 5, 2025
e835d9e
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Nov 5, 2025
c9a446b
Update upgrade_v10_v11.R
VEZY Dec 1, 2025
c238135
Update upgrade_v10_v11.R
VEZY Dec 1, 2025
e5126a6
Update stics_files_utils.R
VEZY Dec 1, 2025
bceeac8
Update stics_files_utils.R
VEZY Dec 1, 2025
29d0d4f
Merge branch 'main' into add/xml-upgrades/v11
VEZY Dec 3, 2025
36b7613
Merge branch 'main' into add/xml-upgrades/v11
VEZY Dec 4, 2025
197cd66
Update gen_usms_xml2txt.R
VEZY Dec 4, 2025
f300458
Merge branch 'main' into add/xml-upgrades/v11
VEZY Dec 11, 2025
1c80fc4
Merge branch 'main' into add/xml-upgrades/v11
VEZY Dec 16, 2025
166533a
Merge branch 'main' into add/xml-upgrades/v11
VEZY Dec 16, 2025
fc41d9d
fix: multiple values for fime_type
plecharpent Dec 19, 2025
398c4b0
Update get_files_list.R
VEZY Jan 7, 2026
871054d
fix: looking for *.mod files in config dir of javastics if they do no…
plecharpent Jan 12, 2026
30ebd96
fix: getting param*.xml files location in the workspace and then in t…
plecharpent Jan 12, 2026
fd7351e
fix: func argument
plecharpent Jan 13, 2026
bf7de33
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jan 13, 2026
980c7cc
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jan 13, 2026
eeb57be
merge add/xml-upgrades/v11 into fix-files-copy-upgrades
plecharpent Jan 13, 2026
dfe4129
Update CITATION.cff
plecharpent Jan 13, 2026
63e6d62
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jan 13, 2026
2d215d8
Merge branch 'add/xml-upgrades/v11' into fix-files-copy-upgrade
plecharpent Jan 13, 2026
c3f777e
Merge 2d215d8b6577c73fdabebd00c00e906f17832329 into 63e6d625b2c1fb61e…
plecharpent Jan 13, 2026
017deea
Style code (GHA)
plecharpent Jan 13, 2026
3883837
fix: useless target_version in upgrade_... & update doc, *.mod files …
plecharpent Jan 15, 2026
d616f95
fixes: get_files_list & temporarily test for upgrading from 10 to 11
plecharpent Jan 15, 2026
25610d4
Merge d616f95806bfe756f15fdac165cab33ea5e8a123 into 63e6d625b2c1fb61e…
plecharpent Jan 15, 2026
9eadc41
Style code (GHA)
plecharpent Jan 15, 2026
6011d89
Merge pull request #224 from SticsRPacks/fix-files-copy-upgrade
plecharpent Jan 16, 2026
32bb4f2
fix: get_param_gen_file function type argument and stop when file not…
plecharpent Jan 20, 2026
8c5143c
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jan 20, 2026
9dfb12a
fix(doc): unused arg in upgrade function & help header
plecharpent Jan 21, 2026
a11a55c
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jan 21, 2026
1821bd3
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jan 21, 2026
6c4b916
Update xml_files_functions.R
VEZY Jan 23, 2026
c234524
add default intercrop parameters for sunflower and soybean
VEZY Jan 23, 2026
3fd4370
Merge branch 'add/xml-upgrades/v11' into fix-set_xml_file_version
VEZY Jan 23, 2026
9b5b830
Merge pull request #243 from SticsRPacks/fix-set_xml_file_version
VEZY Jan 23, 2026
1c0eaf5
Remove `overwrite`from call to set_xml_file_version
VEZY Jan 23, 2026
cb147a3
Update upgrade_v10_v11.R
VEZY Jan 28, 2026
8811690
Update example files
VEZY Jan 28, 2026
c2621a3
update doc
VEZY Jan 28, 2026
487e015
Merge c2621a33272786808862ebf3a04dab0d7b08de7a into 1c0eaf578bc4391e9…
VEZY Jan 28, 2026
220b105
Style code (GHA)
VEZY Jan 28, 2026
3394c78
Merge pull request #246 from SticsRPacks/move-strip-parameters-to-tec…
VEZY Jan 28, 2026
7de3a0d
Update get_files_list.R
VEZY Jan 29, 2026
184cb6b
fix: to rename humirac parameter to code_humirac
plecharpent Jan 29, 2026
53a36b1
Merge 184cb6bce9b62ce62142c45a27d9aa401186d2a5 into 7de3a0d5c05a92bb3…
plecharpent Jan 29, 2026
f9d7529
Style code (GHA)
plecharpent Jan 29, 2026
7ff70ad
Merge pull request #248 from SticsRPacks/plecharpent/fix-param-locati…
plecharpent Feb 2, 2026
4b267d4
Merge branch 'main' into add/xml-upgrades/v11
VEZY Feb 2, 2026
b465885
Update xml_files_functions.R
VEZY Feb 2, 2026
5a6bc31
Update upgrade_v10_v11.R
VEZY Feb 2, 2026
a9765f3
merge and solve conflicts
timflutre Feb 19, 2026
a5d4394
Merge branch 'main' into add/xml-upgrades/v11
timflutre Feb 19, 2026
344b9a9
fix: stics version to V10.5.0
plecharpent Feb 23, 2026
eae7b20
fix: update version for xsl files
plecharpent Feb 26, 2026
cd39dbb
Add strip design option to planting structure
plecharpent Mar 2, 2026
6f38fc8
fix: update inputs and outputs parameters and variables info files
plecharpent Mar 3, 2026
2ee6d04
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Mar 3, 2026
0e7ad53
changes: management of versions info (data and functions) and version…
plecharpent Mar 5, 2026
ad8a9c2
update stics versions file, files examples by type zip archives, miss…
plecharpent Mar 5, 2026
c382ebc
fix: checking if dir exists
plecharpent Mar 5, 2026
76fa9f0
Merge c382ebc7f2fe8a6182c3029cbcf482bf3e39d1f5 into 80dd521282b0e78d0…
plecharpent Mar 6, 2026
46f5530
Style code (GHA)
plecharpent Mar 6, 2026
4e688e6
refacto: getting versions (list, latest,), check_version_compat_renam…
plecharpent Mar 6, 2026
591ae74
fix: check_version, get_file_one note about .SD and ..keep_cols
plecharpent Mar 6, 2026
213ddd6
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Mar 6, 2026
57aa9ef
Merge 213ddd6bdd0c9a5f6d9a9d36f6eb0a2ba2c66234 into 80dd521282b0e78d0…
plecharpent Mar 6, 2026
3b890e1
Style code (GHA)
plecharpent Mar 6, 2026
6d17601
fix: getting usm files list wrong syntax when filtering types
plecharpent Mar 19, 2026
408117c
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Mar 19, 2026
4e3be08
fix: collate section
plecharpent Mar 19, 2026
5b7e0b8
fix: adding missing function
plecharpent Mar 19, 2026
9630bcd
Merge 5b7e0b8863b71ee423ef6677023d962630d75f2b into 80dd521282b0e78d0…
plecharpent Mar 19, 2026
43cb494
Style code (GHA)
plecharpent Mar 19, 2026
0de06a7
Merge branch 'main' into add/xml-upgrades/v11
timflutre Apr 1, 2026
a658cc7
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Apr 2, 2026
d7f80f4
fix: only using major versions for checking consistency for upgrading…
plecharpent Apr 21, 2026
216010b
added tests for get_version_num
plecharpent Apr 21, 2026
9a60728
Merge 216010b48ce8da63a3fa889812d8cbca9e0108fd into f9738bb960e1684d2…
plecharpent Apr 21, 2026
e061810
Style code (GHA)
plecharpent Apr 21, 2026
2771bc2
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Apr 22, 2026
f79b467
update: renamed upgrade functions upgrade_*_xml.R to upgrade_*_xml_9_…
plecharpent Jun 23, 2026
ad5df61
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jun 23, 2026
9254199
Update CITATION.cff
plecharpent Jun 23, 2026
01b66fa
update: functions doc and site
plecharpent Jun 23, 2026
bab5b79
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jun 23, 2026
d7efc00
fix: removed useless code in upgrade functions 9 to 10 and useless ar…
plecharpent Jun 23, 2026
41730a4
Merge d7efc00bdac834e38ec17a4fbdffe050c2069bbb into 6e5faf0e5ed415887…
plecharpent Jun 23, 2026
9c1e7e6
Style code (GHA)
plecharpent Jun 23, 2026
c938027
update: removed useless commented code, man fix
plecharpent Jun 23, 2026
5152c7f
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jun 23, 2026
51711df
update: simplification of data sets removed 10.1.0 and/created 10.0.0
plecharpent Jun 24, 2026
27c638f
good practices fixes and update spelling WORDLIST
plecharpent Jun 24, 2026
118950d
Update CITATION.cff
plecharpent Jun 24, 2026
66bdd41
added missing examples for exported functions and update functions do…
plecharpent Jun 24, 2026
9015fbf
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jun 24, 2026
0134c4b
Merge 9015fbfd7386289aefd9a3936bf5d5e309521958 into 6e5faf0e5ed415887…
plecharpent Jun 24, 2026
da0159b
Style code (GHA)
plecharpent Jun 24, 2026
c474d9d
updates: functions according to some rules identified by goodpractice…
plecharpent Jun 24, 2026
9a6f71e
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jun 24, 2026
65826ef
Merge 9a6f71e435b394555e17c9615baf6f5b9d6c34fa into 6e5faf0e5ed415887…
plecharpent Jun 24, 2026
1df3d35
Style code (GHA)
plecharpent Jun 24, 2026
f17bc70
update release number and addes release notes
plecharpent Jun 25, 2026
98c1310
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jun 25, 2026
d007a2e
Update CITATION.cff
plecharpent Jun 25, 2026
e0bffaf
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jun 26, 2026
5f05c7c
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jun 26, 2026
478ba4c
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jul 7, 2026
7cb61be
doc: fix roxygen2 version
plecharpent Jul 7, 2026
983a2ca
fix: set mandatory parameters default values
plecharpent Jul 7, 2026
142e998
fix: linting
plecharpent Jul 7, 2026
0cf6213
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jul 7, 2026
3e8b7be
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Jul 7, 2026
2debdd1
Merge 3e8b7be2848950b32384f7c6867083388c388f7c into 332e97da6b2406e30…
plecharpent Jul 7, 2026
1e668c4
Style code (GHA)
plecharpent Jul 7, 2026
fd7eeaa
Merge main into add/xml-upgrades/v11
plecharpent Jul 8, 2026
72c5b66
refactor: removed commented code lines, arguments reordered/renamed a…
plecharpent Jul 8, 2026
ffaea5d
Merge 72c5b665dbf65a0bd8d2034324aa329c1e1c70c3 into ea497774ea49a27c8…
plecharpent Jul 8, 2026
9f528a1
Style code (GHA)
plecharpent Jul 8, 2026
b27a030
refactor: versions info file updated about xml files, added generic i…
plecharpent Jul 9, 2026
f2681e2
removed version dependent upgrade tests, replaced with tests using th…
plecharpent Jul 9, 2026
b230129
fix: internal functions examples to "dontrun", added tests to check u…
plecharpent Jul 10, 2026
39df7bc
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jul 10, 2026
d23d60d
Merge 39df7bcf1d0ded3b6382245c98db2230de70213e into ea497774ea49a27c8…
plecharpent Jul 10, 2026
72ba95b
Style code (GHA)
plecharpent Jul 10, 2026
eef221d
fix: vignette and reference site page update with generic intrefaces …
plecharpent Jul 10, 2026
240fd31
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jul 10, 2026
00600ef
fix: getting latest version, added test
plecharpent Jul 13, 2026
5734d2d
fix: mandatory value for ressuite parameter in xml templates, new fun…
plecharpent Jul 30, 2026
ed36589
Merge 5734d2d18231e9309fc87a4b928ace5a06830e3f into ea497774ea49a27c8…
plecharpent Jul 30, 2026
1340bb1
Style code (GHA)
plecharpent Jul 30, 2026
5598f86
fix: output definition are now overwritten
plecharpent Jul 30, 2026
28cd48a
fix: output file definition source path
plecharpent Jul 31, 2026
382a82d
fix: removing NA data using ..keepcols and .DT variables generated no…
plecharpent Jul 31, 2026
f79594b
Merge branch 'add/xml-upgrades/v11' of https://github.com/SticsRPacks…
plecharpent Jul 31, 2026
c1476a4
Merge f79594bcb044b94585bf4f3b4d14017f65de9ec8 into ea497774ea49a27c8…
plecharpent Jul 31, 2026
8dab9d1
Style code (GHA)
plecharpent Jul 31, 2026
29f0ee3
Merge branch 'main' into add/xml-upgrades/v11
plecharpent Sep 2, 2026
9ad87e5
Update check-standard.yaml
plecharpent Sep 2, 2026
d67a9a9
Update check-standard.yaml
plecharpent Sep 2, 2026
53fad71
Update pr-checks.yaml
plecharpent Sep 2, 2026
9b14ce3
changes: added som informations or precisions about workspace content…
plecharpent Sep 2, 2026
6632141
changes: reformulations, added overwrite info
plecharpent Sep 2, 2026
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
4 changes: 2 additions & 2 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
}
- {
os: ubuntu-latest,
r: "4.2.0",
r: "4.4.0",
rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
}

Expand All @@ -52,7 +52,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: rc
#pak-version: rc
# about pak-version:
# Ubuntu doesn't install the proper version of XML see https://github.com/r-lib/actions/issues/559. Remove when fixed.
# see also: https://stackoverflow.com/questions/73243945/pkgdown-action-failing-at-build-xml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
}
- {
os: ubuntu-latest,
r: "4.2.0",
r: "4.4.0",
rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest",
}

Expand Down
17 changes: 8 additions & 9 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ cff-version: 1.2.0
message: 'To cite package "SticsRFiles" in publications use:'
type: software
license: LGPL-3.0-or-later
title: 'SticsRFiles: Read and Modify ''STICS'' Input/Output Files'
version: 1.6.0
title: 'SticsRFiles: Read and Modify STICS Input/Output Files'
version: 1.7.0
doi: 10.32614/CRAN.package.SticsRFiles
abstract: Manipulating input and output files of the 'STICS' crop model. Files are
either 'JavaSTICS' XML files or text files used by the model 'fortran' executable.
Most basic functionalities are reading or writing parameter names and values in
both XML or text input files, and getting data from output files. Advanced functionalities
include XML files generation from XML templates and/or spreadsheets, or text files
generation from XML files by using 'xslt' transformation.
abstract: Manipulating input and output files of the STICS crop model. Files are either
JavaSTICS XML files or text files used by the model fortran executable. Most basic
functionalities are reading or writing parameter names and values in both XML or
text input files, and getting data from output files. Advanced functionalities include
XML files generation from XML templates and/or spreadsheets, or text files generation
from XML files by using xslt transformation.
authors:
- family-names: Lecharpentier
given-names: Patrice
Expand All @@ -40,7 +40,6 @@ authors:
repository: https://CRAN.R-project.org/package=SticsRFiles
repository-code: https://github.com/SticsRPacks/SticsRFiles
url: https://doi.org/10.5281/zenodo.4443206
date-released: '2025-06-03'
contact:
- family-names: Lecharpentier
given-names: Patrice
Expand Down
26 changes: 10 additions & 16 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Package: SticsRFiles
Title: Read and Modify 'STICS' Input/Output Files
Version: 1.6.0
Date: 2025-06-03
Title: Read and Modify STICS Input/Output Files
Version: 1.7.0
Authors@R: c(
person("Patrice", "Lecharpentier", , "patrice.lecharpentier@inrae.fr", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4044-4322")),
Expand All @@ -23,13 +22,13 @@ Authors@R: c(
person("Christine", "Le Bas", role = "rev"),
person("Joel", "Leonard", role = "rev")
)
Description: Manipulating input and output files of the 'STICS' crop
model. Files are either 'JavaSTICS' XML files or text files used by
the model 'fortran' executable. Most basic functionalities are reading
Description: Manipulating input and output files of the STICS crop
model. Files are either JavaSTICS XML files or text files used by
the model fortran executable. Most basic functionalities are reading
or writing parameter names and values in both XML or text input files,
and getting data from output files. Advanced functionalities include
XML files generation from XML templates and/or spreadsheets, or text
files generation from XML files by using 'xslt' transformation.
files generation from XML files by using xslt transformation.
License: LGPL (>= 3)
URL: https://github.com/SticsRPacks/SticsRFiles,
https://doi.org/10.5281/zenodo.4443206
Expand Down Expand Up @@ -85,6 +84,7 @@ Collate:
'check_java_workspace.R'
'check_output_files.R'
'check_param_names.R'
'check_upgrade_versions.R'
'col_names_to_var.R'
'compute_date_from_day.R'
'compute_day_number.R'
Expand Down Expand Up @@ -192,15 +192,9 @@ Collate:
'static_help.R'
'stics_environment.R'
'stics_files_utils.R'
'upgrade_ini_xml.R'
'upgrade_param_gen_xml.R'
'upgrade_param_newform_xml.R'
'upgrade_plt_xml.R'
'upgrade_sols_xml.R'
'upgrade_sta_xml.R'
'upgrade_tec_xml.R'
'upgrade_usms_xml.R'
'upgrade_workspace_xml.R'
'upgrade_v10_v11.R'
'upgrade_v9_v10.R'
'upgrade_xml_files.R'
'var_to_col_names.R'
'xml_document.R'
'xml_files_functions.R'
Expand Down
59 changes: 59 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
# SticsRFiles 1.7.0
* FUNCTIONS
* Added new functions for upgrading STICS input files from version 10 to version 11
* Management of STICS versions using the 'semver' package (major, minor, patch components)
* Removed useless warnings in some functions
* Using now get_version_num function for comparing versions (using 'svlist' object from 'semver' package)
* new function get_dev_stages for extracting STICS development stages dates from a list
of data.frame of simulations outputs
* parallelisation mode introduced for STICS inputs text files generation
* parallelisation mode introcuced for reading STICS output files
* new function for extracting a new xml workspace from a workspace, with possible usm selection (rewriting usms.xml, sols.xml)
* new function for calculating an approximate value of vapor pressure
* manage branches use in download_data function
* Added verbosity use in functions managing Stics variables and replaced warning by message in some cases

* DOCUMENTATION
* functions help: added missing examples for exported functions
* vignettes update: for STICS files upgrading

* FIXES
* Download function for examples csv files
* Function for reading csv or xls examples files
* managing text version to version number using 'semver'
* Remove `overwrite` argument from set_xml_file_version
* rename STICS humirac parameter to code_humirac following fortran code
* find general parameters files, .mod files location (either in workspace or in JavaStics config directory)
* manage duplicate values or files in gen_climate function
* get_xml_files_param_df: for the long format table the "value" column is converted to character for binding data.frame rows,
data selection with parameters names, management of empty parameters values when pivot_wider
* getting plants names with or without using the usms.xml file, for mixed usms directories (soles crops and intercrops)
* set_param_value: converting parameters values to a list if it is not a list when dimensions are compatible
* writing errors for weather data files
* functions arguments renaming to have more consistency among functions
* compute_date_from_day returns NA instead of 999
* removed old deprecated arguments management (and 'lifecycle' dependency)
* sub-directories detection for reading observation and simulation outputs files, and duplicates
* download_data: error management
* fixed default values for mandatory parameters in _tec.xml templates files (V10 and V11)
* Added checks for calculating weather data years number and added new tests

* DATA
* Input STICS files sets: simplification according to versions compatibility
* Update examples files for STICS version 11.0.0
* adaptation of functions used for data manipulation for new data set of STICS 11.0.0

* REFACTORING
* Removed useless code, superfluous arguments and commented code
* Checking version function
* Functions simplification for upgrading files from STICS version 9 to 10
* code style fixes

* TESTS
* Checks and integration tests restructured
* Use of an automatic action for checking code style and updates
* Updates about testhat function used
* Added in workflows a dependabot for checking packages updates (producing pull requests)
* Removed from tests useless version number


# SticsRFiles 1.6.0 _2025-06-03_
* FUNCTIONS
* convert_xml2txt allows to convert sols.xml file to text files
Expand Down
2 changes: 1 addition & 1 deletion R/add_node_to_doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
add_node_to_doc <- function(xml_doc, new_node, nodes_nb = 1, parent_path) {
# Checking that parent_path is valid xpath for xml_doc
if (is.null(get_nodes(xml_doc, parent_path))) {
warning(paste("Given xpath is not a valid one:", parent_path))
warning("Given xpath is not a valid one:", parent_path)
return(invisible())
}

Expand Down
2 changes: 1 addition & 1 deletion R/add_stics_nodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ add_stics_nodes <- function(
form_idx <- which(node_types$form_names[[file_tag]] == formalism_name)

if (!length(form_idx)) {
stop(paste("Unkown formalism name", formalism_name))
stop("Unkown formalism name", formalism_name)
}

if (formalism_name == "special techniques") {
Expand Down
20 changes: 14 additions & 6 deletions R/all_in_par.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@
#'
all_in_par <- function(stics_version = "latest") {
# Checking and getting the right version
stics_version <- check_version_compat(stics_version = stics_version)
stics_version <- check_version(stics_version = stics_version)

# if (get_version_num(stics_version = stics_version) < 9.2) {
# cols_idx <- 1:4
# } else {
cols_idx <- c(1, 4, 7:8, 2, 3, 10)
# }

Expand All @@ -40,7 +37,15 @@ all_in_par <- function(stics_version = "latest") {
stringsAsFactors = FALSE
)[, cols_idx]

names(par_df) <- c("name", "file", "min", "max", "definition", "unit", "cultivar")
names(par_df) <- c(
"name",
"file",
"min",
"max",
"definition",
"unit",
"cultivar"
)

par_df$cultivar <- as.logical(par_df$cultivar)

Expand Down Expand Up @@ -86,6 +91,9 @@ all_in_par <- function(stics_version = "latest") {
#'
#' @export
#'
#' @examples
#' get_param_info()
#'
get_param_info <- function(
param = NULL,
keyword = NULL,
Expand Down Expand Up @@ -149,7 +157,7 @@ is_stics_param <- function(param, stics_version = "latest") {
pars_names_parsed <- var_to_col_names(all_pars$name)
index_par <- match(par_parsed, pars_names_parsed)
par_found <- !is.na(index_par)
if (any(!par_found)) {
if (!all(par_found)) {
cli::cli_alert_warning(
paste0(
"paremeters{?s} {.var {par_parsed[!par_found]}}",
Expand Down
6 changes: 5 additions & 1 deletion R/all_out_var.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#'
all_out_var <- function(stics_version = "latest") {
# Checking and getting the right version
stics_version <- check_version_compat(stics_version = stics_version)
stics_version <- check_version(stics_version = stics_version)

if (get_version_num(stics_version = stics_version) < get_version_num("9.2")) {
cols_idx <- 1:4
Expand Down Expand Up @@ -81,6 +81,10 @@ all_out_var <- function(stics_version = "latest") {
#'
#' @export
#'
#' @examples
#'
#' get_var_info()
#'
get_var_info <- function(var = NULL, keyword = NULL, stics_version = "latest") {
all_vars <- all_out_var(stics_version)
if (!is.null(var)) {
Expand Down
24 changes: 15 additions & 9 deletions R/approx_vapour_pressure.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
##' Approximate vapour pressure
##'
##' Approximates vapour pressure as the saturated vapour pressure at the daily mean air temperature using relative humidity.
##' See section 9.3 of the STICS book, as well as M. Launay's explanations on the STICS forum (\href{https://w3.avignon.inrae.fr/forge/boards/26/topics/2237?r=2243#message-2243}{link}).
##' @param mean_temp numeric vector of daily mean air temperature (in Celsius degrees)
##' @param rel_humid numeric vector of relative humidity (in percentage)
##' @return numeric vector
##' @author Timothee Flutre
##' @export
#' Approximate vapour pressure
#'
#' @description Approximates vapour pressure as the saturated vapour pressure at the daily
#' mean air temperature using relative humidity.
#' See section 9.3 of the STICS book, as well as M. Launay's explanations on the STICS forum
#' (\href{https://w3.avignon.inrae.fr/forge/boards/26/topics/2237?r=2243#message-2243}{link}).
#' @param mean_temp numeric vector of daily mean air temperature (in Celsius degrees)
#' @param rel_humid numeric vector of relative humidity (in percentage)
#' @return numeric vector
#' @author Timothee Flutre
#' @export
#'
#' @examples
#' approx_vapour_pressure(15, 60)
#'
approx_vapour_pressure <- function(mean_temp, rel_humid) {
stopifnot(
length(mean_temp) == length(rel_humid),
Expand Down
2 changes: 1 addition & 1 deletion R/check_choice_param.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ check_choice_param <- function(xml_doc, param_name, stop = FALSE) {
#--------------------------------------------------------------------#

# Early exiting for other docs than tec ones
if (!XML::xmlName(XML::xmlRoot(xml_doc@content)) == "fichiertec") {
if (XML::xmlName(XML::xmlRoot(xml_doc@content)) != "fichiertec") {
return(invisible())
}

Expand Down
6 changes: 3 additions & 3 deletions R/check_java_workspace.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ check_java_workspace <- function(javastics, workspace = NULL) {
# Ensure that the user working directory is unchanged after
# the function has run
current_wd <- getwd()
on.exit(setwd(current_wd))
on.exit(setwd(current_wd), add = TRUE)

setwd(javastics)

Expand All @@ -43,11 +43,11 @@ check_java_workspace <- function(javastics, workspace = NULL) {
}

if (base::is.null(ws) || !dir.exists(ws)) {
warning(paste(
warning(
"The given directory does not exist or JavaSTICS working
directory is not set :\n",
ws
))
)
return()
}

Expand Down
Loading
Loading