Skip to content

Commit d5b8b59

Browse files
author
Insang Song
authored
Merge pull request #100 from NIEHS/0.8.1
0.8.1: README fix
2 parents ad36703 + 5843eb9 commit d5b8b59

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ knitr::opts_chunk$set(
1414
)
1515
```
1616

17-
# Computation of Spatial Data by Hierarchical and Objective Partitioning of Inputs for Parallel Processing <img src="man/figures/logo.png" align="right" height="210" alt="overlapping irregular grid polygons filled with orange, green, and teal" /></a>
17+
# Computation of Spatial Data by Hierarchical and Objective Partitioning of Inputs for Parallel Processing <img src="man/figures/logo.svg" align="right" height="210" alt="overlapping irregular grid polygons filled with orange, green, and teal" /></a>
1818

1919
<!-- badges: start -->
2020
[![cov](https://NIEHS.github.io/chopin/badges/coverage.svg)](https://github.com/NIEHS/chopin/actions)

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Computation of Spatial Data by Hierarchical and Objective Partitioning of Inputs for Parallel Processing <img src="man/figures/logo.png" align="right" height="210" alt="overlapping irregular grid polygons filled with orange, green, and teal" /></a>
2+
# Computation of Spatial Data by Hierarchical and Objective Partitioning of Inputs for Parallel Processing <img src="man/figures/logo.svg" align="right" height="210" alt="overlapping irregular grid polygons filled with orange, green, and teal" /></a>
33

44
<!-- badges: start -->
55

@@ -233,7 +233,7 @@ system.time(
233233
)
234234
#> Input is a character. Attempt to read it with terra::rast...
235235
#> user system elapsed
236-
#> 5.008 0.038 5.097
236+
#> 5.370 0.059 5.484
237237
```
238238

239239
#### Generate regular grid computational regions
@@ -320,7 +320,7 @@ system.time(
320320
#> Input is a character. Attempt to read it with terra::rast...
321321
#> ℹ Task at CGRIDID: 4 is successfully dispatched.
322322
#> user system elapsed
323-
#> 0.330 0.003 7.401
323+
#> 0.340 0.011 7.568
324324

325325
ncpoints_srtm <-
326326
extract_at(
@@ -379,7 +379,7 @@ path_nchrchy <- file.path(wdir, "nc_hierarchy.gpkg")
379379
nc_data <- path_nchrchy
380380
nc_county <- sf::st_read(nc_data, layer = "county")
381381
#> Reading layer `county' from data source
382-
#> `/tmp/RtmpzRLuhC/temp_libpath433aa6a79610a/chopin/extdata/nc_hierarchy.gpkg'
382+
#> `/tmp/RtmpzRLuhC/temp_libpath433aa98ffa24/chopin/extdata/nc_hierarchy.gpkg'
383383
#> using driver `GPKG'
384384
#> Simple feature collection with 100 features and 1 field
385385
#> Geometry type: POLYGON
@@ -388,7 +388,7 @@ nc_county <- sf::st_read(nc_data, layer = "county")
388388
#> Projected CRS: NAD83 / Conus Albers
389389
nc_tracts <- sf::st_read(nc_data, layer = "tracts")
390390
#> Reading layer `tracts' from data source
391-
#> `/tmp/RtmpzRLuhC/temp_libpath433aa6a79610a/chopin/extdata/nc_hierarchy.gpkg'
391+
#> `/tmp/RtmpzRLuhC/temp_libpath433aa98ffa24/chopin/extdata/nc_hierarchy.gpkg'
392392
#> using driver `GPKG'
393393
#> Simple feature collection with 2672 features and 1 field
394394
#> Geometry type: MULTIPOLYGON
@@ -416,7 +416,7 @@ system.time(
416416
)
417417
#> Input is a character. Attempt to read it with terra::rast...
418418
#> user system elapsed
419-
#> 0.521 0.010 0.531
419+
#> 0.59 0.00 0.59
420420

421421
# hierarchical parallelization
422422
system.time(
@@ -534,7 +534,7 @@ system.time(
534534
#> Input is a character. Attempt to read it with terra::rast...ℹ Your input function at 37055 is dispatched.
535535
#> Input is a character. Attempt to read it with terra::rast...ℹ Your input function at 37047 is dispatched.
536536
#> user system elapsed
537-
#> 0.234 0.022 1.957
537+
#> 0.217 0.040 2.039
538538
```
539539

540540
### `par_multirasters()`: parallelize over multiple rasters
@@ -561,9 +561,9 @@ terra::writeRaster(ncelev, file.path(tdir, "test5.tif"), overwrite = TRUE)
561561
# check if the raster files were exported as expected
562562
testfiles <- list.files(tdir, pattern = "*.tif$", full.names = TRUE)
563563
testfiles
564-
#> [1] "/tmp/RtmpgrTtLh/test1.tif" "/tmp/RtmpgrTtLh/test2.tif"
565-
#> [3] "/tmp/RtmpgrTtLh/test3.tif" "/tmp/RtmpgrTtLh/test4.tif"
566-
#> [5] "/tmp/RtmpgrTtLh/test5.tif"
564+
#> [1] "/tmp/Rtmp5G5SPz/test1.tif" "/tmp/Rtmp5G5SPz/test2.tif"
565+
#> [3] "/tmp/Rtmp5G5SPz/test3.tif" "/tmp/Rtmp5G5SPz/test4.tif"
566+
#> [5] "/tmp/Rtmp5G5SPz/test5.tif"
567567
```
568568

569569
``` r
@@ -580,32 +580,32 @@ system.time(
580580
)
581581
#> ℹ Input is not a character.
582582
#> Input is a character. Attempt to read it with terra::rast...
583-
#> ℹ Your input function at /tmp/RtmpgrTtLh/test1.tif is dispatched.
583+
#> ℹ Your input function at /tmp/Rtmp5G5SPz/test1.tif is dispatched.
584584
#>
585585
#> Input is a character. Attempt to read it with terra::rast...
586-
#> ℹ Your input function at /tmp/RtmpgrTtLh/test2.tif is dispatched.
586+
#> ℹ Your input function at /tmp/Rtmp5G5SPz/test2.tif is dispatched.
587587
#>
588588
#> Input is a character. Attempt to read it with terra::rast...
589-
#> ℹ Your input function at /tmp/RtmpgrTtLh/test3.tif is dispatched.
589+
#> ℹ Your input function at /tmp/Rtmp5G5SPz/test3.tif is dispatched.
590590
#>
591591
#> Input is a character. Attempt to read it with terra::rast...
592-
#> ℹ Your input function at /tmp/RtmpgrTtLh/test4.tif is dispatched.
592+
#> ℹ Your input function at /tmp/Rtmp5G5SPz/test4.tif is dispatched.
593593
#>
594594
#> Input is a character. Attempt to read it with terra::rast...
595-
#> ℹ Your input function at /tmp/RtmpgrTtLh/test5.tif is dispatched.
595+
#> ℹ Your input function at /tmp/Rtmp5G5SPz/test5.tif is dispatched.
596596
#> user system elapsed
597-
#> 1.136 0.151 2.335
597+
#> 1.353 0.110 2.550
598598
knitr::kable(head(res))
599599
```
600600

601601
| mean | base\_raster |
602602
| --------: | :------------------------ |
603-
| 136.80203 | /tmp/RtmpgrTtLh/test1.tif |
604-
| 189.76170 | /tmp/RtmpgrTtLh/test1.tif |
605-
| 231.16968 | /tmp/RtmpgrTtLh/test1.tif |
606-
| 98.03845 | /tmp/RtmpgrTtLh/test1.tif |
607-
| 41.23463 | /tmp/RtmpgrTtLh/test1.tif |
608-
| 270.96933 | /tmp/RtmpgrTtLh/test1.tif |
603+
| 136.80203 | /tmp/Rtmp5G5SPz/test1.tif |
604+
| 189.76170 | /tmp/Rtmp5G5SPz/test1.tif |
605+
| 231.16968 | /tmp/Rtmp5G5SPz/test1.tif |
606+
| 98.03845 | /tmp/Rtmp5G5SPz/test1.tif |
607+
| 41.23463 | /tmp/Rtmp5G5SPz/test1.tif |
608+
| 270.96933 | /tmp/Rtmp5G5SPz/test1.tif |
609609

610610
``` r
611611

@@ -641,7 +641,7 @@ pnts <- sf::st_as_sf(pnts)
641641
pnts$pid <- sprintf("RPID-%04d", seq(1, 5000))
642642
rd1 <- sf::st_read(path_ncrd1)
643643
#> Reading layer `ncroads_first' from data source
644-
#> `/tmp/RtmpzRLuhC/temp_libpath433aa6a79610a/chopin/extdata/ncroads_first.gpkg'
644+
#> `/tmp/RtmpzRLuhC/temp_libpath433aa98ffa24/chopin/extdata/ncroads_first.gpkg'
645645
#> using driver `GPKG'
646646
#> Simple feature collection with 620 features and 4 fields
647647
#> Geometry type: MULTILINESTRING
@@ -694,11 +694,11 @@ system.time(
694694
restr <- terra::nearest(x = terra::vect(pntst), y = terra::vect(rd1t))
695695
)
696696
#> user system elapsed
697-
#> 0.377 0.000 0.378
697+
#> 0.405 0.000 0.417
698698

699699
pnt_path <- file.path(tdir, "pntst.gpkg")
700700
sf::st_write(pntst, pnt_path)
701-
#> Writing layer `pntst' to data source `/tmp/RtmpgrTtLh/pntst.gpkg' using driver `GPKG'
701+
#> Writing layer `pntst' to data source `/tmp/Rtmp5G5SPz/pntst.gpkg' using driver `GPKG'
702702
#> Writing 5000 features with 1 fields and geometry type Point.
703703

704704
# we use four threads that were configured above
@@ -744,7 +744,7 @@ system.time(
744744
#> ℹ Input is a character. Trying to read with terra .
745745
#> ℹ Task at CGRIDID: 8 is successfully dispatched.
746746
#> user system elapsed
747-
#> 0.065 0.000 0.510
747+
#> 0.096 0.001 0.550
748748
```
749749

750750
- We will compare the results from the single-thread and multi-thread

0 commit comments

Comments
 (0)