Skip to content

[get_sim2_daily] Dates are not in ascendant order in netCDF format

It's worth to notice that this does not have an impact for csv format on which row order does not matter.

Bug related to radis.api#26 (closed):

  date_start <- as.Date("1999-01-01")
  date_end <- cutoff_date
  sf <- sf::read_sf(system.file("extdata/study_area/test.shp", package = "RADIS"))
  clim <- get_sim2_daily(
    sf::st_bbox(sf),
    DATE__greater = date_start,
    DATE__less = date_end,
    fields = fields,
    api_format = "ncdf",
    overlay_mode = "extent"
  )
  expect_equal(
    stars::st_get_dimension_values(clim, "time"),
    seq(date_start, date_end, by = "1 day")
  )
Error: stars::st_get_dimension_values(clim, "time") (`actual`) not equal to seq(date_start, date_end, by = "1 day") (`expected`).

      actual       | expected                      
[363] "1999-12-29" | "1999-12-29" [363]            
[364] "1999-12-30" | "1999-12-30" [364]            
[365] "1999-12-31" | "1999-12-31" [365]            
[366] "2020-01-01" - "2000-01-01" [366]            
[367] "2020-01-02" - "2000-01-02" [367]            
[368] "2020-01-03" - "2000-01-03" [368]            
[369] "2020-01-04" - "2000-01-04" [369]            
[370] "2020-01-05" - "2000-01-05" [370]            
[371] "2020-01-06" - "2000-01-06" [371]            
[372] "2020-01-07" - "2000-01-07" [372]            
  ... ...            ...          and 9261 more ...