Remove 'universal_' prefix from CSV column names in multi-branch mode
Universal components (Fermi, Screening, etc.) are exported under their plain names — no redundant prefix needed.
This commit is contained in:
@@ -1582,10 +1582,10 @@ class BetaSpectrumAnalyzer:
|
|||||||
for comp_name, values in branch_comps.items():
|
for comp_name, values in branch_comps.items():
|
||||||
data[f"branch_{i+1}_{comp_name}"] = values
|
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():
|
for name, values in components.items():
|
||||||
if not name.startswith("branch_"):
|
if not name.startswith("branch_"):
|
||||||
data[f"universal_{name}"] = values
|
data[name] = values
|
||||||
else:
|
else:
|
||||||
# Single-branch mode: standard export
|
# Single-branch mode: standard export
|
||||||
for name, values in components.items():
|
for name, values in components.items():
|
||||||
|
|||||||
@@ -479,7 +479,7 @@ class TestMultiBranchCSVExport:
|
|||||||
assert "branch_2_transition" not in df.columns
|
assert "branch_2_transition" not in df.columns
|
||||||
|
|
||||||
# Should have universal 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):
|
def test_single_branch_csv_columns(self, tmp_path):
|
||||||
"""Single-branch CSV should have standard columns."""
|
"""Single-branch CSV should have standard columns."""
|
||||||
|
|||||||
Reference in New Issue
Block a user