Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit cell updating for each frame in 3D Viewer #371

Merged
merged 1 commit into from
Mar 19, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import numpy as np

from MDANSE.MolecularDynamics.UnitCell import UnitCell

from MDANSE_GUI.MolecularViewer.readers.i_reader import IReader


Expand All @@ -36,9 +38,9 @@ def read_frame(self, frame: int) -> "np.array":
coords = self._trajectory[frame]["coordinates"]
return np.array(coords)

def read_pbc(self, frame: int) -> "np.array":
def read_pbc(self, frame: int) -> UnitCell:
try:
unit_cell = self._chemical_system.configuration.unit_cell
unit_cell = self._trajectory.unit_cell(frame)
except AttributeError:
unit_cell = None
return unit_cell
Loading