bluesky_tiled_plugins.utils#
Module Contents#
Functions#
Truncate large numerical values to avoid overflow issues when serializing as JSON. |
|
Compile a filename template from old-style to new-style Python formatting |
|
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"