Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • airGR airGR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 60
    • Issues 60
    • List
    • Boards
    • Service Desk
    • Milestones
  • Redmine
    • Redmine
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • HYCAR-HydroHYCAR-Hydro
  • airGRairGR
  • Issues
  • #94
Closed
Open
Issue created Jan 25, 2021 by Delaigue Olivier@olivier.delaigueOwner

Use of relational operators on POSIXlt on CRAN macOS flavors

airGR 1.6.9.27 checks return errors on masOS (also see CRAN_v1.6.9.27 tag). Ir works well on Linux and Windows OS.

It seems to be because of the a comparison on POSIXlt dates to return a subset of time series.

In RunModel_GR1A() example, I think that the TabSeries time series is not the wanted one. Maybe 2012-09-01 is selected, so SeriesAggreg() returns NA values for the last time step. Then, InputsModel() return an error.

library(airGR)

## loading catchment data

data(L0123001)

## conversion of example data from daily to yearly time step
TabSeries <- data.frame(DatesR = BasinObs$DatesR,
                        P = BasinObs$P,
                        E = BasinObs$E,
                        Qmm = BasinObs$Qmm)
TabSeries <- TabSeries[TabSeries$DatesR < "2012-09-01", ]
BasinObs <- SeriesAggreg(TabSeries, Format = "%Y",
                         YearFirstMonth = 09,
                         ConvertFun = c("sum", "sum", "sum"))

## preparation of the InputsModel object
InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR1A, DatesR = BasinObs$DatesR,
                                 Precip = BasinObs$P, PotEvap = BasinObs$E)

I think that there is a similar problem in "test-SerriesAggreg" (line 64); the GoodValues time series is not the wanted one. Then expect_equal() detects a difference.

  GoodValues <- apply(BasinObs[BasinObs$DatesR >= "1984-09-01" &
                                 BasinObs$DatesR < "1985-09-01",
                               c("P", "E", "Qmm")], 2, sum)
  TestedValues <- unlist(SeriesAggreg(TabSeries,
                                      Format = "%Y",
                                      YearFirstMonth = 9,
                                      ConvertFun = rep("sum", 3))[1, c("P", "E", "Qmm")])
  expect_equal(GoodValues, TestedValues)

Nota: in TabSeries$DatesR < "2012-09-01", TabSeries$DatesR is in UTC and "2012-09-01" is in local time, this is normally not a problem at the daily time step.

Edited Jan 25, 2021 by Delaigue Olivier
Assignee
Assign to
Time tracking