Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
IN-WOP
airGRiwrm
Commits
1835bfeb
Commit
1835bfeb
authored
Sep 03, 2021
by
Dorchies David
Browse files
tests: handle warnings in CreateInputsModel
parent
4a219999
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/testthat/helper_RunModel.R
View file @
1835bfeb
...
...
@@ -41,7 +41,7 @@ setupRunModel <- function() {
)
# set up inputs
InputsModel
<-
CreateInputsModel
(
griwrm
,
DatesR
,
Precip
,
PotEvap
,
Qobs
)
InputsModel
<-
suppressWarnings
(
CreateInputsModel
(
griwrm
,
DatesR
,
Precip
,
PotEvap
,
Qobs
)
)
# RunOptions
nTS
<-
365
...
...
tests/testthat/test-CreateInputsModel.R
View file @
1835bfeb
...
...
@@ -3,14 +3,16 @@ context("CreateInputsModel")
l
<-
setUpCemaNeigeData
()
test_that
(
"CemaNeige data should be in InputsModel"
,
{
InputsModels
<-
CreateInputsModel
(
l
$
griwrm
,
DatesR
=
l
$
DatesR
,
Precip
=
l
$
Precip
,
PotEvap
=
l
$
PotEvap
,
TempMean
=
l
$
TempMean
,
ZInputs
=
l
$
ZInputs
,
HypsoData
=
l
$
HypsoData
,
Qobs
=
l
$
Qobs
)
InputsModels
<-
suppressWarnings
(
CreateInputsModel
(
l
$
griwrm
,
DatesR
=
l
$
DatesR
,
Precip
=
l
$
Precip
,
PotEvap
=
l
$
PotEvap
,
TempMean
=
l
$
TempMean
,
ZInputs
=
l
$
ZInputs
,
HypsoData
=
l
$
HypsoData
,
Qobs
=
l
$
Qobs
)
)
l
$
DatesR
<-
as.data.frame
(
l
$
DatesR
)
lapply
(
InputsModels
,
function
(
IM
)
{
lapply
(
c
(
"DatesR"
,
"Precip"
,
"PotEvap"
),
function
(
varName
)
{
...
...
@@ -40,14 +42,16 @@ test_that("handles mix of with and without CemaNeige nodes", {
l
$
ZInputs
<-
l
$
ZInputs
[
1
:
2
]
l
$
TempMean
<-
l
$
TempMean
[,
1
:
2
]
l
$
HypsoData
<-
l
$
HypsoData
[,
1
:
2
]
InputsModels
<-
CreateInputsModel
(
l
$
griwrm
,
DatesR
=
l
$
DatesR
,
Precip
=
l
$
Precip
,
PotEvap
=
l
$
PotEvap
,
TempMean
=
l
$
TempMean
,
ZInputs
=
l
$
ZInputs
,
HypsoData
=
l
$
HypsoData
,
Qobs
=
l
$
Qobs
)
InputsModels
<-
suppressWarnings
(
CreateInputsModel
(
l
$
griwrm
,
DatesR
=
l
$
DatesR
,
Precip
=
l
$
Precip
,
PotEvap
=
l
$
PotEvap
,
TempMean
=
l
$
TempMean
,
ZInputs
=
l
$
ZInputs
,
HypsoData
=
l
$
HypsoData
,
Qobs
=
l
$
Qobs
)
)
expect_false
(
inherits
(
InputsModels
$
Down
,
"CemaNeige"
))
expect_null
(
InputsModels
$
Down
$
LayerPrecip
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment