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

PhasePlot fails when a weight_field is set for a particle-based dataset #5089

Open
chummels opened this issue Dec 19, 2024 · 0 comments · May be fixed by #5090
Open

PhasePlot fails when a weight_field is set for a particle-based dataset #5089

chummels opened this issue Dec 19, 2024 · 0 comments · May be fixed by #5090
Assignees
Labels

Comments

@chummels
Copy link
Member

Bug report

Bug summary

PhasePlot fails when a weight_field is set for a particle-based dataset. Note, this does not affect grid-based datasets.

Code for reproduction

import yt
ds = yt.load_sample("FIRE_M12i_ref11")
my_sphere = ds.sphere("c", (50, "kpc"))
plot = yt.PhasePlot(my_sphere, ("gas", "density"), ("gas", "temperature"), [("gas", "H_p0_fraction")], weight_field=('gas', 'density'))
plot.save()

Actual outcome

Traceback (most recent call last):
  File "/Users/chummels/scratch/test_weight_field.py", line 4, in <module>
    plot = yt.PhasePlot(my_sphere, ("gas", "density"), ("gas", "temperature"), [("gas", "H_p0_fraction")], weight_field=('gas', 'density'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/chummels/src/yt/yt/visualization/profile_plotter.py", line 953, in __init__
    profile = create_profile(
              ^^^^^^^^^^^^^^^
  File "/Users/chummels/src/yt/yt/data_objects/profiles.py", line 1317, in create_profile
    is_local.append(wf.sampling_type == "local")
                    ^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'sampling_type'```

**Expected outcome**

The PhasePlot completing successfully and making a PhasePlot output file.

**Version Information**
yt dev tip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant