Passed
Push — master ( 6b2218...55e87d )
by Stefan
04:02
created

test_models_zp2008.test_zp2008()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 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