specifying input files in IMP
Currently files which need input files take strings with the path to the file name. This is pretty easy, but eliminates the possibility of using more exotic sources and write destinations (such as reading and writing from memory). Since Ben has gotten streams working across the C++/Python bridge, we could switch our interfaces over to using streams everywhere. Thoughts?
Daniel Russel wrote: > Currently files which need input files take strings with the path to the > file name. This is pretty easy, but eliminates the possibility of using > more exotic sources and write destinations (such as reading and writing > from memory). Since Ben has gotten streams working across the C++/Python > bridge, we could switch our interfaces over to using streams everywhere. > Thoughts?
I was just thinking the same thing. If you could only choose one of filenames or streams, streams are clearly the more flexible way to go. (The only sort-of downside, I guess, is that for things such as density maps, the stream would have to be in binary mode to work properly. Right now filename-access functions can explicitly request that when they open the ifstream, whereas there's no way I know of to check an existing stream.)
But do we have to choose only one? One could argue that we could overload each method, to take either a string or a stream. But it seems more sensible to me to only have one method (the stream method) otherwise we have lots of extra code paths to test everywhere.
Ben
ok, decision time!
I suggest the following:
1. the stream version will be a "must-have" version, since it gives us more flexibility. 2. the string version is optional
what do you think?
Dina
On Fri, Apr 24, 2009 at 5:46 PM, Ben Webb ben@salilab.org wrote: > Daniel Russel wrote: >> Currently files which need input files take strings with the path to the >> file name. This is pretty easy, but eliminates the possibility of using >> more exotic sources and write destinations (such as reading and writing >> from memory). Since Ben has gotten streams working across the C++/Python >> bridge, we could switch our interfaces over to using streams everywhere. >> Thoughts? > > I was just thinking the same thing. If you could only choose one of > filenames or streams, streams are clearly the more flexible way to go. > (The only sort-of downside, I guess, is that for things such as density > maps, the stream would have to be in binary mode to work properly. Right > now filename-access functions can explicitly request that when they open > the ifstream, whereas there's no way I know of to check an existing stream.) > > But do we have to choose only one? One could argue that we could > overload each method, to take either a string or a stream. But it seems > more sensible to me to only have one method (the stream method) > otherwise we have lots of extra code paths to test everywhere. > > Ben > -- > ben@salilab.org http://salilab.org/~ben/ > "It is a capital mistake to theorize before one has data." > - Sir Arthur Conan Doyle > _______________________________________________ > IMP-dev mailing list > IMP-dev@salilab.org > https://salilab.org/mailman/listinfo/imp-dev >
Dina Schneidman wrote: > ok, decision time! > > I suggest the following: > > 1. the stream version will be a "must-have" version, since it gives us > more flexibility. > 2. the string version is optional
I think that's what I said. ;) Apologies if I wasn't clear. Yes, I agree...
Ben
I prefer streams too.
2009/5/5 Ben Webb ben@salilab.org
> Dina Schneidman wrote: > > ok, decision time! > > > > I suggest the following: > > > > 1. the stream version will be a "must-have" version, since it gives us > > more flexibility. > > 2. the string version is optional > > I think that's what I said. ;) Apologies if I wasn't clear. Yes, I agree... > > Ben > -- > ben@salilab.org http://salilab.org/~ben/http://salilab.org/%7Eben/ > "It is a capital mistake to theorize before one has data." > - Sir Arthur Conan Doyle > _______________________________________________ > IMP-dev mailing list > IMP-dev@salilab.org > https://salilab.org/mailman/listinfo/imp-dev >
participants (4)
-
Ben Webb
-
Daniel Russel
-
Dina Schneidman
-
Javier Ángel Velázquez Muriel