Skip to content

Commit

Permalink
fme
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Sep 12, 2020
1 parent 73f1f34 commit ee205cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 12 additions & 6 deletions yt/data_objects/tests/test_numpy_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ def test_mean_sum_integrate():


def test_min_max():
fields = ("density", "temperature")
units = ("g/cm**3", "K")
for nprocs in [-1, 1, 2, 16]:
if nprocs == -1:
ds = fake_amr_ds(fields=("density", "temperature"), particles=20)
ds = fake_amr_ds(fields=fields, particles=20)
else:
ds = fake_random_ds(
32, nprocs=nprocs, fields=("density", "temperature"), particles=20
32, nprocs=nprocs, fields=fields, units=units, particles=20
)

ad = ds.all_data()
Expand Down Expand Up @@ -128,11 +130,13 @@ def test_min_max():


def test_argmin():
fields = ("density", "temperature")
units = ("g/cm**3", "K")
for nprocs in [-1, 1, 2, 16]:
if nprocs == -1:
ds = fake_amr_ds(fields=("density", "temperature"))
ds = fake_amr_ds(fields=fields)
else:
ds = fake_random_ds(32, nprocs=nprocs, fields=("density", "temperature"))
ds = fake_random_ds(32, nprocs=nprocs, fields=fields, units=units)

ad = ds.all_data()

Expand All @@ -152,11 +156,13 @@ def test_argmin():


def test_argmax():
fields = ("density", "temperature")
units = ("g/cm**3", "K")
for nprocs in [-1, 1, 2, 16]:
if nprocs == -1:
ds = fake_amr_ds(fields=("density", "temperature"))
ds = fake_amr_ds(fields=fields)
else:
ds = fake_random_ds(32, nprocs=nprocs, fields=("density", "temperature"))
ds = fake_random_ds(32, nprocs=nprocs, fields=fields, units=units)

ad = ds.all_data()

Expand Down
4 changes: 3 additions & 1 deletion yt/data_objects/tests/test_spheres.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ def test_domain_sphere():


def test_sphere_center():
ds = fake_random_ds(16, nprocs=8, fields=("density", "temperature", "velocity_x"))
fields = ("density", "temperature", "velocity_x")
units = ("g/cm**3", "K", "cm/s")
ds = fake_random_ds(16, nprocs=8, fields=fields, units=units)

# Test if we obtain same center in different ways
sp1 = ds.sphere("max", (0.25, "unitary"))
Expand Down

0 comments on commit ee205cc

Please sign in to comment.