-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InMemoryDataset redesign] Object-oriented as_subchunk_map
- Loading branch information
1 parent
3b58bdd
commit f7f09fc
Showing
3 changed files
with
531 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This file allows cimport'ing the functions declared below from other Cython modules | ||
|
||
from cython cimport Py_ssize_t | ||
|
||
|
||
cdef class IndexChunkMapper: | ||
cdef readonly Py_ssize_t[:] chunk_indices | ||
cdef readonly Py_ssize_t chunk_size | ||
cdef readonly Py_ssize_t dset_size | ||
|
||
cpdef tuple[object, object] chunk_submap( | ||
self, | ||
Py_ssize_t chunk_start_idx, | ||
Py_ssize_t chunk_stop_idx, | ||
bint shift, | ||
) | ||
|
||
# Private methods. Cython complains if we don't export _everything_. | ||
cdef tuple[Py_ssize_t, Py_ssize_t] _chunk_start_stop( | ||
self, Py_ssize_t a, Py_ssize_t b | ||
) | ||
cdef tuple[object, object, object] chunk_submap_compat(self, Py_ssize_t chunk_idx) | ||
|
||
# Utility functions | ||
cpdef Py_ssize_t ceil_a_over_b(Py_ssize_t a, Py_ssize_t b) |
Oops, something went wrong.