Skip to content
Merged
Show file tree
Hide file tree
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
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 :(")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not? I thought py3+ was UTF-8 compliant?