Skip to content

Commit

Permalink
Remove ParmEd Timestep writing "support" (MDAnalysis#3240)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyminium committed Apr 28, 2021
1 parent e089787 commit e1c07a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 1 addition & 4 deletions package/MDAnalysis/coordinates/ParmEd.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,7 @@ def convert(self, obj):
# make sure to use atoms (Issue 46)
ag_or_ts = obj.atoms
except AttributeError:
if isinstance(obj, base.Timestep):
ag_or_ts = obj.copy()
else:
raise_from(TypeError("No Timestep found in obj argument"), None)
raise TypeError("No atoms found in obj argument") from None

# Check for topology information
missing_topology = []
Expand Down
6 changes: 6 additions & 0 deletions testsuite/MDAnalysisTests/coordinates/test_parmed.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

from MDAnalysisTests.coordinates.base import _SingleFrameReader
from MDAnalysisTests.coordinates.reference import RefAdKSmall
from MDAnalysis.coordinates.ParmEd import ParmEdConverter

from MDAnalysisTests.datafiles import (
GRO,
Expand Down Expand Up @@ -286,3 +287,8 @@ class TestParmEdConverterPDB(BaseTestParmEdConverter):
def test_equivalent_coordinates(self, ref, output):
assert_almost_equal(ref.coordinates, output.coordinates, decimal=3)

def test_incorrect_object_passed_typeerror():
err = "No atoms found in obj argument"
with pytest.raises(TypeError, match=err):
c = ParmEdConverter()
c.convert("we still don't support emojis :(")

0 comments on commit e1c07a6

Please sign in to comment.