From 48737007fb8dbe9a782904e35985d93531625c22 Mon Sep 17 00:00:00 2001 From: Duncan Murdoch Date: Mon, 9 Jan 2023 08:22:08 -0500 Subject: [PATCH 1/3] Change rgl.* calls to *3d --- R/neuronlist.R | 4 ++-- man/nlapply.Rd | 4 ++-- tests/testthat/test-hxsurf.R | 2 +- tests/testthat/test-neuronlist.R | 2 +- tests/testthat/test-pop3d.R | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/neuronlist.R b/R/neuronlist.R index 50361eed..c7644c8f 100644 --- a/R/neuronlist.R +++ b/R/neuronlist.R @@ -428,7 +428,7 @@ as.data.frame.neuronlist<-function(x, row.names = names(x), optional = FALSE, .. #' open3d() #' plot3d(kcs.reduced,col='red', lwd=2) #' plot3d(kcs20,col='grey') -#' rgl.close() +#' close3d() #' #' \dontrun{ #' # example of using plyr's .inform argument for debugging error conditions @@ -464,7 +464,7 @@ as.data.frame.neuronlist<-function(x, row.names = names(x), optional = FALSE, .. #' open3d() #' plot3d(kcs20[1:3]) #' plot3d(xyzflip) -#' rgl.close() +#' close3d() #' } #' #' \dontrun{ diff --git a/man/nlapply.Rd b/man/nlapply.Rd index 1a98c899..6bd5e785 100644 --- a/man/nlapply.Rd +++ b/man/nlapply.Rd @@ -144,7 +144,7 @@ kcs.reduced=nlapply(kcs20,function(x) subset(x,sample(nrow(x$points),50))) open3d() plot3d(kcs.reduced,col='red', lwd=2) plot3d(kcs20,col='grey') -rgl.close() +close3d() \dontrun{ # example of using plyr's .inform argument for debugging error conditions @@ -180,7 +180,7 @@ xyzflip=nmapply(function(...) {Sys.sleep(.2);mirror(...)}, kcs20, open3d() plot3d(kcs20[1:3]) plot3d(xyzflip) -rgl.close() +close3d() } \dontrun{ diff --git a/tests/testthat/test-hxsurf.R b/tests/testthat/test-hxsurf.R index 97441240..b8762f30 100644 --- a/tests/testthat/test-hxsurf.R +++ b/tests/testthat/test-hxsurf.R @@ -26,7 +26,7 @@ test_that("we can read hxsurf object", { plot3d(surf,alpha=0.2) nclear3d() plot3d(surf,col=rainbow,alpha=0.2) - rgl.close() + close3d() #For plotly.. options(nat.plotengine='plotly') diff --git a/tests/testthat/test-neuronlist.R b/tests/testthat/test-neuronlist.R index d5746344..538f094f 100644 --- a/tests/testthat/test-neuronlist.R +++ b/tests/testthat/test-neuronlist.R @@ -240,7 +240,7 @@ test_that("basic interactive 3d functionality",{ expect_equal(find.soma(selfun, db=Cell07PNs, rval='neuronlist'), Cell07PNs[sel_soma]) - rgl.close() + close3d() }) context("neuronlist: set operations") diff --git a/tests/testthat/test-pop3d.R b/tests/testthat/test-pop3d.R index 8fa211e4..3d30ca89 100644 --- a/tests/testthat/test-pop3d.R +++ b/tests/testthat/test-pop3d.R @@ -2,11 +2,11 @@ context("npop3d") test_that("pop last plotted neurons",{ nopen3d() - original.rgl.ids=rgl.ids() + original.rgl.ids=ids3d() plot3d(c("EBH11R", "EBH20L"), db=Cell07PNs) npop3d() - expect_equal(rgl.ids(), original.rgl.ids) - rgl.close() + expect_equal(ids3d(), original.rgl.ids) + close3d() }) context("nview3d") From 5cc85622a92ca083ba0031d74b892622f4ff0a8a Mon Sep 17 00:00:00 2001 From: Gregory Jefferis Date: Fri, 13 Jan 2023 11:19:15 +0000 Subject: [PATCH 2/3] rgl.pop -> pop3d * as discussed in PR --- R/neuronlist_interactive_3d.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/neuronlist_interactive_3d.R b/R/neuronlist_interactive_3d.R index 76829026..be1488ec 100644 --- a/R/neuronlist_interactive_3d.R +++ b/R/neuronlist_interactive_3d.R @@ -194,8 +194,8 @@ nlscan <- function(neurons, db=NULL, if(Wait){ chc <- readline("Return to continue, b to go back, s to select, d [save to disk], t to stop, c to cancel (without returning a selection): ") if(chc=="c" || chc=='t'){ - sapply(pl, rgl.pop, type='shape') - sapply(more_rgl_ids, rgl.pop, type='shape') + sapply(pl, pop3d, type='shape') + sapply(more_rgl_ids, pop3d, type='shape') break } if(chc=="s") { @@ -211,8 +211,8 @@ nlscan <- function(neurons, db=NULL, Sys.sleep(sleep) i <- i+1 } - sapply(pl, rgl.pop, type='shape') - sapply(more_rgl_ids, rgl.pop, type='shape') + sapply(pl, pop3d, type='shape') + sapply(more_rgl_ids, pop3d, type='shape') } if(is.null(chc) || chc=='c') return(NULL) if(!is.null(selected_file)) savetodisk(selected, selected_file) From ad29cdc2b56090137e6b1f1d657b2c2fa4c352e4 Mon Sep 17 00:00:00 2001 From: Gregory Jefferis Date: Mon, 23 Jan 2023 16:48:14 +0000 Subject: [PATCH 3/3] ignore codecov --- .Rbuildignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rbuildignore b/.Rbuildignore index 38b100b9..c9361f7e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -14,3 +14,4 @@ travisbuildchildren.sh ^pkgdown$ ^\.github$ ^depends.Rds$ +^codecov\.yml$