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
@ojeda-e could you please start putting your thoughts here on how you want the AnalysisBase refactor to go?
In general, AnalysisBase classes will have four methods defined:
__init__ this receives arguments. Usually an AtomGroup or Universe is provided here to operate over, and user-arguments such as n_cell.
_prepare this typically sets up containers for the data to be collected in _single_frame, and maybe performs some pre-emptive computation.
_single_frame this is the bulk of the class: the functionality that you want to operate over every frame of the trajectory. For example, you could be collecting lipid positions.
@ojeda-e could you please start putting your thoughts here on how you want the AnalysisBase refactor to go?
In general, AnalysisBase classes will have four methods defined:
__init__
this receives arguments. Usually an AtomGroup or Universe is provided here to operate over, and user-arguments such asn_cell
._prepare
this typically sets up containers for the data to be collected in_single_frame
, and maybe performs some pre-emptive computation._single_frame
this is the bulk of the class: the functionality that you want to operate over every frame of the trajectory. For example, you could be collecting lipid positions._conclude
this does the final computation with the data collected from_single_frame
. Sometimes it's very short (e.g. https://github.com/MDAnalysis/mdanalysis/blob/64840d5df32ecb73ceadcc022dc4b71738537404/package/MDAnalysis/analysis/rms.py#L864-L870). Sometimes it's where the bulk of the computation is (e.g. https://github.com/MDAnalysis/mdanalysis/blob/64840d5df32ecb73ceadcc022dc4b71738537404/package/MDAnalysis/analysis/pca.py#L315-L322). For example, the calculation of mean and gaussian curvature could go here.run()
but only when they ask for it, you can add post-run methods instead, e.g. https://github.com/MDAnalysis/mdanalysis/blob/64840d5df32ecb73ceadcc022dc4b71738537404/package/MDAnalysis/analysis/pca.py#L431-L476The text was updated successfully, but these errors were encountered: