Make `Frame` indexable
rashidrafeek opened this issue · comments
Rashid Rafeek commented
I saw from the docs of the C++ interface that Frame
objects can be indexed to get atoms from the frame. But this is not implemented here. This will be very useful to have here also. If you think this is good, I'll send a PR for this.
Guillaume Fraux commented
I think the frame is not indexable because before version 0.9 the functions to get atom/residue/topology were making copies, and so code like set_mass!(frame[0], 3.3)
would only modify a copy, which is very surprising to users.
Now these functions return a reference counted pointer inside the main frame, so everything should work fine, and making a frame indexable sounds good!