From a00a695a961fa50d558ac56b530ff46ff9357895 Mon Sep 17 00:00:00 2001 From: richteague Date: Thu, 6 Aug 2026 11:17:26 -0400 Subject: [PATCH] Fix ValueError in StructureFunction2DStack.calculate_modal_power calculate_modal_power unpacked two values from the stack's fit_spiral, which returns three (popts, perrs, model_fns), so every call raised "too many values to unpack (expected 2)". The method had no test coverage and no in-repo caller, so the breakage went unnoticed when fit_spiral gained its per-ring model_fns return. Discard the third element; behaviour is otherwise unchanged. Co-Authored-By: Claude Opus 5 (1M context) --- eddy/structurefunction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eddy/structurefunction.py b/eddy/structurefunction.py index 213db43..7d8ebfb 100644 --- a/eddy/structurefunction.py +++ b/eddy/structurefunction.py @@ -2918,7 +2918,7 @@ def calculate_modal_power(self, modes=(1,), axis=None, p0=None): * ``frac_of_data_total``: ``sum_m frac_of_data``, ``(N_ref,)``. * ``popt``, ``perr``: the raw fit outputs. """ - popt, perr = self.fit_spiral(modes=modes, axis=axis, p0=p0) + popt, perr, _ = self.fit_spiral(modes=modes, axis=axis, p0=p0) offset = popt[:, 0] amps = popt[:, 1:] power = amps ** 2