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

Backport PR #5054 on branch yt-4.4.x (BUG: fix error message when trying to load a Parthenon dataset without h5py installed) #5058

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions yt/frontends/parthenon/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def _populate_grid_objects(self):


class ParthenonDataset(Dataset):
_load_requirements = ["h5py"]
_field_info_class = ParthenonFieldInfo
_dataset_type = "parthenon"
_index_class = ParthenonHierarchy
Expand Down Expand Up @@ -312,6 +313,8 @@ def _parse_parameter_file(self):

@classmethod
def _is_valid(cls, filename: str, *args, **kwargs) -> bool:
if cls._missing_load_requirements():
return False
return filename.endswith((".phdf", ".rhdf"))

@property
Expand Down
Loading