Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Multiple fields break sanitization #4903

Open
matthewturk opened this issue May 15, 2024 · 2 comments · Fixed by #4904
Open

BUG: Multiple fields break sanitization #4903

matthewturk opened this issue May 15, 2024 · 2 comments · Fixed by #4904

Comments

@matthewturk
Copy link
Member

Calling ds.r[:].mean([("gas", "density"), ("gas", "temperature")]) fails, claiming it can't identify the field [("gas", "density"), ("gas", "temperature")].

This is because it calls weight_field = sanitize_weight_field(self.ds, field, weight), which tries to regard field as a single field name.

A simple fix, which would only fix in the case of manually specifying the weight_field, would be to put the field_object assignment inside the conditional for if weight_field is None. A slightly better fix would be to have it check that the type is the same for all the specified fields, which would require some "ensure this is a list of field types" or something.

@chrishavlin
Copy link
Contributor

oops, just merged #4904 and this one automatically closed. but since that PR only covered the simpler case when weight_field is not None, this issue should stay open, ya?

@chrishavlin chrishavlin reopened this May 15, 2024
@matthewturk
Copy link
Member Author

matthewturk commented May 15, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants