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

PERF: Use bitarray to count grid cells #4530

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 1 addition & 5 deletions yt/geometry/grid_container.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,7 @@ cdef class GridTree:
data.array = <void*>mask.buf
self.visit_grids(&data, grid_visitors.mask_cells, selector)
self.mask = mask
size = 0
self.setup_data(&data)
data.array = <void*>(&size)
self.visit_grids(&data, grid_visitors.count_cells, selector)
return size
return mask.count()

def select_icoords(self, SelectorObject selector, np.uint64_t size = -1):
# Fill icoords with a selector
Expand Down