You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, while the first works fine and returns False the second raises a NoDataError.
/usr/local/lib/python3.7/site-packages/MDAnalysis/core/groups.pyin__getattr__(self, attr)
2222# raise NDE(_ATTR_ERRORS[attr])2223raiseNoDataError("AtomGroup.{} not available; this requires Bonds"->2224"".format(attr))
2225raiseAttributeError("{cls} has no attribute {attr}".format(
2226cls=self.__class__.__name__, attr=attr))
NoDataError: AtomGroup.fragmentsnotavailable; thisrequiresBonds
Current version of MDAnalysis
Which version are you using? 0.20.2-dev0
Which version of Python: 3.7
Which operating system? macOS
The text was updated successfully, but these errors were encountered:
Interesting. I guess you could define __hasattr__ but... would making NoDataError a subclass of AttributeError fix this?
Edit: yes, but then it breaks a bunch of properties. Also __hasattr__ doesn't exist and hasattr just calls __getattr__ and checks for an AttributeError (from Python 3+) so there's no getting around this without raising an AttributeError...
Expected behavior
Checking for the
fragment
attributeshould give the following consistent output
Actual behavior
However, while the first works fine and returns
False
the second raises aNoDataError
.Current version of MDAnalysis
The text was updated successfully, but these errors were encountered: