Skip to content

Commit

Permalink
Merge pull request #228 from lpsinger/six_xrange
Browse files Browse the repository at this point in the history
Replace xrange with six.moves.xrange to support Python 3
  • Loading branch information
zonca committed Mar 12, 2015
2 parents 6c2bf0d + a551aa8 commit ebb8abe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion healpy/fitsfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
except ImportError:
import pyfits as pf
import numpy as np
import six
from . import pixelfunc
from .sphtfunc import Alm
import warnings
Expand Down Expand Up @@ -422,7 +423,7 @@ def mwrfits(filename,data,hdu=1,colnames=None,keys=None):
else:
colnames = ['']*len(data)
cols=[]
for line in xrange(len(data)):
for line in six.moves.xrange(len(data)):
cols.append(pf.Column(name=colnames[line],
format=getformat(data[line]),
array=data[line]))
Expand Down
3 changes: 2 additions & 1 deletion healpy/projaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import matplotlib
from matplotlib import axes,ticker,colors,cm,lines,cbook,figure
import numpy as np
import six
from ._healpy_pixel_lib import UNSEEN

pi = np.pi
Expand Down Expand Up @@ -394,7 +395,7 @@ def _make_segment(self,x,y,threshold=None):
elif len(w) >= 2:
xx.append(x[0:w[0]])
yy.append(y[0:w[0]])
for i in xrange(len(w)-1):
for i in six.moves.xrange(len(w)-1):
xx.append(x[w[i]:w[i+1]])
yy.append(y[w[i]:w[i+1]])
xx.append(x[w[-1]:])
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ numpy
cython>=0.16
matplotlib
astropy
six

0 comments on commit ebb8abe

Please sign in to comment.