@@ -73,6 +73,7 @@ def testSetObservedProfile(self):
73
73
74
74
return
75
75
76
+
76
77
def testSetCalculationRange (self ):
77
78
"""Test the setCalculationRange method."""
78
79
x = arange (2 , 10 , 0.5 )
@@ -101,48 +102,45 @@ def testSetCalculationRange(self):
101
102
prof .setCalculationRange (xmin = 0 )
102
103
self .assertTrue ( array_equal (x , prof .x ) )
103
104
self .assertTrue ( array_equal (y , prof .y ) )
104
- self .assertTrue ( array_equal (dy , dprof . y ) )
105
+ self .assertTrue ( array_equal (dy , prof . dy ) )
105
106
106
107
# Test an upper bound > xmax
107
108
prof .setCalculationRange (xmax = 100 )
108
- prof .x , prof .y , dprof .y = prof .getRangedProfile ()
109
109
self .assertTrue ( array_equal (x , prof .x ) )
110
110
self .assertTrue ( array_equal (y , prof .y ) )
111
- self .assertTrue ( array_equal (dy , dprof . y ) )
111
+ self .assertTrue ( array_equal (dy , prof . dy ) )
112
112
113
113
# Test xmin > xmax
114
- self .assertRaises (ValueError , profile .setCalculationRange , xmin = 10 ,
114
+ self .assertRaises (ValueError , prof .setCalculationRange , xmin = 10 ,
115
115
xmax = 3 )
116
116
117
117
# Test xmax - xmin < dx
118
- self .assertRaises (ValueError , profile .setCalculationRange , xmin = 3 ,
118
+ self .assertRaises (ValueError , prof .setCalculationRange , xmin = 3 ,
119
119
xmax = 3 + 0.4 , dx = 0.5 )
120
120
121
121
# Test dx <= 0
122
- self .assertRaises (ValueError , profile .setCalculationRange , dx = 0 )
123
- self .assertRaises (ValueError , profile .setCalculationRange , dx =
122
+ self .assertRaises (ValueError , prof .setCalculationRange , dx = 0 )
123
+ self .assertRaises (ValueError , prof .setCalculationRange , dx =
124
124
- 0.000001 )
125
125
# This should be alright
126
- profile .setCalculationRange (dx = 0.000001 )
126
+ prof .setCalculationRange (dx = 0.000001 )
127
127
128
128
# Test an internal bound
129
129
prof .setCalculationRange (4 , 7 )
130
- prof .x , prof .y , dprof .y = prof .getRangedProfile ()
131
130
self .assertTrue ( array_equal (prof .x , arange (4 , 7.5 , 0.5 ) ) )
132
131
self .assertTrue ( array_equal (prof .y , arange (4 , 7.5 , 0.5 ) ) )
133
- self .assertTrue ( array_equal (dprof .y , arange (4 , 7.5 , 0.5 ) ) )
132
+ self .assertTrue ( array_equal (prof .y , arange (4 , 7.5 , 0.5 ) ) )
134
133
135
134
# Test a new grid
136
135
prof .setCalculationRange (4 , 7 , 0.1 )
137
- prof .x , prof .y , dprof .y = prof .getRangedProfile ()
138
136
self .assertTrue ( array_equal (prof .x , arange (4 , 7.1 , 0.1 ) ) )
139
- self .assertAlmostEqual ( 0 , sum (prof .y - arange (4 , 7.1 , 0.1 ))** 2 )
140
- self .assertAlmostEqual ( 0 , sum (dprof .y - arange (4 , 7.1 , 0.1 ))** 2 )
141
-
137
+ self .assertAlmostEqual ( 0 , sum (prof .y - arange (4 , 7.1 , 0.1 ))** 2 )
138
+ self .assertAlmostEqual ( 0 , sum (prof .y - arange (4 , 7.1 , 0.1 ))** 2 )
142
139
return
143
140
144
- def testSetCalculationRange (self ):
145
- """Test the setCalculationRange method."""
141
+
142
+ def testSetCalculationPoints (self ):
143
+ """Test the setCalculationPoints method."""
146
144
prof = self .profile
147
145
148
146
x = arange (2 , 10.5 , 0.5 )
0 commit comments