Skip to content

Commit

Permalink
add test of mgrid with potential
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncbader committed Apr 5, 2024
1 parent 1ef6e4f commit 5b53d27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/field/test_mgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

TEST_DIR = (Path(__file__).parent / ".." / "test_files").resolve()
test_file = TEST_DIR / 'mgrid.pnas-qa-test-lowres-standard.nc'

test_file2 = TEST_DIR / 'mgrid_ncsx_lowres_test.nc'

class Testing(unittest.TestCase):

Expand All @@ -36,6 +36,13 @@ def test_from_file(self):
assert mgrid.br_arr.shape == (1, 6, 11, 11)
assert mgrid.br[0, 0, 0] == -1.0633399551863771 # -0.9946816978184079

mgrid = MGrid.from_file(test_file2)
assert mgrid.rmin == 1.0
assert mgrid.bvec.shape == (10, 12, 4, 3)
assert mgrid.bz[1, 1, 1] == -1.012339153040808
assert mgrid.ap[1, 1, 1] == -0.3719177477496187


def test_add_field_cylinder(self):
N_points = 5
br = np.ones(N_points)
Expand Down
Binary file added tests/test_files/mgrid_ncsx_lowres_test.nc
Binary file not shown.

0 comments on commit 5b53d27

Please sign in to comment.