-
Notifications
You must be signed in to change notification settings - Fork 769
Description
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)andu.trajectory.n_frameswill fail) - They can't be sliced in any way except
u.trajectory[:]andu.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