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

minor bugfix in cholla frontend #4686

Merged
merged 2 commits into from
Oct 26, 2023
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
4 changes: 3 additions & 1 deletion yt/frontends/cholla/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ def _parse_parameter_file(self):
attrs = h5f.attrs
self.parameters = dict(attrs.items())
self.domain_left_edge = attrs["bounds"][:].astype("=f8")
self.domain_right_edge = attrs["domain"][:].astype("=f8")
self.domain_right_edge = self.domain_left_edge + attrs["domain"][:].astype(
"=f8"
)
Comment on lines +106 to +108
Copy link
Member

Choose a reason for hiding this comment

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

This is one of the rare cases where black makes things objectively worse looking... here's a possible alternative

Suggested change
self.domain_right_edge = self.domain_left_edge + attrs["domain"][:].astype(
"=f8"
)
dre = attrs["bounds"][:] + attrs["domain"][:]
self.domain_right_edge = dre.astype("=f8")

self.dimensionality = len(attrs["dims"][:])
self.domain_dimensions = attrs["dims"][:].astype("=f8")
self.current_time = attrs["t"][:]
Expand Down