diff --git a/dpdata/system.py b/dpdata/system.py index 5451e22ae..6089db46d 100644 --- a/dpdata/system.py +++ b/dpdata/system.py @@ -810,6 +810,11 @@ def perturb(self, perturbed_system : System The perturbed_system. It contains `pert_num` * frame_num of the input system frames. """ + if type(self) is not dpdata.System: + raise RuntimeError( + f'Using method perturb() of an instance of {type(self)}. ' + f'Must use method perturb() of the instance of class dpdata.System.' + ) perturbed_system = System() nframes = self.get_nframes() for ii in range(nframes):