-
Notifications
You must be signed in to change notification settings - Fork 276
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
[bugfix] H nuclei are being double-counted in the Arepo frontend #4211
Conversation
@matthewturk or @neutrinoceros this is a fix which should be merged pretty quickly if possible |
This seems sound. I'd like to get a deeper look at this tomorrow to make sure I understand what's going on. In particular I want to check that removing the alias does indeed not count as a breaking change, as you suggested. |
So, I find that there's only one sample dataset that this can be tested with, namely import yt
ds = yt.load_sample("TNGHalo")
ad = ds.all_data()
print(ad["gas", "H_number_density"])
print(ad["gas", "H_nuclei_density"]) I get
I see that indeed, the "alias" field |
Grrr stupid python 3.9 test |
(Soon we'll get rid of these with #4122) |
…ed in the Arepo frontend
…1-on-yt-4.1.x Backport PR #4211 on branch yt-4.1.x ([bugfix] H nuclei are being double-counted in the Arepo frontend)
PR Summary
yt computes "nuclei density" fields by summing up ion number density fields for the same nuclei with different ionization states. The Arepo frontend currently has
"H"
,"H_p0"
, and"H_p1"
all added to thespecies_names
attribute inArepoFieldInfo
, which is then used to compute the set up the species fields and compute the fields for specific abundances.The
"H_p0"
and"H_p1"
do not belong in this list for two reasons:ArepoFieldInfo.setup_gas_particle_fields
, and do not need to be handled bysetup_species_fields
.species_names
results in the number of hydrogen nuclei being double-countedThis PR removes those ionization species from the
species_names
attribute and also removes an alias betweenH_nuclei_density
andH_number_density
which was supposed to work (and maybe did at one point) but is no longer working. It is also unnecessary with the above fix.PR Checklist