Skip to content

Commit

Permalink
Merge pull request #194 from AgroCares/OBI-28
Browse files Browse the repository at this point in the history
Obi 28
  • Loading branch information
KeesDoolNMI committed Feb 12, 2024
2 parents d1d8c3f + f18b075 commit d213101
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 58 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: OBIC
Type: Package
Title: Calculate the Open Bodem Index (OBI) Score
Version: 3.0.1
Version: 3.0.2
Authors@R: c(
person(given = "Sven",
family = "Verweij",
Expand Down Expand Up @@ -50,7 +50,7 @@ URL: https://github.com/AgroCares/Open-Bodem-Index-Calculator
BugReports: https://github.com/AgroCares/Open-Bodem-Index-Calculator/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Suggests:
testthat (>= 2.1.0),
knitr,
Expand Down
137 changes: 94 additions & 43 deletions DEV/data/crops_obic.csv

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions NEWS.md
@@ -1,3 +1,11 @@
# OBIC 3.0.2 2024-02-09
## Fixed
* Fixes error in validation of B_LU_BRP by enabling calculations with brp codes of 2023 [OBI-28]
* Fixes classification of grasland met/zonder herinzaai in `crops.obic`

## Changed
* `B_LU_WATERSTRESS_OBIC` of 265 (grasland blijvend), 331, and 3718 from 'grasland met herinzaai' to 'grasland zonder herinzaai' in `crops.obic`

# OBIC 3.0.1 2023-11-24
## Fixed
* Fixes calculation of N surplus used for I_H_NGW and I_H_NSW
Expand Down
Binary file modified data/crops.obic.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion man/crops.obic.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-obic_farm.R
Expand Up @@ -56,7 +56,7 @@ test_that("obic_farm works", {
)
expect_equal(
c(sum(out$farm$indicators$S_OBI_NFIELDS_LOW),sum(out$farm$indicators$S_OBI_NFIELDS_HIGH)),
expected = c(34,75),
expected = c(34,76),
tolerance = 0.01
)
expect_equal(
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-obic_field.R
Expand Up @@ -93,13 +93,13 @@ test_that("obic_field works", {
I_P_SE = 0.93,
I_P_WO = 0.7,
I_P_WRI = 0.835,
I_P_WS = 0.017,
I_P_WS = 0.11,
S_B_OBI_A = 0.9,
S_C_OBI_A = 0.537,
S_E_OBI_A = 0.979,
S_M_OBI_A = 0.069,
S_P_OBI_A = 0.421,
S_T_OBI_A = 0.576,
S_P_OBI_A = 0.474,
S_T_OBI_A = 0.592,
RM_C_1 = "M8",
RM_C_2 = "M1",
RM_C_3 = "M2",
Expand Down Expand Up @@ -136,8 +136,8 @@ test_that('obic_field() works with just required columns', {
S_C_OBI_A = 0.537,
S_E_OBI_A = 0.979,
S_M_OBI_A = 0.287,
S_P_OBI_A = 0.500,
S_T_OBI_A = 0.621,
S_P_OBI_A = 0.571,
S_T_OBI_A = 0.642,
key = 'ID'
),
tolerance = 0.01
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-obic_field_dt.R
Expand Up @@ -93,13 +93,13 @@ test_that("obic_field_dt works", {
I_P_SE = 0.93,
I_P_WO = 0.7,
I_P_WRI = 0.835,
I_P_WS = 0.017,
I_P_WS = 0.11,
S_B_OBI_A = 0.9,
S_C_OBI_A = 0.537,
S_E_OBI_A = 0.979,
S_M_OBI_A = 0.069,
S_P_OBI_A = 0.421,
S_T_OBI_A = 0.576,
S_P_OBI_A = 0.474,
S_T_OBI_A = 0.592,
RM_C_1 = "M8",
RM_C_2 = "M1",
RM_C_3 = "M2",
Expand Down Expand Up @@ -136,8 +136,8 @@ test_that('obic_field_dt() works with just required columns', {
S_C_OBI_A = 0.537,
S_E_OBI_A = 0.979,
S_M_OBI_A = 0.287,
S_P_OBI_A = 0.500,
S_T_OBI_A = 0.621,
S_P_OBI_A = 0.571,
S_T_OBI_A = 0.642,
key = 'ID'
),
tolerance = 0.01
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-waterstress.R
Expand Up @@ -5,7 +5,7 @@ test_that("calc_waterstressindex works", {
B_LU_BRP = c(3732,265,258,172,343,2709),
B_GWL_CLASS = c('GtIV','GtV','GtIII','GtII','GtVI','GtIV')
),
expected = c(5,9,0,0,0,5),
expected = c(5,7,0,0,0,5),
tolerance = .1
)
})
Expand Down

0 comments on commit d213101

Please sign in to comment.