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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ matrix:

- env: NAME="Lint"
PYLINTRC="${TRAVIS_BUILD_DIR}/package/.pylintrc"
MAIN_CMD="pylint package/MDAnalysis && pylint testsuite/MDAnalysisTests"
MAIN_CMD="pylint --py3k package/MDAnalysis && pylint --py3k testsuite/MDAnalysisTests"
SETUP_CMD=""
BUILD_CMD=""
CONDA_DEPENDENCIES=""
Expand Down
23 changes: 8 additions & 15 deletions package/MDAnalysis/analysis/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,10 @@
.. autofunction:: get_matching_atoms

"""
from __future__ import division, absolute_import

import os.path
import warnings
import logging

from six.moves import range, zip, zip_longest
from six import raise_from, string_types

import numpy as np

import Bio.SeqIO
Expand Down Expand Up @@ -508,20 +503,18 @@ def alignto(mobile, reference, select=None, weights=None,
if subselection is None:
# mobile_atoms is Universe
mobile_atoms = mobile.universe.atoms
elif isinstance(subselection, string_types):
elif isinstance(subselection, str):
# select mobile_atoms from string
mobile_atoms = mobile.select_atoms(subselection)
else:
try:
# treat subselection as AtomGroup
mobile_atoms = subselection.atoms
except AttributeError:
raise_from(
TypeError(
"subselection must be a selection string, an"
" AtomGroup or Universe or None"
),
None)
except AttributeError as exc:
err = ("subselection must be a selection string, an"
" AtomGroup or Universe or None")
raise TypeError(err) from exc


# _fit_to DOES subtract center of mass, will provide proper min_rmsd
mobile_atoms, new_rmsd = _fit_to(mobile_coordinates, ref_coordinates,
Expand Down Expand Up @@ -1348,12 +1341,12 @@ def get_atoms_byres(g, match_mask=np.logical_not(mismatch_mask)):
else:
try:
mass_mismatches = (np.absolute(ag1.masses - ag2.masses) > tol_mass)
except ValueError:
except ValueError as exc:
errmsg = ("Failed to find matching atoms: len(reference) = {}, len(mobile) = {} "
"Try to improve your selections for mobile and reference.").format(
ag1.n_atoms, ag2.n_atoms)
logger.error(errmsg)
raise_from(SelectionError(errmsg), None)
raise SelectionError(errmsg) from exc

if np.any(mass_mismatches):
# Test 2 failed.
Expand Down