You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working through the load/save methods to figure out how things are dispatching. I'm a little confused about these lines, which AFAICT are so the user can specify the format explicitly as a first argument.
It seems like the save function that gets called here will be FileIO.save (not the save function from a loader package), which should get caught by the handlers right below, in which case I'm confused as to why it's going to the trouble of looking for a saver, importing the library, and evaling the call in Main (given that those things are happening below anyways).
which still passes all the tests. If I'm understanding this correctly this is also just another way to specify save(File(format"PNG", "myfile.png"), data), which is close to what's documented (for load at least).
So I guess this boils down to 2 questions:
Is the public-facing API for forcing the file type:
save(format"PNG", "myfile.png", data) or
save(File(format"PNG", "myfile.png"), data)
do these implementations need all the library-finding and eval magic?
Currently I'm leaning towards "the first" and "no", but there are definitely still things I'm not super clear on and context I don't have.
The text was updated successfully, but these errors were encountered:
I wasn't the last to touch those lines (see #94), but I'm guessing the eval is a world-age thing. I suspect that now we could replace it with invokelatest. Whether it passes tests might depend on the order in which you load packages. It's also possible that there's been some julia fixes, so if you really can't trigger any kind of error with the simpler versions, perhaps it would be worth pinging @yuyichao (deliberately backticked to avoid bothering him just yet) to see if he can remember what triggered the change.
I'm also a little uncertain about the purpose of getting libraries in those functions. (@SimonDanisch?)
Finally, I would personally be inclined to go with the save(::File, args...) version rather than the save(::Type{DataFormat{fmt}}, ::AbstractString, args...) version. But since that's opposite of your inclination, we either need to discuss or just keep both.
I'm working through the
load
/save
methods to figure out how things are dispatching. I'm a little confused about these lines, which AFAICT are so the user can specify the format explicitly as a first argument.reproduced here for convenience:
It seems like the
save
function that gets called here will beFileIO.save
(not thesave
function from a loader package), which should get caught by the handlers right below, in which case I'm confused as to why it's going to the trouble of looking for a saver, importing the library, andeval
ing the call inMain
(given that those things are happening below anyways).I tried replacing these
save
methods with just:which still passes all the tests. If I'm understanding this correctly this is also just another way to specify
save(File(format"PNG", "myfile.png"), data)
, which is close to what's documented (forload
at least).So I guess this boils down to 2 questions:
save(format"PNG", "myfile.png", data)
orsave(File(format"PNG", "myfile.png"), data)
eval
magic?Currently I'm leaning towards "the first" and "no", but there are definitely still things I'm not super clear on and context I don't have.
The text was updated successfully, but these errors were encountered: