genevector.cache

genevector/cache.py — target score caching with hash-based keys.

clear_cache()[source]

Remove all cached score files.

compute_cache_key(X, gene_names, target_name, target_kwargs, signed_mi)[source]

Deterministic hash for a given dataset + target configuration.

Returns:

key – A 32-char hex string uniquely identifying this computation.

Return type:

str

get_cache_path(cache_key)[source]

Return filesystem path for a cache key, creating the directory if needed.

Parameters:

cache_key (str) – Hash key identifying the cached computation.

Returns:

Full path to the .npz cache file.

Return type:

str

load_scores(cache_key)[source]

Load cached scores. Returns (mi_scores dict, gene_names) or (None, None).

save_scores(cache_key, mi_scores, gene_names)[source]

Serialize score dict to a compressed npz file.

Stores scores as a dense matrix + gene name list for fast load.