Skip to content

Commit

Permalink
Added exception and unittest for dist_mat_to_vec of analysis/psa.py (…
Browse files Browse the repository at this point in the history
…Part of MDAnalysis#597)
  • Loading branch information
vedantrathore committed Feb 3, 2017
1 parent ece534a commit 36acf58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/MDAnalysis/analysis/psa.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
from six.moves import range, cPickle

import numpy as np
import warnings
import warnings,numbers

import MDAnalysis
import MDAnalysis.analysis.align
Expand Down Expand Up @@ -575,7 +575,7 @@ def dist_mat_to_vec(N, i, j):
int, index (of the matrix element) in the corresponding distance vector
"""

if not (isinstance(N, int) or isinstance(i, int) or isinstance(j, int)):
if not (isinstance(N, numbers.Integral) or isinstance(i, numbers.Integral) or isinstance(j, numbers.Integral)):
raise ValueError("N, i, j all must be of type int")

if i < 0 or j < 0 or N < 2:
Expand Down

0 comments on commit 36acf58

Please sign in to comment.