diff --git a/tests/geo/test_surface_rzfourier.py b/tests/geo/test_surface_rzfourier.py index fce6fec00..529374538 100755 --- a/tests/geo/test_surface_rzfourier.py +++ b/tests/geo/test_surface_rzfourier.py @@ -234,11 +234,13 @@ def test_from_vmec_2_ways(self): filename2 = TEST_DIR / 'wout_li383_low_res_reference.nc' s1 = SurfaceRZFourier.from_vmec_input(filename1) s2 = SurfaceRZFourier.from_wout(filename2) - mpol = min(s1.mpol, s2.mpol) - ntor = min(s1.ntor, s2.ntor) - places = 13 + self.assertEqual(s1.mpol, s2.mpol) + self.assertEqual(s1.ntor, s2.ntor) self.assertEqual(s1.nfp, s2.nfp) self.assertEqual(s1.stellsym, s2.stellsym) + mpol = s1.mpol + ntor = s1.ntor + places = 13 for m in range(mpol + 1): nmin = 0 if m == 0 else -ntor for n in range(nmin, ntor + 1): @@ -266,8 +268,10 @@ def test_from_vmec_2_ways(self): # coordinate-independent properties like the volume and area. self.assertAlmostEqual(np.abs(s1.volume()), np.abs(s2.volume()), places=13) self.assertAlmostEqual(s1.area(), s2.area(), places=7) - mpol = min(s1.mpol, s2.mpol) - ntor = min(s1.ntor, s2.ntor) + self.assertEqual(s1.mpol, s2.mpol) + self.assertEqual(s1.ntor, s2.ntor) + mpol = s1.mpol + ntor = s1.ntor places = 13 for m in range(mpol + 1): nmin = 0 if m == 0 else -ntor @@ -290,11 +294,13 @@ def test_get_and_write_nml(self): with ScratchDir("."): s1.write_nml(new_filename) s2 = SurfaceRZFourier.from_vmec_input(new_filename) - mpol = min(s1.mpol, s2.mpol) - ntor = min(s1.ntor, s2.ntor) - places = 13 self.assertEqual(s1.nfp, s2.nfp) self.assertEqual(s1.stellsym, s2.stellsym) + self.assertEqual(s1.mpol, s2.mpol) + self.assertEqual(s1.ntor, s2.ntor) + mpol = s1.mpol + ntor = s1.ntor + places = 13 for m in range(mpol + 1): nmin = 0 if m == 0 else -ntor for n in range(nmin, ntor + 1): @@ -310,11 +316,13 @@ def test_get_and_write_nml(self): with open(new_filename, 'w') as f: f.write(nml_str) s2 = SurfaceRZFourier.from_vmec_input(new_filename) - mpol = min(s1.mpol, s2.mpol) - ntor = min(s1.ntor, s2.ntor) - places = 13 self.assertEqual(s1.nfp, s2.nfp) self.assertEqual(s1.stellsym, s2.stellsym) + self.assertEqual(s1.mpol, s2.mpol) + self.assertEqual(s1.ntor, s2.ntor) + mpol = s1.mpol + ntor = s1.ntor + places = 13 for m in range(mpol + 1): nmin = 0 if m == 0 else -ntor for n in range(nmin, ntor + 1): @@ -743,10 +751,10 @@ def test_fourier_transform_scalar(self): # Create the grid of quadpoints: phi2d, theta2d = np.meshgrid(2 * np.pi * s.quadpoints_phi, - 2 * np.pi * s.quadpoints_theta, + 2 * np.pi * s.quadpoints_theta, indexing='ij') - # create a test field where only Fourier elements [m=2, n=3] + # create a test field where only Fourier elements [m=2, n=3] # and [m=4,n=5] are nonzero: field = 0.8 * np.sin(2*theta2d - 3*s.nfp*phi2d) + 0.2*np.sin(4*theta2d - 5*s.nfp*phi2d)+ 0.7*np.cos(3*theta2d - 3*s.nfp*phi2d) diff --git a/tests/mhd/test_vmec.py b/tests/mhd/test_vmec.py index 5335ddcc6..70a13ea51 100755 --- a/tests/mhd/test_vmec.py +++ b/tests/mhd/test_vmec.py @@ -230,8 +230,10 @@ def test_surface_4_ways(self): def compare_surfaces_sym(s1, s2): logger.debug('compare_surfaces_sym called') - mpol = min(s1.mpol, s2.mpol) - ntor = min(s1.ntor, s2.ntor) + self.assertEqual(s1.mpol, s2.mpol) + self.assertEqual(s1.ntor, s2.ntor) + mpol = s1.mpol + ntor = s1.ntor places = 13 for m in range(mpol + 1): nmin = 0 if m == 0 else -ntor @@ -243,8 +245,10 @@ def compare_surfaces_asym(s1, s2, places): logger.debug('compare_surfaces_asym called') self.assertAlmostEqual(np.abs(s1.volume()), np.abs(s2.volume()), places=13) self.assertAlmostEqual(s1.area(), s2.area(), places=7) - mpol = min(s1.mpol, s2.mpol) - ntor = min(s1.ntor, s2.ntor) + self.assertEqual(s1.mpol, s2.mpol) + self.assertEqual(s1.ntor, s2.ntor) + mpol = s1.mpol + ntor = s1.ntor for m in range(mpol + 1): nmin = 0 if m == 0 else -ntor for n in range(nmin, ntor + 1):