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: Properly reference weight field in profile code for particle-based datasets #5090

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion yt/data_objects/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ def create_profile(
for f in bin_fields + fields
]
if wf is not None:
is_local.append(wf.sampling_type == "local")
is_local.append(data_source.ds.field_info[wf].sampling_type == "local")
is_local_or_pfield = [
pf or lf for (pf, lf) in zip(is_pfield, is_local, strict=True)
]
Expand Down
6 changes: 6 additions & 0 deletions yt/data_objects/tests/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@ def test_profile_sph_data():
[("gas", "kinetic_energy_density")],
weight_field=None,
)
yt.create_profile(
ds.all_data(),
[("gas", "density"), ("gas", "temperature")],
[("gas", "kinetic_energy_density")],
weight_field=("gas", "density"),
)


def test_profile_override_limits():
Expand Down
Loading