Compute the optimizations to be done for medium indexes.
(nblocks: int, optlevel: int)
| 242 | |
| 243 | |
| 244 | def 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 | |
| 267 | def col_full(nblocks: int, optlevel: int) -> tuple[bool, bool, bool, bool]: |