Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelLucaAdams committed Aug 2, 2024
1 parent 324858d commit b7feeac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Binary file added tests/example_files/0011.sdf
Binary file not shown.
10 changes: 9 additions & 1 deletion tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ def test_basic():
with xr.open_dataset(EXAMPLE_FILES_DIR / "0000.sdf") as df:
ex_field = "Electric Field/Ex"
assert ex_field in df
x_coord = "X_x_px_deltaf/electron_beam"
x_coord = "X_Grid_mid"
assert x_coord in df[ex_field].coords
assert df[x_coord].attrs["long_name"] == "X"

def test_coords():
with xr.open_dataset(EXAMPLE_FILES_DIR / "0011.sdf") as df:
px_photon = "dist_fn/px_py/Photon"
assert px_photon in df
x_coord = "Px_px_py/Photon"
assert x_coord in df[px_photon].coords
assert df[x_coord].attrs["long_name"] == "Px"

0 comments on commit b7feeac

Please sign in to comment.