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

Function ratio_response

dask/array/svg.py:282–296  ·  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

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

Callers 1

draw_sizesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected