Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for #394 #396

Merged
merged 8 commits into from Jun 20, 2019
Merged

Updated for #394 #396

merged 8 commits into from Jun 20, 2019

Conversation

SridharJagannathan
Copy link
Collaborator

@SridharJagannathan SridharJagannathan commented Jun 19, 2019

Updated the check for InputFileName and added test cases for #394

@coveralls
Copy link

coveralls commented Jun 19, 2019

Coverage Status

Coverage increased (+0.04%) to 83.935% when pulling d7a2c3f on feature/InputFileName into 2d849ec on master.

Copy link
Collaborator

@jefferis jefferis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good way to do this is like so:

    if(isTRUE(nzchar(n$InputFileName)))
      file=basename(n$InputFileName)
    else
      stop("No file specified and neuron does not have an InputFileName")

y=Cell07PNs[[1]]
td=tempfile()
on.exit(unlink(td,recursive=TRUE))
if ("InputFileName" %in% names(y)){y["InputFileName"] <- NULL}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y$InputFileName is the same as y[["InputFileName"]] which is probably what you want.

test_that("we can write neuron/dotprops to rds file",{
x=kcs20[[1]]
td=tempfile()
on.exit(unlink(td,recursive=TRUE))
expect_error(f<-write.neuron(x, dir=td, MakeDir = F), 'does not exist')
expect_equal(f<-write.neuron(x, dir=td),
expect_equal(f<-write.neuron(x, dir=td, format = 'rds'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roll that back.

dir.create(td)
on.exit(unlink(td,recursive=TRUE))
#Try writing with default format
expect_warning(f <- write.neuron(y, dir=td, MakeDir = F),'Defaulting format to swc')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you maybe put this as the message: "write.neuron: using default format='swc'"

Copy link
Collaborator

@jefferis jefferis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@jefferis jefferis merged commit 923b7c9 into master Jun 20, 2019
@jefferis jefferis deleted the feature/InputFileName branch August 5, 2019 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants