Skip to content

Commit 3eeb790

Browse files
committed
Fix unit conversion issue
1 parent ccbc959 commit 3eeb790

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

yt/visualization/tests/test_offaxisprojection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,11 @@ def test_two_offaxis():
317317

318318
# define a new yt velocity field relative to the bulk velocity of the halo and along the line of sight
319319
def _velocity_los_test(field, data):
320-
v = np.stack([data["gas", f"velocity_{k}"] for k in "xyz"], axis=-1)
320+
v = np.stack(
321+
[data["gas", f"velocity_{k}"].to("km/s").d for k in "xyz"], axis=-1
322+
)
321323
v_los = np.dot(v, los_unit_vector)
322-
return v_los.to("km/s")
324+
return v_los
323325

324326
ds.add_field(
325327
("gas", "velocity_los_test"),

0 commit comments

Comments
 (0)