C2MV commited on
Commit
333a57d
1 Parent(s): 706a649

Update interface.py

Browse files
Files changed (1) hide show
  1. interface.py +6 -8
interface.py CHANGED
@@ -164,18 +164,16 @@ class BioprocessModel:
164
  print(f"Fitting {model_type} model with function: {func} and parameters: {params}")
165
 
166
  # Define the fitting function based on model type
167
- if model_type == 'biomass':
168
- def fit_func(t, *args):
169
- return func(t, *args)
170
- else:
171
- def fit_func(t, *args):
172
- return func(t, *args)
173
 
174
  # Depuración: Verificar el número de parámetros que se espera ajustar
175
  print(f"Number of parameters to fit: {len(params)}")
176
-
177
  try:
178
- # Ajustar el modelo usando curve_fit
179
  popt, _ = curve_fit(fit_func, time, data, bounds=bounds, maxfev=10000)
180
  print(f"Optimal parameters found: {popt}")
181
 
 
164
  print(f"Fitting {model_type} model with function: {func} and parameters: {params}")
165
 
166
  # Define the fitting function based on model type
167
+ def fit_func(t, *args):
168
+ # Asegurarse de que se pasa el número correcto de parámetros
169
+ print(f"Calling fit_func with args: {args}")
170
+ return func(t, *args)
 
 
171
 
172
  # Depuración: Verificar el número de parámetros que se espera ajustar
173
  print(f"Number of parameters to fit: {len(params)}")
174
+
175
  try:
176
+ # Intentar ajustar el modelo usando curve_fit
177
  popt, _ = curve_fit(fit_func, time, data, bounds=bounds, maxfev=10000)
178
  print(f"Optimal parameters found: {popt}")
179