Skip to content

Commit

Permalink
explicitly use the trajectory listed in zarr
Browse files Browse the repository at this point in the history
  • Loading branch information
surgura committed Jun 5, 2024
1 parent a3294f7 commit bad557a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/instruments/test_ship_underwater_st.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ def test_simulate_ship_underwater_st(tmp_dir_factory: Callable[[str], str]) -> N
results = xr.open_zarr(out_file_name)

assert len(results.trajectory) == 1
assert len(results.sel(trajectory=0).obs) == len(sample_points)
traj = results.trajectory.item()
assert len(results.sel(trajectory=traj).obs) == len(sample_points)

for i, (obs_i, exp) in enumerate(
zip(results.sel(trajectory=0).obs, expected_obs, strict=True)
zip(results.sel(trajectory=traj).obs, expected_obs, strict=True)
):
obs = results.sel(trajectory=0, obs=obs_i)
obs = results.sel(trajectory=traj, obs=obs_i)
for var in variables:
obs_value = obs[var].values.item()
exp_value = exp[var]
Expand Down

0 comments on commit bad557a

Please sign in to comment.