From c404d83418826cf2a51a36d9af1a0041affc8808 Mon Sep 17 00:00:00 2001 From: Evgeniy Unzhakov Date: Fri, 8 May 2026 15:54:13 +0300 Subject: [PATCH] Remove 'universal_' prefix from CSV column names in multi-branch mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Universal components (Fermi, Screening, etc.) are exported under their plain names — no redundant prefix needed. --- beta_spectrum/spectrum.py | 4 ++-- tests/test_multi_branch.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beta_spectrum/spectrum.py b/beta_spectrum/spectrum.py index ca2884f..5622847 100644 --- a/beta_spectrum/spectrum.py +++ b/beta_spectrum/spectrum.py @@ -1582,10 +1582,10 @@ class BetaSpectrumAnalyzer: for comp_name, values in branch_comps.items(): data[f"branch_{i+1}_{comp_name}"] = values - # Universal components only (skip per-branch keys) + # Universal components (same for all branches — no prefix needed) for name, values in components.items(): if not name.startswith("branch_"): - data[f"universal_{name}"] = values + data[name] = values else: # Single-branch mode: standard export for name, values in components.items(): diff --git a/tests/test_multi_branch.py b/tests/test_multi_branch.py index e35925f..dfba7f3 100644 --- a/tests/test_multi_branch.py +++ b/tests/test_multi_branch.py @@ -479,7 +479,7 @@ class TestMultiBranchCSVExport: assert "branch_2_transition" not in df.columns # Should have universal columns - assert "universal_Fermi" in df.columns + assert "Fermi" in df.columns def test_single_branch_csv_columns(self, tmp_path): """Single-branch CSV should have standard columns."""