-
Notifications
You must be signed in to change notification settings - Fork 20
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
[DNM] [InMemoryDataset redesign] Object-oriented as_subchunk_map #372
base: master
Are you sure you want to change the base?
Conversation
as_subchunk_map
as_subchunk_map
# This causes behaviour to change if a and b have opposite signs and you try | ||
# debugging the module in pure python, without compiling it. | ||
# This function blindly assumes that a and b are always the same sign. | ||
return a // b + (a % b > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No performance difference observed
|
||
@cython.cclass | ||
class EverythingMapper(IndexChunkMapper): | ||
"""Select all points along an axis [:]""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tecnically the same as SliceMapper(0, dset_size, 1, chunk_size, dset_size)
but much cleaner and faster
7006afb
to
1731279
Compare
59bb080
to
2b23449
Compare
# | ||
# Or uncomment the -a flag above and then run: | ||
# meson build && pushd build && meson compile && popd && firefox $(find build/ -name "*.html") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the above is a copy-paste from #371 - replicated here to allow for parallel review
2a73d92
to
a3a2ec3
Compare
a3a2ec3
to
efecb3e
Compare
efecb3e
to
f7f09fc
Compare
This is a partial PR that breaks down #370 into digestible chunks - see #370 (comment)
This PR refactors
as_chunk_submap
to be built on top of an abstract class,IndexChunkMapper
, which is then implemented by one subclass per type of index.This in and by itself is hardly useful, but it will become necessary when these mapper objects will be used all over the place by #370.
There are also a few extra features, which are unused for now:
IndexChunkMapper.chunk_submap
, which refactors the existing code, can nowas_subchunk_map
.These new features remain untested for now; unit tests will be added in #373.