C2MV commited on
Commit
be4582c
1 Parent(s): 0496f09

Update interface.py

Browse files
Files changed (1) hide show
  1. interface.py +4 -11
interface.py CHANGED
@@ -3,13 +3,11 @@
3
  import numpy as np
4
  import pandas as pd
5
  import matplotlib.pyplot as plt
6
- from scipy.optimize import curve_fit
7
  from PIL import Image
8
  import io
9
- from sympy import symbols, lambdify, sympify, Function
10
 
11
  from bioprocess_model import BioprocessModel
12
- from decorators import gpu_decorator # Importar el decorador personalizado
13
 
14
  def parse_bounds(bounds_str, num_params):
15
  try:
@@ -103,7 +101,7 @@ def process_and_plot(
103
  bounds_str = biomass_bounds[i]
104
 
105
  try:
106
- main_model.set_model('biomass', equation, params_str)
107
  except ValueError as ve:
108
  raise ValueError(f"Error en la configuración del modelo de biomasa {i+1}: {ve}")
109
 
@@ -124,11 +122,6 @@ def process_and_plot(
124
  except Exception as e:
125
  raise RuntimeError(f"Error al ajustar el modelo de biomasa {i+1}: {e}")
126
 
127
- # Usa el primer modelo de biomasa para X(t)
128
- biomass_model = biomass_results[0]['model']
129
- biomass_func = biomass_model.models['biomass']['function']
130
- biomass_params_values = list(biomass_model.params['biomass'].values())
131
-
132
  # Ajusta los modelos de Sustrato
133
  for i in range(len(substrate_eqs)):
134
  equation = substrate_eqs[i]
@@ -136,7 +129,7 @@ def process_and_plot(
136
  bounds_str = substrate_bounds[i]
137
 
138
  try:
139
- main_model.set_model('substrate', equation, params_str)
140
  except ValueError as ve:
141
  raise ValueError(f"Error en la configuración del modelo de sustrato {i+1}: {ve}")
142
 
@@ -164,7 +157,7 @@ def process_and_plot(
164
  bounds_str = product_bounds[i]
165
 
166
  try:
167
- main_model.set_model('product', equation, params_str)
168
  except ValueError as ve:
169
  raise ValueError(f"Error en la configuración del modelo de producto {i+1}: {ve}")
170
 
 
3
  import numpy as np
4
  import pandas as pd
5
  import matplotlib.pyplot as plt
 
6
  from PIL import Image
7
  import io
 
8
 
9
  from bioprocess_model import BioprocessModel
10
+ from decorators import gpu_decorator # Asegúrate de que la ruta es correcta
11
 
12
  def parse_bounds(bounds_str, num_params):
13
  try:
 
101
  bounds_str = biomass_bounds[i]
102
 
103
  try:
104
+ main_model.set_model_biomass(equation, params_str)
105
  except ValueError as ve:
106
  raise ValueError(f"Error en la configuración del modelo de biomasa {i+1}: {ve}")
107
 
 
122
  except Exception as e:
123
  raise RuntimeError(f"Error al ajustar el modelo de biomasa {i+1}: {e}")
124
 
 
 
 
 
 
125
  # Ajusta los modelos de Sustrato
126
  for i in range(len(substrate_eqs)):
127
  equation = substrate_eqs[i]
 
129
  bounds_str = substrate_bounds[i]
130
 
131
  try:
132
+ main_model.set_model_substrate(equation, params_str)
133
  except ValueError as ve:
134
  raise ValueError(f"Error en la configuración del modelo de sustrato {i+1}: {ve}")
135
 
 
157
  bounds_str = product_bounds[i]
158
 
159
  try:
160
+ main_model.set_model_product(equation, params_str)
161
  except ValueError as ve:
162
  raise ValueError(f"Error en la configuración del modelo de producto {i+1}: {ve}")
163