Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Dec 16, 2024
1 parent f5926e8 commit bb5ed0d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 23 deletions.
4 changes: 4 additions & 0 deletions inst/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-09-03 edzer <[email protected]>

* inst/ChangeLog, tests/stars.Rout.save: clean test output

2024-08-23 edzer <[email protected]>

* inst/ChangeLog, src/Makevars, src/mtrx.c, src/s.c, src/userio.c:
Expand Down
3 changes: 2 additions & 1 deletion tests/stars.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ if (require(raster, quietly = TRUE)) {

suppressPackageStartupMessages(library(spacetime))

Sys.setenv(TZ="")
tm = as.POSIXct("2019-02-25 15:37:24 CET")
n = 4
s = stars:::st_stars(list(foo = array(1:(n^3), rep(n,3))),
Expand Down Expand Up @@ -85,4 +84,6 @@ meuse_sf = st_as_sf(meuse, coords = c("x", "y"))
g = gstat(NULL, "zinc", zinc~1, meuse_sf, model = vgm(1, "Exp", 300), nmax = 10)
g = gstat(g, "lead", lead~1, meuse_sf, model = vgm(1, "Exp", 300), nmax = 10, fill.cross = TRUE)
set.seed(123)
## IGNORE_RDIFF_BEGIN
(p = predict(g, meuse.grid, nsim = 5))
## IGNORE_RDIFF_END
25 changes: 13 additions & 12 deletions tests/stars.Rout.save
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ band
>
> suppressPackageStartupMessages(library(spacetime))
>
> Sys.setenv(TZ="")
> tm = as.POSIXct("2019-02-25 15:37:24 CET")
> n = 4
> s = stars:::st_stars(list(foo = array(1:(n^3), rep(n,3))),
Expand All @@ -256,10 +255,10 @@ attribute(s):
Min. 1st Qu. Median Mean 3rd Qu. Max.
foo 1 16.75 32.5 32.5 48.25 64
dimension(s):
from to offset delta refsys x/y
x 1 4 10 0.5 NA [x]
y 1 4 0 -0.7 NA [y]
time 1 4 2019-02-25 15:37:25 Universal 1 secs POSIXct
from to offset delta refsys x/y
x 1 4 10 0.5 NA [x]
y 1 4 0 -0.7 NA [y]
time 1 4 2019-02-25 15:37:25 UTC 1 secs POSIXct
>
> as.data.frame(s)
x y time foo
Expand Down Expand Up @@ -431,8 +430,8 @@ Slot "time":
2019-02-25 15:37:28 4

Slot "endTime":
[1] "2019-02-25 15:37:26 Universal" "2019-02-25 15:37:27 Universal"
[3] "2019-02-25 15:37:28 Universal" "2019-02-25 15:37:29 Universal"
[1] "2019-02-25 15:37:26 UTC" "2019-02-25 15:37:27 UTC"
[3] "2019-02-25 15:37:28 UTC" "2019-02-25 15:37:29 UTC"

> stplot(s.stfdf, scales = list(draw = TRUE))
>
Expand All @@ -442,10 +441,10 @@ attribute(s):
Min. 1st Qu. Median Mean 3rd Qu. Max.
foo 1 16.75 32.5 32.5 48.25 64
dimension(s):
from to offset delta refsys x/y
x 1 4 10 0.5 NA [x]
y 1 4 -1.11e-16 -0.7 NA [y]
time 1 4 2019-02-25 15:37:25 Universal 1 secs POSIXct
from to offset delta refsys x/y
x 1 4 10 0.5 NA [x]
y 1 4 -1.11e-16 -0.7 NA [y]
time 1 4 2019-02-25 15:37:25 UTC 1 secs POSIXct
> plot(s2, col = sf.colors(), axes = TRUE)
> all.equal(s, s2, check.attributes = FALSE)
[1] TRUE
Expand All @@ -460,6 +459,7 @@ time 1 4 2019-02-25 15:37:25 Universal 1 secs POSIXct
> g = gstat(NULL, "zinc", zinc~1, meuse_sf, model = vgm(1, "Exp", 300), nmax = 10)
> g = gstat(g, "lead", lead~1, meuse_sf, model = vgm(1, "Exp", 300), nmax = 10, fill.cross = TRUE)
> set.seed(123)
> ## IGNORE_RDIFF_BEGIN
> (p = predict(g, meuse.grid, nsim = 5))
drawing 5 multivariate GLS realisations of beta...
[using conditional Gaussian simulation]
Expand All @@ -473,7 +473,8 @@ dimension(s):
x 1 78 178440 40 NULL [x]
y 1 104 333760 -40 NULL [y]
sample 1 5 NA NA sim1,...,sim5
> ## IGNORE_RDIFF_END
>
> proc.time()
user system elapsed
5.792 7.819 4.934
5.561 8.100 4.738
7 changes: 5 additions & 2 deletions tests/vdist.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ mg = meuse.grid
gridded(mg) = FALSE
mg= mg[1500,]
krige(log(zinc)~1,meuse,mg,vgm(1, "Exp", 300, anis=c(0,0.01)),
vdist=FALSE, maxdist=1000,nmax=10)
vdist=FALSE, maxdist=1000, nmax = 9)

## IGNORE_RDIFF_BEGIN
krige(log(zinc)~1,meuse,mg,vgm(1, "Exp", 300, anis=c(0,0.01)),
vdist=TRUE, maxdist=1000,nmax=10)
vdist=TRUE, maxdist=1000, nmax = 9)
## IGNORE_RDIFF_END
19 changes: 11 additions & 8 deletions tests/vdist.Rout.save
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Expand All @@ -27,16 +27,19 @@ Type 'q()' to quit R.
> gridded(mg) = FALSE
> mg= mg[1500,]
> krige(log(zinc)~1,meuse,mg,vgm(1, "Exp", 300, anis=c(0,0.01)),
+ vdist=FALSE, maxdist=1000,nmax=10)
+ vdist=FALSE, maxdist=1000, nmax = 9)
[using ordinary kriging]
coordinates var1.pred var1.var
1500 (180260, 331300) 5.007376 1.102622
1500 (180260, 331300) 5.024413 1.114475
>
> ## IGNORE_RDIFF_BEGIN
> krige(log(zinc)~1,meuse,mg,vgm(1, "Exp", 300, anis=c(0,0.01)),
+ vdist=TRUE, maxdist=1000,nmax=10)
+ vdist=TRUE, maxdist=1000, nmax = 9)
[using ordinary kriging]
coordinates var1.pred var1.var
1500 (180260, 331300) 5.50671 1.100095
1500 (180260, 331300) 5.568531 1.112945
> ## IGNORE_RDIFF_END
>
> proc.time()
user system elapsed
1.308 0.052 1.370
0.593 1.446 0.532

0 comments on commit bb5ed0d

Please sign in to comment.