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

Suggested feature: antsSaveAll #16

Closed
dorianps opened this issue Mar 3, 2015 · 14 comments
Closed

Suggested feature: antsSaveAll #16

dorianps opened this issue Mar 3, 2015 · 14 comments

Comments

@dorianps
Copy link
Collaborator

dorianps commented Mar 3, 2015

It would be extremely useful to have a function that can save the entire workspace in a single line. Right now is very difficult to keep track of what is a pointer and what is not, then save them separately, then write code again to load them on new session. A save-all function can take this burden away, create cleaner code with one-line saving, and offer to restart at different levels of a script. Of course, this should be complemented with a load function.

@bkandel
Copy link
Collaborator

bkandel commented Mar 3, 2015

That's a good idea. Shouldn't be too hard to do. I almost never save my
workspace, but this would be helpful to have around. I'll try to get to
this tomorrow.

2015-03-03 9:55 GMT-05:00 dorianps notifications@github.com:

It would be extremely useful to have a function that can save the entire
workspace in a single line. Right now is very difficult to keep track of
what is a pointer and what is not, then save them separately, then write
code again to load them on new session. A save-all function can take this
burden away, create cleaner code with one-line saving, and offer to restart
at different levels of a script.


Reply to this email directly or view it on GitHub
#16.

@dorianps
Copy link
Collaborator Author

dorianps commented Mar 3, 2015

There are multiple benefits:

  1. You can restart at any point you left with days in between.
  2. You can save in one window, and load another window to proceed with a different parameter (no need to run all the code until that point).
  3. You can avoid having hours lost by unexpected events (blackouts, connection problems).
  4. Will make the software more usable.

Last night there were multiple network interruptions, so Rstudio died. I spent 2 hours this morning just to reach the same state I had when I started the analysis last night.

@bkandel
Copy link
Collaborator

bkandel commented Mar 3, 2015

Just as a practical matter--do you mount the cluster drive? Mounting the
cluster and then running R/Rstudio on your local machine is much less
sensitive to network blips than running R on the cluster.

2015-03-03 10:18 GMT-05:00 dorianps notifications@github.com:

There are multiple benefits:

  1. You can restart at any point you left with days in between.
  2. You can save in one window, and load another window to proceed with a
    different parameter (no need to run all the code until that point).
  3. You can avoid having hours lost by unexpected events (blackouts,
    connection problems).
  4. Will make the software more usable.

Last night there were multiple network interruptions, so Rstudio died. I
spent 2 hours this morning just to reach the same state I had when I
started the analysis last night.


Reply to this email directly or view it on GitHub
#16 (comment).

@dorianps
Copy link
Collaborator Author

dorianps commented Mar 3, 2015

Hmmm, I only mount it as external drive. You mean I might be able to point my Windows Rstudio to the cluster R in linux and make it work? That would be great. Let me know if you do that.

@bkandel
Copy link
Collaborator

bkandel commented Mar 3, 2015

Hmm...no, that would probably be worse. I'm a bit surprised then that
Rstudio died when the cluster connection failed. I guess it tried to read
or write and couldn't and then hung?

2015-03-03 10:36 GMT-05:00 dorianps notifications@github.com:

Hmmm, I only mount it as external drive. You mean I might be able to point
my Windows Rstudio to the cluster R in linux and make it work? That would
be great. Let me know if you do that.


Reply to this email directly or view it on GitHub
#16 (comment).

@dorianps
Copy link
Collaborator Author

dorianps commented Mar 3, 2015

Yes, off topic, but the way I use it is by calling Rstudio from cluster in an X-server. If the connection to the cluster breaks, Rstudio can't push the display, so it dies. There is an rstudio-server supposed to be better, I am waiting for Michael to install it. Nevertheless, a save function for antsR will be necessary sooner or later.

@bkandel
Copy link
Collaborator

bkandel commented Mar 3, 2015

Ah, OK. So what I was suggesting was to run RStudio on your local machine,
and then just point it to the (mounted) cluster drive to read whenever it
has to load data. That way if the connection gets lost, Rstudio will be
fine and if need be you can save your work locally to continue later.

2015-03-03 11:07 GMT-05:00 dorianps notifications@github.com:

Yes, off topic, but the way I use it is by calling Rstudio from cluster in
an X-server. If the connection to the cluster breaks, Rstudio can't push
the display, so it dies. There is an rstudio-server supposed to be better,
I am waiting for Michael to install it. Nevertheless, a save function for
antsR will be necessary sooner or later.


Reply to this email directly or view it on GitHub
#16 (comment).

@dorianps
Copy link
Collaborator Author

dorianps commented Mar 3, 2015

Problem is there is no antsR in Windows, haven't figured out a way to install it.

@bkandel bkandel self-assigned this Mar 6, 2015
@bkandel
Copy link
Collaborator

bkandel commented Mar 6, 2015

Just pushed save.ANTsR and load.ANTsR, which should solve this problem. It works for my test cases, but if you could make sure it works for you that would be helpful. Ended up being a little trickier than I thought it would be.

@stnava
Copy link
Member

stnava commented Mar 6, 2015

generated a new warning from R CMD check

  • checking R code for possible problems ... NOTE

load.ANTsR: no visible binding for global variable ‘ANTsRImageData’

Found the following assignments to the global environment:

File ‘ANTsR/R/save.ANTsR.R’:

assign(as.character(ANTsRImageData$names[ii]),
antsImageRead(file.path(filename,

paste(as.character(ANTsRImageData$names[ii], ".nii.gz", sep = ""))),

ANTsRImageData$dims[ii], ANTsRImageData$pixeltypes[ii]),

envir = .GlobalEnv)
  • checking Rd files ... OK

brian

On Thu, Mar 5, 2015 at 10:58 PM, bkandel notifications@github.com wrote:

Just pushed save.ANTsR and load.ANTsR, which should solve this problem. It
works for my test cases, but if you could make sure it works for you that
would be helpful. Ended up being a little trickier than I thought it would
be.


Reply to this email directly or view it on GitHub
#16 (comment).

@bkandel
Copy link
Collaborator

bkandel commented Mar 8, 2015

Shoot. Sorry about that. Should be fixed now.

2015-03-06 16:14 GMT-05:00 stnava notifications@github.com:

generated a new warning from R CMD check

  • checking R code for possible problems ... NOTE

load.ANTsR: no visible binding for global variable ‘ANTsRImageData’

Found the following assignments to the global environment:

File ‘ANTsR/R/save.ANTsR.R’:

assign(as.character(ANTsRImageData$names[ii]),
antsImageRead(file.path(filename,

paste(as.character(ANTsRImageData$names[ii], ".nii.gz", sep = ""))),

ANTsRImageData$dims[ii], ANTsRImageData$pixeltypes[ii]),

envir = .GlobalEnv)

  • checking Rd files ... OK

brian

On Thu, Mar 5, 2015 at 10:58 PM, bkandel notifications@github.com wrote:

Just pushed save.ANTsR and load.ANTsR, which should solve this problem.
It
works for my test cases, but if you could make sure it works for you that
would be helpful. Ended up being a little trickier than I thought it
would
be.


Reply to this email directly or view it on GitHub
#16 (comment).


Reply to this email directly or view it on GitHub
#16 (comment).

@stnava
Copy link
Member

stnava commented Mar 8, 2015

still seeing:

Found the following assignments to the global environment:
File ‘ANTsR/R/save.ANTsR.R’:
assign(as.character(ANTsRImageData$names[ii]), antsImageRead(file.path(filename,
paste(as.character(ANTsRImageData$names[ii], ".nii.gz", sep = ""))),
ANTsRImageData$dims[ii], as.character(ANTsRImageData$pixeltypes[ii])),
envir = .GlobalEnv)

@stnava
Copy link
Member

stnava commented Mar 8, 2015

@bkandel
Copy link
Collaborator

bkandel commented Mar 8, 2015

Ah, that's a good idea. Should've realized that would be considered
"anti-social" by CRAN.

2015-03-08 13:02 GMT-04:00 stnava notifications@github.com:

i think you need something like this:

http://www.talkstats.com/showthread.php/38050-CRAN-submission-problem-help-brainstorming


Reply to this email directly or view it on GitHub
#16 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants