diff --git a/MDANSE/Src/MDANSE/Framework/InputData/MockTrajectoryInputData.py b/MDANSE/Src/MDANSE/Framework/InputData/MockTrajectoryInputData.py index edf77daae..d83a6fbb5 100644 --- a/MDANSE/Src/MDANSE/Framework/InputData/MockTrajectoryInputData.py +++ b/MDANSE/Src/MDANSE/Framework/InputData/MockTrajectoryInputData.py @@ -22,6 +22,7 @@ class MockTrajectoryInputData(InputFileData): """Imitates the HDFTrajectoryInputData, but builds a MockTrajectory out of a JSON file instead. """ + extension = "json" def load(self): diff --git a/MDANSE/Src/MDANSE/MolecularDynamics/MockTrajectory.py b/MDANSE/Src/MDANSE/MolecularDynamics/MockTrajectory.py index d5631d05c..c10c2fb81 100644 --- a/MDANSE/Src/MDANSE/MolecularDynamics/MockTrajectory.py +++ b/MDANSE/Src/MDANSE/MolecularDynamics/MockTrajectory.py @@ -42,11 +42,12 @@ class MockTrajectory: """For testing purposes, MockTrajectory can replace a trajectory. -It acts as a trajectory of predefined composition and size, -while taking only a necessary minimum of resources. -The main goal is performance testing of different analysis types -without the need to run Molecular Dynamics simulations beforehand. + It acts as a trajectory of predefined composition and size, + while taking only a necessary minimum of resources. + The main goal is performance testing of different analysis types + without the need to run Molecular Dynamics simulations beforehand. """ + def __init__( self, number_of_frames: int = 1000, @@ -99,7 +100,7 @@ def set_coordinates(self, coords: np.ndarray): ------- bool False if the number of elements was wrong - """ + """ if len(coords) != self._num_atoms_in_box: return False coords_nm = coords * measure(1.0, "ang").toval("nm") @@ -206,7 +207,7 @@ def __getitem__(self, frame: int): ------- dict coordinates, time and unit cell at the specified frame - + Raises ------ IndexError @@ -223,13 +224,11 @@ def __getitem__(self, frame: int): return configuration def __getstate__(self): - """Only added for compatibility with Trajectory - """ + """Only added for compatibility with Trajectory""" pass def __setstate__(self, state): - """Only added for compatibility with Trajectory - """ + """Only added for compatibility with Trajectory""" pass def coordinates(self, frame: int) -> np.ndarray: @@ -261,7 +260,7 @@ def coordinates(self, frame: int) -> np.ndarray: return self._coordinates[scaled_index].astype(np.float64) - def configuration(self, frame: int) -> '_Configuration': + def configuration(self, frame: int) -> "_Configuration": """An MDANSE Configuration at the specified frame number. Parameters