-
Notifications
You must be signed in to change notification settings - Fork 280
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
Avoiding issue for CHOLLA LightRay datasets #4389
Conversation
@@ -157,6 +157,10 @@ def _is_valid(cls, filename, *args, **kwargs): | |||
except AttributeError: | |||
return False | |||
else: | |||
return "bounds" in attrs and "domain" in attrs | |||
# Avoiding issue where CHOLLA LightRay datasets get selected | |||
if attrs["data_type"] == "yt_light_ray": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if attrs
doesn't have data_type
? How about making this part of the below statement, with something like return attrs.get("data_type", None) != "yt_light_ray"
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! I'm not thinking this morning.
Co-authored-by: Clément Robert <cr52@protonmail.com>
Thanks for the feedback, team! |
The CHOLLA frontend identifies its dataset based on the presence of a couple of HDF5 attributes. When a yt
LightRay
dataset is created from any frontend, it inherits all of the attributes from that frontend. So when someone tries to load aLightRay
dataset created from a CHOLLA frontend, yt gets confused as it thinks it's both a CHOLLA frontend as well as aLightRay
dataset and it barfs. This removes that degeneracy by specifically looking for theLightRay
attribute in the HDF5 file and not counting it as a CHOLLA dataset when it finds it. Bug reported by @evaneschneider .