From 958f6cb777739330ff27b0a26bdf734c88b08a7b Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Wed, 23 Oct 2024 00:46:22 -0400
Subject: [PATCH] insert_*: use maxfev=10000

---
 benchmarks/insert_muon/analysis/muon_plots.py       | 2 +-
 benchmarks/insert_neutron/analysis/neutron_plots.py | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/benchmarks/insert_muon/analysis/muon_plots.py b/benchmarks/insert_muon/analysis/muon_plots.py
index 5c81b52d..ac2aa100 100644
--- a/benchmarks/insert_muon/analysis/muon_plots.py
+++ b/benchmarks/insert_muon/analysis/muon_plots.py
@@ -55,7 +55,7 @@ for p in 50,:
     p0=[100, .5, .05]
     #print(list(y), list(x))
     coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0,
-                                 sigma=list(np.sqrt(y[slc])+(y[slc]==0)))
+                                 sigma=list(np.sqrt(y[slc])+(y[slc]==0)), maxfev=10000)
     print(coeff)
     xx=np.linspace(0,.7, 100)
     MIP=coeff[1]/1000
diff --git a/benchmarks/insert_neutron/analysis/neutron_plots.py b/benchmarks/insert_neutron/analysis/neutron_plots.py
index b9d2002a..424295cf 100644
--- a/benchmarks/insert_neutron/analysis/neutron_plots.py
+++ b/benchmarks/insert_neutron/analysis/neutron_plots.py
@@ -79,7 +79,7 @@ slc=abs(bc)<3
 fnc=gauss
 sigma=np.sqrt(y[slc])+(y[slc]==0)
 p0=(100, 0, 5)
-coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0,sigma=list(sigma))
+coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
 xx=np.linspace(-5,5,100)
 plt.plot(xx,fnc(xx,*coeff))
 # except:
@@ -104,7 +104,7 @@ for eta_min, eta_max in zip(r[:-1],r[1:]):
         #print(bc[slc],y[slc])
         sigma=np.sqrt(y[slc])+(y[slc]==0)
         try:
-            coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0,sigma=list(sigma))
+            coeff, var_matrix = curve_fit(fnc, list(bc[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
             sigmas.append(np.abs(coeff[2]))
             dsigmas.append(np.sqrt(var_matrix[2][2]))
             xvals.append(p)
@@ -151,7 +151,7 @@ for p in 20, 30,40,50,60,70, 80:
         sigma=np.sqrt(y[slc])+0.5*(y[slc]==0)
         p0=(100, np.mean(r), np.std(r))
         try:
-            coeff, var_matrix = curve_fit(fnc, list(bcs[slc]), list(y[slc]), p0=p0,sigma=list(sigma))
+            coeff, var_matrix = curve_fit(fnc, list(bcs[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
             res=np.abs(coeff[2]/coeff[1])
             
             if res<best_res:
@@ -234,7 +234,7 @@ for eta_min, eta_max in zip(partitions[:-1],partitions[1:]):
         sigma=np.sqrt(y[slc])+0.5*(y[slc]==0)
         p0=(100, np.mean(r), np.std(r))
         try:
-            coeff, var_matrix = curve_fit(fnc, list(bcs[slc]), list(y[slc]), p0=p0,sigma=list(sigma))
+            coeff, var_matrix = curve_fit(fnc, list(bcs[slc]), list(y[slc]), p0=p0, sigma=list(sigma), maxfev=10000)
             res=np.abs(coeff[2]/coeff[1])
 
             if res<best_res:
-- 
GitLab