MCPcopy Create free account
hub / github.com/PyTables/PyTables / col_medium

Function col_medium

tables/idxutils.py:244–264  ·  view source on GitHub ↗

Compute the optimizations to be done for medium indexes.

(nblocks: int, optlevel: int)

Source from the content-addressed store, hash-verified

242
243
244def col_medium(nblocks: int, optlevel: int) -> tuple[bool, bool, bool, bool]:
245 """Compute the optimizations to be done for medium indexes."""
246 optmedian, optstarts, optstops, optfull = (False,) * 4
247
248 # Medium case
249 if nblocks <= 1:
250 if 0 < optlevel <= 3:
251 optmedian = True
252 elif 3 < optlevel <= 6:
253 optmedian, optstarts = (True, True)
254 elif 6 < optlevel <= 9:
255 optfull = 1
256 else: # More than a block
257 if 0 < optlevel <= 3:
258 optfull = 1
259 elif 3 < optlevel <= 6:
260 optfull = 2
261 elif 6 < optlevel <= 9:
262 optfull = 3
263
264 return optmedian, optstarts, optstops, optfull
265
266
267def col_full(nblocks: int, optlevel: int) -> tuple[bool, bool, bool, bool]:

Callers 1

calcoptlevelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected