Skip to content

Commit

Permalink
restore backwards compatible molecule attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
corinwagen committed Jun 25, 2021
1 parent dba720f commit 251f52e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cctk/xyz_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ class XYZFile(cctk.File):
Attributes:
titles (list of str): the title or titles from the file
ensemble (Ensemble): `Ensemble` instance
molecule (Molecule): `Molecule` instance representing the first molecule in the file. deprecated, but present for backwards compatibility.
"""

def __init__(self, ensemble, titles):
assert isinstance(ensemble, cctk.Ensemble), "ensemble must be cctk.Ensemble"
self.ensemble = ensemble

# backwards compatibility
self.molecule = ensemble[0]

assert isinstance(titles, list), "title must be list"
self.titles = titles

Expand Down

0 comments on commit 251f52e

Please sign in to comment.