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 noticed that when slicing a Sequence, a we first create a deepcopy of the original object, which we then whittle down to the size indicated. This seems inefficient, especially if the original Sequence is much larger than the slice we want.
Instead we could create a new "empty" Sequence, into which we then copy (or deepcopy?) the relevant slices from the old Sequence.
I'm wondering what the best approach is. I defaulted to deepcopy to make sure the Framesets, Events, etc. were copied, instead of referencing to the same Framesets, Events, etc. as the original. Maybe we can create an implementation of Sequence.__copy__() (see bottom paragraph of https://docs.python.org/3.11/library/copy.html#copy.deepcopy) to create a copy of Sequence that (deep)copies all Events, Phases, etc., but creates new Framesets using sliced data instead of copying the entire Frameset including data.
I noticed that when slicing a
Sequence
, a we first create a deepcopy of the original object, which we then whittle down to the size indicated. This seems inefficient, especially if the originalSequence
is much larger than the slice we want.Instead we could create a new "empty"
Sequence
, into which we then copy (or deepcopy?) the relevant slices from the oldSequence
.Does this make sense @psomhorst ?
The text was updated successfully, but these errors were encountered: