MCPcopy Create free account
hub / github.com/dask/dask / ratio_response

Function ratio_response

dask/array/svg.py:273–287  ·  view source on GitHub ↗

How we display actual size ratios Common ratios in sizes span several orders of magnitude, which is hard for us to perceive. We keep ratios in the 1-3 range accurate, and then apply a logarithm to values up until about 100 or so, at which point we stop scaling.

(x)

Source from the content-addressed store, hash-verified

271
272
273def ratio_response(x):
274 """How we display actual size ratios
275
276 Common ratios in sizes span several orders of magnitude,
277 which is hard for us to perceive.
278
279 We keep ratios in the 1-3 range accurate, and then apply a logarithm to
280 values up until about 100 or so, at which point we stop scaling.
281 """
282 if x < math.e:
283 return x
284 elif x <= 100:
285 return math.log(x + 12.4) # f(e) == e
286 else:
287 return math.log(100 + 12.4)

Callers 1

draw_sizesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected