From 62a65fdb6e5299fb8064c00b16a80d8d458264db Mon Sep 17 00:00:00 2001 From: Alexander Puck Neuwirth Date: Tue, 15 Oct 2024 09:21:54 +0200 Subject: [PATCH] not double format --- src/babyyoda/grogu/histo1d_v3.py | 5 ++--- src/babyyoda/grogu/histo2d_v3.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/babyyoda/grogu/histo1d_v3.py b/src/babyyoda/grogu/histo1d_v3.py index 3234a4b..e85d490 100644 --- a/src/babyyoda/grogu/histo1d_v3.py +++ b/src/babyyoda/grogu/histo1d_v3.py @@ -306,9 +306,8 @@ def to_string(self): # Add the sumw and other info (we assume it's present in the metadata but you could also compute) stats = f"# Mean: {self.xMean():.6e}\n" f"# Integral: {self.integral():.6e}\n" - edges = ( - f"Edges(A1): [{', '.join(f"{float(val):.6e}" for val in self.d_edges)}]\n" - ) + listed = ", ".join(f"{float(val):.6e}" for val in self.d_edges) + edges = f"Edges(A1): [{listed}]\n" # Add the bin data bin_data = "\n".join(GROGU_HISTO1D_V3.Bin.to_string(b) for b in self.bins(True)) diff --git a/src/babyyoda/grogu/histo2d_v3.py b/src/babyyoda/grogu/histo2d_v3.py index 29c4129..f7e0945 100644 --- a/src/babyyoda/grogu/histo2d_v3.py +++ b/src/babyyoda/grogu/histo2d_v3.py @@ -212,9 +212,8 @@ def to_string(self) -> str: ) edges = "" for i, edg in enumerate(self.d_edges): - edges += ( - f"Edges(A{i+1}): [{', '.join(f"{float(val):.6e}" for val in edg )}]\n" - ) + listed = ", ".join(f"{float(val):.6e}" for val in edg) + edges += f"Edges(A{i+1}): [{listed}]\n" legend = "# sumW \tsumW2 \tsumW(A1) \tsumW2(A1) \tsumW(A2) \tsumW2(A2) \tsumW(A1,A2) \tnumEntries\n" bin_data = "\n".join(b.to_string() for b in self.d_bins)