DynamicAnalysisBase¶
- class mdhelper.analysis.base.DynamicAnalysisBase(trajectory: ReaderBase, parallel: bool, verbose: bool = False, **kwargs)[source]¶
Bases:
ParallelAnalysisBase
,SerialAnalysisBase
A dynamic analysis base object.
- Parameters:
- trajectoryMDAnalysis.coordinates.base.ReaderBase
Simulation trajectory.
- parallelbool
Determines whether the analysis is performed in parallel.
- verbosebool, default:
True
Determines whether detailed progress is shown.
- **kwargs
Additional keyword arguments to pass to
MDAnalysis.analysis.base.AnalysisBase
.
Methods
- run(start: int = None, stop: int = None, step: int = None, frames: slice | ndarray[int] = None, verbose: bool = None, **kwargs) SerialAnalysisBase | ParallelAnalysisBase [source]¶
Performs the calculation.
See also
For parallel-specific keyword arguments, see
ParallelAnalysisBase.run()
.- Parameters:
- startint, optional
Starting frame for analysis.
- stopint, optional
Ending frame for analysis.
- stepint, optional
Number of frames to skip between each analyzed frame.
- framesslice or array-like, optional
Index or logical array of the desired trajectory frames.
- verbosebool, optional
Determines whether detailed progress is shown.
- **kwargs
Additional keyword arguments to pass to
MDAnalysis.lib.log.ProgressBar
.
- Returns:
- selfSerialAnalysisBase or ParallelAnalysisBase
Analysis object with results.
- save(file: str | TextIO, archive: bool = True, compress: bool = True, **kwargs) None ¶
Saves results to a binary or archive file in NumPy format.
- Parameters:
- filestr or file
Filename or file-like object where the data will be saved. If file is a str, the
.npy
or.npz
extension will be appended automatically if not already present.- archivebool, default:
True
Determines whether the results are saved to a single archive file. If True, the data is stored in a
.npz
file. Otherwise, the data is saved to multiple.npy
files.- compressbool, default:
True
Determines whether the
.npz
file is compressed. Has no effect whenarchive=False
.- **kwargs
Additional keyword arguments to pass to
numpy.save()
,numpy.savez()
, ornumpy.savez_compressed()
, depending on the values of archive and compress.