make_key#

gammapy.utils.cache.make_key(sig, *args, **kwargs)[source]#

Generate a unique hash key for caching based on normalized constructor arguments.

This function uses the signature of the class constructor (__init__) to normalize the input arguments, serializes them using ray.cloudpickle, and returns a SHA-256 hash digest. The resulting key is suitable for use in caching mechanisms.

Parameters:
siginspect.Signature

The signature of the method or function used to normalize arguments.

*argstuple

Positional arguments to be normalized.

**kwargsdict

Keyword arguments to be normalized.

Returns:
keystr

A SHA-256 hexadecimal digest representing the normalized arguments.