From 85098d20089d73bbe4b834b95ce2fc4da76063ca Mon Sep 17 00:00:00 2001 From: AliceMazzoleni99 Date: Fri, 10 Apr 2026 17:46:01 +0200 Subject: [PATCH] fixed fmt error (#302) --- include/aare/Interpolator.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/aare/Interpolator.hpp b/include/aare/Interpolator.hpp index b9b00bf..548aa91 100644 --- a/include/aare/Interpolator.hpp +++ b/include/aare/Interpolator.hpp @@ -171,11 +171,14 @@ Coordinate2D Interpolator::transform_eta_values(const Eta2 &eta) const { if (static_cast(ix) >= m_etabinsx.size() - 1 || static_cast(iy) >= m_etabinsy.size() - 1 || - static_cast(ie) >= m_energy_bins.size() - 1) - throw std::runtime_error( - fmt::format("Eta values out of bounds of eta distribution: eta.x = " - "{:.4f}, eta.y = {:.4f}, energy = {:.4f}", - eta.x, eta.y, eta.sum)); + static_cast(ie) >= m_energy_bins.size() - 1) { + throw std::runtime_error(fmt::format( + "Eta values (eta.x = {:4f}, eta.y = {:4f}, energy = {}) out of " + "bounds of eta distribution with largest values: (eta.x = {:4f}, " + "eta.y = {:4f}, energy = {:4f})", + eta.x, eta.y, eta.sum, *(m_etabinsx.end() - 1), + *(m_etabinsy.end() - 1), *(m_energy_bins.end() - 1))); + } // TODO: bilinear interpolation only works if all bins have a size > 1 - // otherwise bilinear interpolation with zero values which skew the