Skip to content

Commit

Permalink
add class catmaidneuron
Browse files Browse the repository at this point in the history
* also test for it
* closes #15
  • Loading branch information
jefferis committed Apr 27, 2015
1 parent 022f6bc commit 4bb78a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/catmaid_nat.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ read.neuron.catmaid<-function(skid, pid=1L, conn=NULL, ...) {
n[names(res[-1])]=res[-1]
fields_to_include=c("url", "headers")
n[fields_to_include]=attributes(res)[fields_to_include]
class(n)=c('catmaidneuron', 'neuron')
n
}

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ test_that("get neuron", {
test_that("read.neuron(s).catmaid", {
if(!inherits(conn, 'try-error')){
expect_is(n<-read.neuron.catmaid(pid=1, skid=10418394, conn=conn), 'neuron')
# check that we also have this specialised class
expect_is(n, 'catmaidneuron')
expect_is(nl<-read.neurons.catmaid(c(4453485,10418394), conn=conn), 'neuronlist')
expect_is(df<-as.data.frame(nl), 'data.frame')
expect_is(df$name, "character")
Expand Down

0 comments on commit 4bb78a3

Please sign in to comment.