Skip to content

Commit

Permalink
Merge pull request #4964 from chrishavlin/tipsy_bbox_hsml
Browse files Browse the repository at this point in the history
  • Loading branch information
jzuhone authored Aug 17, 2024
2 parents 981a8be + 0a3cefc commit ba832f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yt/frontends/tipsy/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def _fill_fields(self, fields, vals, hsml, mask, data_file):
if mask is None:
size = 0
elif isinstance(mask, slice):
size = vals[fields[0]].size
if fields[0] == "smoothing_length":
size = hsml.size
else:
size = vals[fields[0]].size
else:
size = mask.sum()
rv = {}
Expand Down
6 changes: 6 additions & 0 deletions yt/frontends/tipsy/tests/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,9 @@ def test_tipsy_index():
ds = data_dir_load(tipsy_gal)
sl = ds.slice("z", 0.0)
assert sl["gas", "density"].shape[0] != 0


@requires_file(tipsy_gal)
def test_tipsy_smoothing_length():
ds = data_dir_load(tipsy_gal)
_ = ds.all_data()["Gas", "smoothing_length"]

0 comments on commit ba832f4

Please sign in to comment.