Closed glwhart closed 1 year ago
Hi @glwhart,
I'm not a big fan of @load
for this reason. (I removed all mentions to it in the readme about 2 years ago)
@load
is a macro and therefore runs at parse-time. It will attempt to open the file and read the variable names to be loaded at parse time. It should work, if you just write @load "myvars" i
or, well i = load("myvars", "i")
Is there a better way to read in all the saved variables? Or is that just a bad thing to do?
I'm running an analysis script on remote cluster where all the data is. It's convenient sometimes to save the state of the script on the remote machine and then copy the state locally to debug the script or do further analysis.
Hm, that's an interesting question.
I honestly don't know a good solution to do this without specifying the variables that you want to load into the workspace.
I think the best thing to do is to decide which variables to save and then just do a jldsave
.
This is so strange, but I'm getting an error when @load refers to a missing file...but this happens even when the line with @load is never executed. Here is a minimal working example:
When I save this as a script and call it with
julia script.jl
I get an error:If I comment out line 6:
the script runs without error, creates the file
myvars
. Then if I uncomment line 6 and run again, the script runs without error, and (re)writes "myvars" as expected.