from __future__ import annotations

from pathlib import Path

import numpy as np

from dsp_reference_case import run_hot_path

BASELINE = Path(__file__).parent / "baselines" / "dsp_hot_path.npz"


def test_hot_dsp_path_matches_pre_optimization_reference():
    expected = np.load(BASELINE)
    actual = run_hot_path()
    assert set(expected.files) == set(actual)
    for key, value in actual.items():
        reference = expected[key]
        assert value.shape == reference.shape
        np.testing.assert_allclose(value, reference, rtol=2e-6, atol=2e-7, err_msg=key)
