playnano.utils.versioning module

Module for applying version numbers to filters and masks.

playnano.utils.versioning.versioned_filter(version: str)[source]

Add decorator to assign a version number to a filter or mask function.

This adds a __version__ attribute to the decorated function, which can be used for provenance tracking or documentation purposes.

Parameters:

version (str) – The version string to assign to the function, e.g., “1.0.0”.

Returns:

The decorated function with a __version__ attribute.

Return type:

callable

Examples

>>> @versioned_filter("1.0.0")
... def gaussian_filter(frame, sigma=1.0):
...     ...
>>> gaussian_filter.__version__
'1.0.0'