Skip to content

Commit

Permalink
Fix TrajectoryViewer display
Browse files Browse the repository at this point in the history
TrajectoryData does not track PBC, and so when we
extract StructureData from it, it will have the default
pbc=(True, True,True). Solution is simple, overwrite this.
See:
aiidateam/aiida-core#6376
  • Loading branch information
danielhollas committed Apr 29, 2024
1 parent 821514f commit c74b0c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aiidalab_ispg/app/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ def _update_trajectory(self, change):
self._structures = [
trajectory.get_step_structure(i) for i in self.trajectory.get_stepids()
]
# NOTE: Unfortunately, when converting TrajectoryData to StructureData,
# PBC is always set to (True, True, True) so we need to correct.
for structure in self._structures:
structure.pbc = (False, False, False)

if "energies" in trajectory.get_arraynames():
self._energies = trajectory.get_array("energies")
Expand Down

0 comments on commit c74b0c9

Please sign in to comment.