From 8147b5227c7401205dc214be5728b9bf69cec025 Mon Sep 17 00:00:00 2001 From: gituser789 <62549000+gituser789@users.noreply.github.com> Date: Tue, 4 Aug 2026 09:28:09 +0200 Subject: [PATCH] avoid runtime warning during curve fit --- materialdatabase/processing/utils/empirical.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/materialdatabase/processing/utils/empirical.py b/materialdatabase/processing/utils/empirical.py index b7cc1ec..52951d1 100644 --- a/materialdatabase/processing/utils/empirical.py +++ b/materialdatabase/processing/utils/empirical.py @@ -133,7 +133,11 @@ def log_enhanced_steinmetz_qT(fTb: tuple[float | np.ndarray, float | np.ndarray, :param c_2: Quadratic temperature coefficient :return: Logarithm of power loss density """ - return np.log(enhanced_steinmetz_qT(fTb, alpha, beta, k_b, k_f, k_alpha2, c_0, c_1, c_2)) + # avoid RunTime Warning during the scipy curve fit operation + with np.errstate(invalid='ignore'): + steinmetz_result = np.log(enhanced_steinmetz_qT(fTb, alpha, beta, k_b, k_f, k_alpha2, c_0, c_1, c_2)) + + return steinmetz_result def fit_mu_abs_TDK_MDT(