Skip to content

Commit

Permalink
Merge pull request #442 from pyiron/animate-error
Browse files Browse the repository at this point in the history
Add clear error when calling animate_structure on empty job
  • Loading branch information
pmrv authored Nov 26, 2021
2 parents 52eaf2c + 18606cf commit 42d2b8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyiron_atomistics/atomistics/job/atomistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ def animate_structure(
"The animate() function requires the package nglview to be installed"
)

if self.number_of_structures <= 1:
raise ValueError("job must have more than one structure to animate!")

animation = nglview.show_asetraj(
self.trajectory(stride=stride, center_of_mass=center_of_mass)
)
Expand Down

0 comments on commit 42d2b8a

Please sign in to comment.