-
Notifications
You must be signed in to change notification settings - Fork 304
Closed
Labels
Description
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