Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishy7777 committed Jan 20, 2025
1 parent c45bef4 commit 3f24903
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Enhancements
* Enable parallelization for analysis.nucleicacids.NucPairDist (Issue #4670)
* Add check and warning for empty (all zero) coordinates in RDKit converter (PR #4824)
* Added `precision` for XYZWriter (Issue #4775, PR #4771)
* Parallelize `analysis.rdf.EinsteinMSD` (Issue #4676, PR #)
* Parallelize `analysis.rdf.EinsteinMSD` (Issue #4676, PR #4896)


Changes
Expand Down
21 changes: 14 additions & 7 deletions package/MDAnalysis/analysis/msd.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,14 @@ class EinsteinMSD(AnalysisBase):

@classmethod
def get_supported_backends(cls):
return ('serial', 'multiprocessing', 'dask',)
return (
"serial",
"multiprocessing",
"dask",
)

_analysis_algorithm_is_parallelizable = True


def __init__(self, u, select="all", msd_type="xyz", fft=True, **kwargs):
r"""
Parameters
Expand Down Expand Up @@ -405,12 +408,16 @@ def _single_frame(self):
@staticmethod
def f(arrs):
pass

def _get_aggregator(self):
return ResultsGroup(lookup={'_position_array': ResultsGroup.ndarray_vstack,
'msds_by_particle': self.f,
'timeseries': self.f})

return ResultsGroup(
lookup={
"_position_array": ResultsGroup.ndarray_vstack,
"msds_by_particle": self.f,
"timeseries": self.f,
}
)

def _conclude(self):
self.results.msds_by_particle = np.zeros(
(self.n_frames, self.n_particles)
Expand Down

0 comments on commit 3f24903

Please sign in to comment.