|
79 | 79 | Phi = 194.340241
|
80 | 80 | year = 1985
|
81 | 81 | month = 2
|
82 |
| -year_array = np.array([-499, 500, 1000, 1500, 1800, 1900, 1950, 1970, 1985, 1990, 2000, 2005]) |
83 |
| -month_array = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) |
| 82 | +year_array = np.array([-499, 500, 1000, 1500, 1800, 1860, 1900, 1950, |
| 83 | + 1970, 1985, 1990, 2000, 2005, 2050, 2150]) |
| 84 | +# `month_array` is used with `year_array` in `test_calculate_deltat`. |
| 85 | +# Both arrays need to have the same length for the test, hence the duplicates. |
| 86 | +month_array = np.array([1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 12, 12]) |
84 | 87 | dt_actual = 54.413442486
|
85 | 88 | dt_actual_array = np.array([1.7184831e+04, 5.7088051e+03, 1.5730419e+03,
|
86 |
| - 1.9801820e+02, 1.3596506e+01, -2.1171894e+00, |
87 |
| - 2.9289261e+01, 4.0824887e+01, 5.4724581e+01, |
88 |
| - 5.7426651e+01, 6.4108015e+01, 6.5038015e+01]) |
| 89 | + 1.9801820e+02, 1.3596506e+01, 7.8316585e+00, |
| 90 | + -2.1171894e+00, 2.9289261e+01, 4.0824887e+01, |
| 91 | + 5.4724581e+01, 5.7426651e+01, 6.4108015e+01, |
| 92 | + 6.5038015e+01, 9.4952955e+01, 3.3050693e+02]) |
89 | 93 | mix_year_array = np.full((10), year)
|
90 | 94 | mix_month_array = np.full((10), month)
|
91 | 95 | mix_year_actual = np.full((10), dt_actual)
|
@@ -352,7 +356,7 @@ def test_calculate_deltat(self):
|
352 | 356 | result_array = self.spa.calculate_deltat(year_array, month_array)
|
353 | 357 | assert_almost_equal(dt_actual_array, result_array, 3)
|
354 | 358 |
|
355 |
| - result_scalar = self.spa.calculate_deltat(year,month) |
| 359 | + result_scalar = self.spa.calculate_deltat(year, month) |
356 | 360 | assert_almost_equal(dt_actual, result_scalar)
|
357 | 361 |
|
358 | 362 | class NumpySpaTest(unittest.TestCase, SpaBase):
|
@@ -417,4 +421,3 @@ def test_solar_position_multithreaded(self):
|
417 | 421 | , self.spa.solar_position(
|
418 | 422 | times, lat, lon, elev, pressure, temp, delta_t,
|
419 | 423 | atmos_refract, numthreads=8, sst=True)[:3], 5)
|
420 |
| - |
|
0 commit comments