Skip to content

Commit

Permalink
not double format
Browse files Browse the repository at this point in the history
  • Loading branch information
APN-Pucky committed Oct 15, 2024
1 parent 14f8671 commit 62a65fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/babyyoda/grogu/histo1d_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
5 changes: 2 additions & 3 deletions src/babyyoda/grogu/histo2d_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 62a65fd

Please sign in to comment.