Setting ranges for chromosome positions makes sense, however for other indexes where the user wants to get all matching rows (e.g. when REF=='A') things get more difficult. This is a particular problem as set_max is not inclusive, as such, to get all rows matching the last item (e.g. REF=='T'), we have to create a new key value that is definitely beyond it, then set minimum to T and maximum to our new 'maximal' key. When we have compound indexes, this can get complicated.
In fact, just making set_max inclusive would help a lot as it would allow this syntax to work as expected:
cursor.set_min(i.get_min())
cursor.set_max(i.get_max())
and a simple function for set_value would be something like:
def set_value(self, value):
cursor.set_min(value)
cursor.set_max(value)
Not sure what you'd do for binned indexes though...
Setting ranges for chromosome positions makes sense, however for other indexes where the user wants to get all matching rows (e.g. when REF=='A') things get more difficult. This is a particular problem as set_max is not inclusive, as such, to get all rows matching the last item (e.g. REF=='T'), we have to create a new key value that is definitely beyond it, then set minimum to T and maximum to our new 'maximal' key. When we have compound indexes, this can get complicated.
In fact, just making set_max inclusive would help a lot as it would allow this syntax to work as expected:
and a simple function for set_value would be something like:
Not sure what you'd do for binned indexes though...