44import numpy as np
55
66from ..nddata import NDData
7- from ..nduncertainty import StandardDeviationUncertainty , IncompatibleUncertaintiesException , NDUncertainty
7+ from ..nduncertainty import StdDevUncertainty , IncompatibleUncertaintiesException , NDUncertainty
88from ...tests .helper import raises
99from ...io import fits
1010
@@ -49,19 +49,19 @@ def test_nddata_mask_invalid_shape(shape):
4949
5050
5151def test_nddata_uncertainty_init ():
52- u = StandardDeviationUncertainty (array = np .ones ((5 , 5 )))
52+ u = StdDevUncertainty (array = np .ones ((5 , 5 )))
5353 d = NDData (np .ones ((5 , 5 )), uncertainty = u )
5454
5555
5656def test_nddata_uncertainty_init_invalid_shape_1 ():
57- u = StandardDeviationUncertainty (array = np .ones ((6 , 6 )))
57+ u = StdDevUncertainty (array = np .ones ((6 , 6 )))
5858 with pytest .raises (ValueError ) as exc :
5959 NDData (np .ones ((5 , 5 )), uncertainty = u )
6060 assert exc .value .args [0 ] == 'parent shape does not match array data shape'
6161
6262
6363def test_nddata_uncertainty_init_invalid_shape_2 ():
64- u = StandardDeviationUncertainty ()
64+ u = StdDevUncertainty ()
6565 NDData (np .ones ((5 , 5 )), uncertainty = u )
6666 with pytest .raises (ValueError ) as exc :
6767 u .array = np .ones ((6 , 6 ))
@@ -122,8 +122,8 @@ def test_nddata_add_mismatch_shape():
122122
123123
124124def test_nddata_add_uncertainties ():
125- u1 = StandardDeviationUncertainty (array = np .ones ((5 , 5 )) * 3 )
126- u2 = StandardDeviationUncertainty (array = np .ones ((5 , 5 )))
125+ u1 = StdDevUncertainty (array = np .ones ((5 , 5 )) * 3 )
126+ u2 = StdDevUncertainty (array = np .ones ((5 , 5 )))
127127 d1 = NDData (np .ones ((5 , 5 )), uncertainty = u1 )
128128 d2 = NDData (np .ones ((5 , 5 )), uncertainty = u2 )
129129 d3 = d1 .add (d2 )
@@ -132,14 +132,14 @@ def test_nddata_add_uncertainties():
132132
133133
134134def test_nddata_add_uncertainties_mismatch ():
135- u1 = StandardDeviationUncertainty (array = np .ones ((5 , 5 )) * 3 )
135+ u1 = StdDevUncertainty (array = np .ones ((5 , 5 )) * 3 )
136136 u2 = FakeUncertainty ()
137137 print u2 .__class__
138138 d1 = NDData (np .ones ((5 , 5 )), uncertainty = u1 )
139139 d2 = NDData (np .ones ((5 , 5 )), uncertainty = u2 )
140140 with pytest .raises (IncompatibleUncertaintiesException ) as exc :
141141 d3 = d1 .add (d2 )
142- assert exc .value .args [0 ] == 'Cannot propagate uncertainties of type StandardDeviationUncertainty with uncertainties of type FakeUncertainty for addition'
142+ assert exc .value .args [0 ] == 'Cannot propagate uncertainties of type StdDevUncertainty with uncertainties of type FakeUncertainty for addition'
143143
144144
145145def test_nddata_subtract ():
@@ -174,8 +174,8 @@ def test_nddata_subtract_mismatch_shape():
174174
175175
176176def test_nddata_subtract_uncertainties ():
177- u1 = StandardDeviationUncertainty (array = np .ones ((5 , 5 )) * 3 )
178- u2 = StandardDeviationUncertainty (array = np .ones ((5 , 5 )))
177+ u1 = StdDevUncertainty (array = np .ones ((5 , 5 )) * 3 )
178+ u2 = StdDevUncertainty (array = np .ones ((5 , 5 )))
179179 d1 = NDData (np .ones ((5 , 5 )), uncertainty = u1 )
180180 d2 = NDData (np .ones ((5 , 5 )) * 2. , uncertainty = u2 )
181181 d3 = d1 .subtract (d2 )
@@ -184,14 +184,14 @@ def test_nddata_subtract_uncertainties():
184184
185185
186186def test_nddata_subtract_uncertainties_mismatch ():
187- u1 = StandardDeviationUncertainty (array = np .ones ((5 , 5 )) * 3 )
187+ u1 = StdDevUncertainty (array = np .ones ((5 , 5 )) * 3 )
188188 u2 = FakeUncertainty ()
189189 print u2 .__class__
190190 d1 = NDData (np .ones ((5 , 5 )), uncertainty = u1 )
191191 d2 = NDData (np .ones ((5 , 5 )) * 2. , uncertainty = u2 )
192192 with pytest .raises (IncompatibleUncertaintiesException ) as exc :
193193 d3 = d1 .subtract (d2 )
194- assert exc .value .args [0 ] == 'Cannot propagate uncertainties of type StandardDeviationUncertainty with uncertainties of type FakeUncertainty for subtraction'
194+ assert exc .value .args [0 ] == 'Cannot propagate uncertainties of type StdDevUncertainty with uncertainties of type FakeUncertainty for subtraction'
195195
196196
197197def test_convert_units_to ():
@@ -206,14 +206,14 @@ def test_invalid_unit():
206206 d = NDData (np .ones ((5 , 5 )), units = "NotAValidUnit" )
207207
208208def test_simple_slicing ():
209- u1 = StandardDeviationUncertainty (array = np .ones ((5 , 5 )) * 3 )
209+ u1 = StdDevUncertainty (array = np .ones ((5 , 5 )) * 3 )
210210 d1 = NDData (np .ones ((5 , 5 )), uncertainty = u1 )
211211 assert d1 .shape == (5 ,5 )
212212 d2 = d1 [2 :3 , 2 :3 ]
213213 assert d2 .shape == (1 ,1 )
214214
215215def test_slicing_reference ():
216- u1 = StandardDeviationUncertainty (array = np .ones ((5 , 5 )) * 3 )
216+ u1 = StdDevUncertainty (array = np .ones ((5 , 5 )) * 3 )
217217 d1 = NDData (np .ones ((5 , 5 )), uncertainty = u1 )
218218 d2 = d1 [2 :3 , 2 :3 ]
219219 #asserting that the new nddata contains references to the original nddata
@@ -229,8 +229,8 @@ def test_initializing_from_nddata():
229229
230230
231231def test_initializing_from_nduncertainty ():
232- u1 = StandardDeviationUncertainty (np .ones ((5 , 5 )) * 3 )
233- u2 = StandardDeviationUncertainty (u1 , copy = False )
232+ u1 = StdDevUncertainty (np .ones ((5 , 5 )) * 3 )
233+ u2 = StdDevUncertainty (u1 , copy = False )
234234
235235 assert u1 .array is u2 .array
236236
0 commit comments