44from pyfeltor import dg
55import pytest_datadir
66
7- geo_loaded = True
8- try :
9- from pyfeltor .dg import geo
10- except ImportError :
11- geo_loaded = False
12-
13-
14- # Run with pytest-3 -s . to see stdout output
15- def geo_exists ():
16- if not geo_loaded :
17- print ( "dg.geo not compiled" )
18- return False
19- return True
20-
217
228def test_polynomial ():
23- if not geo_exists (): return
249 c = np .array ( [1 ,2 ,3 ,4 ])
2510 params = {"R_0" : 400 , "inverseaspectratio" : 20 , "elongation" : 1 , "triangularity" : 1 ,
2611 "PP" : 1 , "PI" : 1 , "description" : "standardX" , "M" : 2 , "N" : 2 , "c" : c .tolist ()}
@@ -36,7 +21,6 @@ def test_polynomial():
3621
3722
3823def test_make_field (datadir ):
39- if not geo_exists (): return
4024 with open (datadir / "geometry_params_Xpoint.json" , "r" ) as f :
4125 magparams = json .load (f )
4226 mag = dg .geo .createMagneticField ( magparams )
@@ -55,7 +39,6 @@ def test_make_field(datadir):
5539
5640
5741def test_q_profile (datadir ):
58- if not geo_exists (): return
5942 with open (datadir / "enrx_tcv.json" , "r" ) as f :
6043 magparams = json .load (f )
6144 mag = dg .geo .createMagneticField (magparams )
@@ -68,7 +51,6 @@ def test_q_profile(datadir):
6851 print (qfunctor (psi_values ))
6952
7053def test_sheath (datadir ):
71- if not geo_exists (): return
7254 with open (datadir / "enrx_tcv.json" , "r" ) as f :
7355 magparams = json .load (f )
7456 mag = dg .geo .createMagneticField (magparams )
0 commit comments