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: fix the error when loading a non-cosmological Gizmo dataset #4331

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

jisuoqing
Copy link
Member

Fix the error 'GizmoFieldInfo' object has no attribute 'nuclei_names' complained by Line 122

for species in self.nuclei_names:
self.add_field(
(ptype, f"{species}_nuclei_mass_density"),

when loading a non-cosmological Gizmo dataset.

@jisuoqing jisuoqing added bug code frontends Things related to specific frontends labels Feb 9, 2023
Copy link
Member

@neutrinoceros neutrinoceros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch ! Shouldn't self.species_names be assigned in the else branch too ?

@neutrinoceros
Copy link
Member

Shouldn't self.species_names be assigned in the else branch too ?

I can answer that myself: it's not needed, because this one is already set by FieldInfoContainer.__init__. nuclei_names on the other hand is a frontend-specific attribute.

@neutrinoceros neutrinoceros merged commit 7ce72d2 into yt-project:main Feb 9, 2023
@jisuoqing jisuoqing deleted the gizmo_fix branch February 10, 2023 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug code frontends Things related to specific frontends
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants