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

ENH: Enable exporting GAMER and FLASH datasets to octrees #4134

Merged
merged 10 commits into from
May 24, 2023

Conversation

matthewturk
Copy link
Member

@matthewturk matthewturk commented Sep 17, 2022

PR Summary

Initial value: This allows passing in domain_dimensions to the load_octree function, so that you can load octrees that don't have just the one root cell.

New and revised: This PR will enable FLASH and GAMER datasets to be exposed as Octree datasets, which will be a method for testing improvements in performance.

PR Checklist

  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

yt/loaders.py Outdated Show resolved Hide resolved
@matthewturk matthewturk changed the title Allow passing domain_dimensions to load_octree [WIP] ENH: Enable exporting GAMER and FLASH datasets to octrees Sep 19, 2022
jzuhone
jzuhone previously approved these changes Sep 19, 2022
@neutrinoceros
Copy link
Member

close/open to refresh CI now that unrelated failures are resolved on main

@neutrinoceros neutrinoceros reopened this Sep 21, 2022
@neutrinoceros neutrinoceros added enhancement Making something better code frontends Things related to specific frontends labels Sep 21, 2022
@neutrinoceros neutrinoceros added this to the 4.2.0 milestone Oct 13, 2022
@neutrinoceros
Copy link
Member

Again refreshing CI

@neutrinoceros
Copy link
Member

@matthewturk Is this still "WIP" or is it actually ready for merging ?

@matthewturk
Copy link
Member Author

So I think it needs another pass from me. But I will check today!

It's currently -8F here with 24MPH winds! Once I get the place under control I'll take a look over this one. Should be a fun task for a funny day.

@cphyc
Copy link
Member

cphyc commented Dec 23, 2022 via email

@matthewturk
Copy link
Member Author

matthewturk commented Dec 23, 2022 via email

@matthewturk matthewturk changed the title [WIP] ENH: Enable exporting GAMER and FLASH datasets to octrees ENH: Enable exporting GAMER and FLASH datasets to octrees Dec 23, 2022
@matthewturk
Copy link
Member Author

So it's ready for review but I don't want it to be merged quite yet -- a few more minor things I want to address.

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.

Here are a couple remarks

yt/loaders.py Outdated Show resolved Hide resolved
yt/loaders.py Outdated Show resolved Hide resolved
yt/geometry/oct_container.pyx Outdated Show resolved Hide resolved
@neutrinoceros
Copy link
Member

looks like this PR grew a couple minor conflicts. I'm also waiting for my comments to be adressed, but it seems like a low-hanging fruit on the journey to yt 4.2

Co-authored-by: Clément Robert <cr52@protonmail.com>
Comment on lines +598 to +603
# We allow specifying curlevel = -1 to query from the levels array
# instead.
if curlevel == -1:
this_level = levels[p]
else:
this_level = curlevel
Copy link
Member

Choose a reason for hiding this comment

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

this doesn't depend on the iteration variable (p), so it would be clearer (and more efficient) to put it outside the loop

Copy link
Member Author

Choose a reason for hiding this comment

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

levels[p]

Copy link
Member

Choose a reason for hiding this comment

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

🤦🏻‍♂️

@@ -170,7 +170,7 @@ cdef class OctreeContainer:
pos[2] = self.DLE[2] + dds[2]/2.0
for k in range(self.nn[2]):
if self.root_mesh[i][j][k] == NULL:
raise RuntimeError
raise KeyError(i,j,k)
Copy link
Member

Choose a reason for hiding this comment

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

I guess an IndexError would be slightly more appropriate

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I think KeyError is fine. The issue is that we have constructed what amounts to a mapping, and that mapping has nothing in it for a given key.

Copy link
Member

Choose a reason for hiding this comment

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

ok, makes sense

@neutrinoceros neutrinoceros enabled auto-merge May 24, 2023 17:20
@neutrinoceros neutrinoceros disabled auto-merge May 24, 2023 17:20
@neutrinoceros neutrinoceros enabled auto-merge (squash) May 24, 2023 17:21
@neutrinoceros neutrinoceros merged commit 6c3bc26 into yt-project:main May 24, 2023
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.

4 participants