bluesky_tiled_plugins.utils#

Module Contents#

Functions#

truncate_json_overflow

Truncate large numerical values to avoid overflow issues when serializing as JSON.

compile_template

Compile a filename template from old-style to new-style Python formatting

list_summands

API#

bluesky_tiled_plugins.utils.truncate_json_overflow(data)#

Truncate large numerical values to avoid overflow issues when serializing as JSON.

This preemptively truncates large integers and floats with zero fractional part to fit within the JSON limits for integers, i.e. (-2^53, 2^53 - 1], in case the values are implicitly converted during serialization.

bluesky_tiled_plugins.utils.compile_template(template: str, filename: str = '') str#

Compile a filename template from old-style to new-style Python formatting

Parameters

template : str An old-style Python formatting string, e.g. “%s%s_%06d.tif filename : str An optional filename to substitute for the first %s in the template.

Returns

A new-style Python formatting string, e.g. "filename_{:06d}.tif"
bluesky_tiled_plugins.utils.list_summands(A: int, b: int, repeat: int = 1) tuple[int, ...]#