Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | import numpy as np |
||
3 | import pytest |
||
4 | |||
5 | aurmod = pytest.importorskip( |
||
6 | "eppaurora.models", reason="Could not import the `models` submodule." |
||
7 | ) |
||
8 | |||
9 | |||
10 | @pytest.mark.parametrize( |
||
11 | "Kp, hp", [ |
||
12 | (2.0, 23.304548167783693), |
||
13 | (5.0, 69.37903754706306), |
||
14 | (5.01, 69.6037739596099), |
||
15 | (7.0, 146.4364572258345), |
||
16 | ] |
||
17 | ) |
||
18 | def test_hp(Kp, hp): |
||
19 | hpp = aurmod.hemispheric_power(Kp) |
||
20 | np.testing.assert_allclose(hpp, hp) |
||
21 | |||
22 | |||
23 | def test_zp2008(): |
||
24 | q, e = aurmod.zp2008( |
||
25 | 65.0, 23.0, 4.0, |
||
26 | ) |
||
27 | np.testing.assert_allclose(q, 5.061683414221345) |
||
28 | np.testing.assert_allclose(e, 5.914083679736101) |
||
29 |