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
The read_all_blocks method has a problem for large files: it requires loading all blocks into memory at the same time. If implement #176 and add a read_all method in BaseIO, I would also suggest we implement an __iter__ method. This would just read each object in read_all one-at-a-time. In BaseIO, read_all would just be list(iter(self)), and __iter__ would just be iter([self.read()]), but one or both of these could be overrided in other classes. This would allow a user to just do
forobjinioobj:
do_something(obj)
This would be a good parallel to the built-in:
forlineinfileobj:
do_something(fileobj)
So people reading standard python docs will be able to easily translate it into neo without needing to know or care about the details of the IO class.
OK for me.
It is only relevent for multi block IOs (fiew at the moment).
We maybe should think about implementing some king of iter or yield at relationship level.
For instance Block.segments or Segment.analogsignals.
Sounds good and easy to implement. Concerning relationships below blocks, that's what lazy cascading is for: Only objects that are actually accessed are loaded, transparent to the user.
Activity
samuelgarcia commentedon Jul 21, 2014
OK for me.
It is only relevent for multi block IOs (fiew at the moment).
We maybe should think about implementing some king of iter or yield at relationship level.
For instance Block.segments or Segment.analogsignals.
But for now iter on Block at Io level is good.
Thanks.
rproepp commentedon Jul 22, 2014
Sounds good and easy to implement. Concerning relationships below blocks, that's what lazy cascading is for: Only objects that are actually accessed are loaded, transparent to the user.
samuelgarcia commentedon Jul 22, 2014
OK.
samuelgarcia commentedon Jun 14, 2023
Let close now. And reopen if someone want to implement it.