Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dpdata/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down