Skip to content

Commit

Permalink
fixup! ENH: improve error messages when add_field received a malforme…
Browse files Browse the repository at this point in the history
…d function argument
  • Loading branch information
neutrinoceros committed May 13, 2022
1 parent c08c55d commit 9fd15ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yt/data_objects/tests/test_add_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ def _spam(field, data, factor):
return factor * data["gas", "density"]

ds.add_field(
("bacon", "spam"),
("gas", "spam"),
partial(_spam, factor=1),
sampling_type="cell",
)

# check access
ds.all_data()["gas", "spam"]


def test_add_field_arbitrary_callable():
ds = fake_random_ds(16)
Expand Down

0 comments on commit 9fd15ba

Please sign in to comment.