Is your feature request related to a problem?
Related to #4827: for MDAnalysis to function with live simulation streams, the AnalysisBase must be modified to account for a few quirks of live-streamed trajectories:
- Their length/end frame isn't known (so
len(u.trajectory) and u.trajectory.n_frames will fail)
- They can't be sliced in any way except
u.trajectory[:] and u.trajectory[::n] (where n is positive) so they are inherently incompatible with parallelization schemes
Describe the solution you'd like
Like with parallelization, analysis classes that inherit from AnalysisBase should "opt-in" to stream usage through a class property similar to the parallelizable property (like streamable or similar). To opt-in, inherited classes must also avoid attempting to access the trajectory's length or slice it. The rms.RMSF class is already such a class.
The AnalysisBase must also have a _streamed_run method that never attempts to slice a trajectory or access its length. The imdclient MDAKit ships such a method already (and monkey patches it in): https://github.com/Becksteinlab/imdclient/blob/main/imdclient/streamanalysis.py
Describe alternatives you've considered
Don't allow live simulation streaming, or don't allow builtin analysis classes to be used with these streams
Is your feature request related to a problem?
Related to #4827: for MDAnalysis to function with live simulation streams, the
AnalysisBasemust be modified to account for a few quirks of live-streamed trajectories:len(u.trajectory)andu.trajectory.n_frameswill fail)u.trajectory[:]andu.trajectory[::n](where n is positive) so they are inherently incompatible with parallelization schemesDescribe the solution you'd like
Like with parallelization, analysis classes that inherit from
AnalysisBaseshould "opt-in" to stream usage through a class property similar to theparallelizableproperty (likestreamableor similar). To opt-in, inherited classes must also avoid attempting to access the trajectory's length or slice it. Therms.RMSFclass is already such a class.The
AnalysisBasemust also have a_streamed_runmethod that never attempts to slice a trajectory or access its length. The imdclient MDAKit ships such a method already (and monkey patches it in): https://github.com/Becksteinlab/imdclient/blob/main/imdclient/streamanalysis.pyDescribe alternatives you've considered
Don't allow live simulation streaming, or don't allow builtin analysis classes to be used with these streams