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

Function csformula

tables/leaf.py:77–83  ·  view source on GitHub ↗

Return the fitted chunksize for expected_mb.

(expected_mb: int)

Source from the content-addressed store, hash-verified

75
76
77def csformula(expected_mb: int) -> int:
78 """Return the fitted chunksize for expected_mb."""
79 # For a basesize of 8 KB, this will return:
80 # 8 KB for datasets <= 1 MB
81 # 1 MB for datasets >= 10 TB
82 basesize = 8 * 1024 # 8 KB is a good minimum
83 return basesize * int(2 ** math.log10(expected_mb))
84
85
86def limit_es(expected_mb: int) -> int:

Callers 1

calc_chunksizeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected