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

Refactors oref to equal the number of zones along each dimension #4037

Merged

Conversation

BolunThompson
Copy link
Contributor

Refactors over_refine_factor and oref to equal the number of zones along each dimension, instead of nz equaling oref to the power of two.

To maintain backwards compatibility (although this seems to be primarily used internally) loaders.load_octree maintains the old behavior.

Closes #4027

loaders.load_octree() is the most public API that uses
over_refine_factor. Changing over_refine_factor to mean the number of
zones along each dimension (instead of 2**over_refine_factor) is a
breaking change; this reverts that change for load_octree.
@welcome
Copy link

welcome bot commented Jul 27, 2022

Hi! Welcome, and thanks for opening this pull request. We have some guidelines for new pull requests, and soon you'll hear back about the results of our tests and continuous integration checks. Thank you for your contribution!

@neutrinoceros neutrinoceros added the refactor improve readability, maintainability, modularity label Jul 27, 2022
yt/geometry/_selection_routines/selector_object.pxi Outdated Show resolved Hide resolved
yt/geometry/oct_visitors.pyx Outdated Show resolved Hide resolved
@cphyc cphyc added enhancement Making something better index: octree and removed enhancement Making something better labels Jul 28, 2022
@matthewturk
Copy link
Member

@BolunThompson Thank you very much for doing this!

Now that we're actually passing num_zones, do you think we could change it to be called something similar?

@matthewturk
Copy link
Member

I've read the changes and I think they are all pretty good. I would like to see the attributes be renamed (and a back-compat shim put in place for now to allow specifying over_refine_factor, although I have a suspicion that our highest-profile user is @dnarayanan ) and otherwise I think this is good to go.

@BolunThompson
Copy link
Contributor Author

pre-commit.ci autofix

@matthewturk
Copy link
Member

@BolunThompson Let us know when you think this is ready for review?

@BolunThompson
Copy link
Contributor Author

It should be ready for review now.

Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

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

I think other than the one thing, this looks good to go. I still would like @dnarayanan to take a quick look, though.

def __init__(
self, base_region, domain, ds, over_refine_factor=1, num_ghost_zones=0
):
def __init__(self, base_region, domain, ds, num_zones=2, num_ghost_zones=0):
Copy link
Member

Choose a reason for hiding this comment

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

@BolunThompson Could you add a shim here, so that if over_refine_factor is specified it sets num_zones appropriately (and emits a deprecation warning)? We can disable the behavior in 4.2.

Copy link
Member

@Xarthisius Xarthisius left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for your contribution! It looks good to me!

@matthewturk matthewturk merged commit 02d0332 into yt-project:main Aug 2, 2022
@welcome
Copy link

welcome bot commented Aug 2, 2022

Hooray! Congratulations on your first merged pull request! We hope we keep seeing you around! 🎆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
index: octree refactor improve readability, maintainability, modularity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Change block size to be less specified by powers of two
5 participants