Skip to content

Commit 434ea4d

Browse files
committed
Remove use of past.utils
1 parent 36a01cf commit 434ea4d

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tests/testCentroidLong.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from __future__ import print_function
2222
from __future__ import unicode_literals
2323

24-
from past.utils import old_div
2524
import numpy
2625
import PyGuide
2726
from Stats import Stats
@@ -85,17 +84,17 @@
8584
ctrYStats = Stats()
8685
for ampl in AmplValues:
8786
for fwhm in FWHMValues:
88-
sigma = old_div(fwhm, PyGuide.FWHMPerSigma)
87+
sigma = fwhm / PyGuide.FWHMPerSigma
8988
for maskMult in MaskWidthsPerFWHM:
9089
maskWidth = maskMult * fwhm
91-
maskRad = int(old_div(maskWidth, 2.0))
90+
maskRad = int(maskWidth / 2.0)
9291
mask[:,:] = 0
9392
if maskRad > 0:
9493
mask[nomCtr[0] - maskRad: nomCtr[0] + maskRad + 1, :] = 1
9594

9695
numpy.random.seed(1)
9796
for ii in range(NumTries):
98-
actCtr = numpy.random.uniform(old_div(-fwhm,2.0), old_div(fwhm,2.0), size=(2,)) + nomCtr
97+
actCtr = numpy.random.uniform(-fwhm / 2.0, fwhm / 2.0, size=(2,)) + nomCtr
9998

10099
cleanData = PyGuide.FakeData.fakeStar(imShape, actCtr, sigma, ampl)
101100
data = PyGuide.FakeData.addNoise(

tests/testStarShapeLong.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from __future__ import print_function
2626
from __future__ import unicode_literals
2727

28-
from past.utils import old_div
2928
import sys
3029
import traceback
3130
import numpy
@@ -95,17 +94,17 @@ def pctErr(meas, act):
9594
bkgnd = Sky + CCDInfo.bias
9695
for ampl in AmplValues:
9796
for fwhm in FWHMValues:
98-
sigma = old_div(fwhm, PyGuide.FWHMPerSigma)
97+
sigma = fwhm / PyGuide.FWHMPerSigma
9998
for maskMult in MaskWidthsPerFWHM:
10099
maskWidth = maskMult * fwhm
101-
maskRad = int(old_div(maskWidth, 2.0))
100+
maskRad = int(maskWidth / 2.0)
102101
mask[:,:] = 0
103102
if maskRad > 0:
104103
mask[nomCtr[0] - maskRad: nomCtr[0] + maskRad + 1, :] = 1
105104

106105
numpy.random.seed(1)
107106
for ii in range(NumTries):
108-
xyCtr = numpy.random.uniform(old_div(-fwhm,2.0), old_div(fwhm,2.0), size=(2,)) + nomCtr
107+
xyCtr = numpy.random.uniform(-fwhm / 2.0, fwhm /2.0, size=(2,)) + nomCtr
109108

110109
cleanData = PyGuide.FakeData.fakeStar(imShape, xyCtr, sigma, ampl)
111110
data = PyGuide.FakeData.addNoise(

0 commit comments

Comments
 (0)