Commit 0858c7f1 authored by David's avatar David
Browse files

fix: error on Ci on POSIXct date comparison

This crashes on the CI but not on windows:
which(IM_severn[[1]]$DatesR == "2002-10-15")

Refs #100
Showing with 8 additions and 8 deletions
+8 -8
......@@ -45,7 +45,7 @@ PotEvap <- ConvertMeteoSD(griwrm, PotEvapTot)
Qobs <- data.frame(
Dam = BasinsObs$`54095`$discharge_spec * griwrm$area[griwrm$id == "54095"] * 1E3
)
Qobs[,] <- Qobs[which(DatesR == "2002-10-01"), 1]
Qobs[,] <- Qobs[which(DatesR == as.POSIXct("2002-10-01")), 1]
# InputsModel object
IM_severn <- CreateInputsModel(griwrm, DatesR, Precip, PotEvap, Qobs)
......@@ -96,7 +96,7 @@ CreateController(sv, "DamRelease", Y = c("54095", "54057"), U = c("Dam"), FUN =
# GRiwrmRunOptions object simulation of the hydrological year 2002-2003
IndPeriod_Run <- seq.int(
which(IM_severn[[1]]$DatesR == "2002-10-15"),
which(IM_severn[[1]]$DatesR == as.POSIXct("2002-10-15")),
length.out = 365
)
IndPeriod_WarmUp <- seq.int(IndPeriod_Run[1] - 366, IndPeriod_Run[1] - 1)
......
......@@ -90,7 +90,7 @@ PotEvap <- ConvertMeteoSD(griwrm, PotEvapTot)
Qobs <- data.frame(
Dam = BasinsObs$`54095`$discharge_spec * griwrm$area[griwrm$id == "54095"] * 1E3
)
Qobs[,] <- Qobs[which(DatesR == "2002-10-01"), 1]
Qobs[,] <- Qobs[which(DatesR == as.POSIXct("2002-10-01")), 1]
# InputsModel object
IM_severn <- CreateInputsModel(griwrm, DatesR, Precip, PotEvap, Qobs)
......@@ -141,7 +141,7 @@ CreateController(sv, "DamRelease", Y = c("54095", "54057"), U = c("Dam"), FUN =
# GRiwrmRunOptions object simulation of the hydrological year 2002-2003
IndPeriod_Run <- seq.int(
which(IM_severn[[1]]$DatesR == "2002-10-15"),
which(IM_severn[[1]]$DatesR == as.POSIXct("2002-10-15")),
length.out = 365
)
IndPeriod_WarmUp <- seq.int(IndPeriod_Run[1] - 366, IndPeriod_Run[1] - 1)
......
......@@ -72,7 +72,7 @@ PotEvap <- ConvertMeteoSD(griwrm, PotEvapTot)
Qobs <- data.frame(
Dam = BasinsObs$`54095`$discharge_spec * griwrm$area[griwrm$id == "54095"] * 1E3
)
Qobs[,] <- Qobs[which(DatesR == "2002-10-01"), 1]
Qobs[,] <- Qobs[which(DatesR == as.POSIXct("2002-10-01")), 1]
# InputsModel object
IM_severn <- CreateInputsModel(griwrm, DatesR, Precip, PotEvap, Qobs)
......@@ -123,7 +123,7 @@ CreateController(sv, "DamRelease", Y = c("54095", "54057"), U = c("Dam"), FUN =
# GRiwrmRunOptions object simulation of the hydrological year 2002-2003
IndPeriod_Run <- seq.int(
which(IM_severn[[1]]$DatesR == "2002-10-15"),
which(IM_severn[[1]]$DatesR == as.POSIXct("2002-10-15")),
length.out = 365
)
IndPeriod_WarmUp <- seq.int(IndPeriod_Run[1] - 366, IndPeriod_Run[1] - 1)
......
......@@ -69,7 +69,7 @@ PotEvap <- ConvertMeteoSD(griwrm, PotEvapTot)
Qobs <- data.frame(
Dam = BasinsObs$`54095`$discharge_spec * griwrm$area[griwrm$id == "54095"] * 1E3
)
Qobs[,] <- Qobs[which(DatesR == "2002-10-01"), 1]
Qobs[,] <- Qobs[which(DatesR == as.POSIXct("2002-10-01")), 1]
# InputsModel object
IM_severn <- CreateInputsModel(griwrm, DatesR, Precip, PotEvap, Qobs)
......@@ -120,7 +120,7 @@ CreateController(sv, "DamRelease", Y = c("54095", "54057"), U = c("Dam"), FUN =
# GRiwrmRunOptions object simulation of the hydrological year 2002-2003
IndPeriod_Run <- seq.int(
which(IM_severn[[1]]$DatesR == "2002-10-15"),
which(IM_severn[[1]]$DatesR == as.POSIXct("2002-10-15")),
length.out = 365
)
IndPeriod_WarmUp <- seq.int(IndPeriod_Run[1] - 366, IndPeriod_Run[1] - 1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment