inlabru-org / inlabru

inlabru
https://inlabru-org.github.io/inlabru/
76 stars 21 forks source link

CMD check error with sf 0.9-9 (github), sp 1.4-6 (my github fork) and PROJ 8.0.0 #110

Closed rsbivand closed 2 years ago

rsbivand commented 3 years ago

For:

`ips <- ipoints(mrsea$samplers, mrsea$mesh, group = "season")` did not throw the expected warning. Failure (test_ipoints.R:78:3): SLDF in metres to integration points using grouping parameter

I see:

>   data(mrsea, package = "inlabru")
>   mrsea <- local_mrsea_convert(mrsea, use_km = FALSE)
Warning messages:
1: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded ellps unknown in Proj4 definition: +proj=longlat +R=1 +no_defs +type=crs
2: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum unknown in Proj4 definition
3: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded ellps unknown in Proj4 definition: +proj=longlat +R=6378137 +no_defs +type=crs
4: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum unknown in Proj4 definition
5: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded ellps unknown in Proj4 definition: +proj=longlat +R=6378137 +no_defs +type=crs
6: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum unknown in Proj4 definition
7: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded ellps unknown in Proj4 definition: +proj=geocent +R=1 +units=m +no_defs +type=crs
8: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum unknown in Proj4 definition
> ips <- ipoints(mrsea$samplers, mrsea$mesh, group = "season")
Warning messages:
1: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum Unknown based on Normal Sphere (r=6370997) ellipsoid in Proj4 definition
2: In doTryCatch(return(expr), name, parentenv, handler) :
  export to PROJ failed: Unknown error (code 4096)
3: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded ellps Normal Sphere (r=6370997) in Proj4 definition: NA
4: In showSRID(SRS_string, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum Unknown based on Normal Sphere (r=6370997) ellipsoid in Proj4 definition
> class(ips)
[1] "SpatialPointsDataFrame"
attr(,"package")
[1] "sp"
> colnames(data.frame(ips))
[1] "weight"      "vertex"      "season"      "x"           "y"          
[6] "coordinateZ" "optional"   
> sum(ips$weight)
[1] 2283624
> sum(ips$weight) / 2293712
[1] 0.9956021

I do not think it helps to expect unchanging warnings from packages and external software that change. Maybe suppress/mute the test?

finnlindgren commented 3 years ago

I think those tests for expected rgdal warnings were added to make sure I didn't miss any transition issues, but yes, I should be able to skip those tests now, and/or make it ignore the known warnings. I do want to catch warnings I don't know about, since the units issue is a bit messy to get right, and can otherwise silently break user results.

finnlindgren commented 3 years ago

I've now (cd53f90) replaced these tests (two instances of the same type) with suppressWarnings() which should solve the issue.

finnlindgren commented 3 years ago

Direct sf support in inlabru is also on my TODO-list (though that by itself won't help with the units issue).

rsbivand commented 3 years ago

inlabru_2.3.1.9000.tar.gz from devel check cleany now, thanks!