# /// script
# requires-python = ">=3.11"
# dependencies = []
# ///
"""Demonstrate the NMFk peak-shift sign convention."""

import sys
from pathlib import Path

ROOT = Path(__file__).parents[1]
sys.path.insert(0, str(ROOT / "reference"))
import nmfk

a = [0.0, 1.0, 2.0, 1.0, 0.0]
b = [0.0, 0.0, 1.0, 2.0, 1.0]
shift, corr = nmfk.best_shift_correlation(a, b, 2)
print(f"shift={shift}")
print(f"correlation={corr:.3f}")
