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

Add support for Enzo-E simulations with 0 ghost zones #4932

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

mabruzzo
Copy link
Contributor

PR Summary

The primary purpose of this PR was to add support for Enzo-E simulations with 0 ghost zones.

While I was here, I added support for Enzo-E simulations where the x, y, and z axes have different numbers of ghost zones (this is a feature that Enzo-E supports, but it's not really used). I also added some explanatory comments.

@neutrinoceros
Copy link
Member

Thanks @mabruzzo ! I'll review this tomorrow but I just wanted to point out that you will likely hit a couple unrelated bugs that are solved in #4930 so don't scratch your head too much over failures for now :)

@mabruzzo
Copy link
Contributor Author

Thanks @mabruzzo ! I'll review this tomorrow but I just wanted to point out that you will likely hit a couple unrelated bugs that are solved in #4930 so don't scratch your head too much over failures for now :)

Gotcha.

FYI this is currently built off of a slightly older point in the main branch. This was mainly for convenience (I was a really hard time setting up yt off of the HEAD of the main-branch. My issues are probably user-error. (I recently switched to a new machine and started using conda for the first time in years). I'm happy to fast-forward this whenever.

@neutrinoceros
Copy link
Member

FYI this is currently built off of a slightly older point in the main branch.

as long as there are no conflicts (which there aren't), this shouldn't matter :)

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.

This looks fine to me, just a minor suggestion

@@ -406,9 +406,12 @@ def _parse_parameter_file(self):
ablock = fh[list(fh.keys())[0]]
self.current_time = ablock.attrs["time"][0]
self.parameters["current_cycle"] = ablock.attrs["cycle"][0]
gsi = ablock.attrs["enzo_GridStartIndex"]
gsi = ablock.attrs["enzo_GridStartIndex"] # <- always has 3 elements
Copy link
Member

Choose a reason for hiding this comment

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

Instead of a comment, you could add an assert here, which would be less likely to rot silently

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! Fixed

self.ghost_zones = gsi[0]
# Enzo-E technically allows each axis to have different ghost zone
# depths (this feature is not really used in practice)
self.ghost_zones = gsi
Copy link
Member

Choose a reason for hiding this comment

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

although technically not backward compatible, I don't expect anyone to rely on the old behavior so I'm tempted to just let this change in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I definitely agree, especially because pool of enzo-e users is currently very small. (At most, there are maybe 5 people who regularly use the yt-frontend right now)

But, let me know if you would prefer I change it (and whether there is an obvious preferred way to do it)

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine as is. I'll just give it a couple weeks before merging in case anyone objects.

@neutrinoceros neutrinoceros added enhancement Making something better code frontends Things related to specific frontends labels Jun 23, 2024
@neutrinoceros neutrinoceros added this to the 4.4.0 milestone Jun 23, 2024
@neutrinoceros
Copy link
Member

@yt-fido Test this please

@neutrinoceros
Copy link
Member

The typing error is unrelated and already fixed on main, so let’s get this in. Thanks again for your patience !

@neutrinoceros neutrinoceros merged commit 874cb3f into yt-project:main Jul 16, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code frontends Things related to specific frontends enhancement Making something better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants