euler314 commited on
Commit
5be6912
·
verified ·
1 Parent(s): df770a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -140,6 +140,9 @@ def compute_custom_expression(betas, z_a, y, s_num_expr, s_denom_expr):
140
  s_func = sp.lambdify((beta_sym, z_a_sym, y_sym), s_expr, modules=["numpy"])
141
  with np.errstate(divide='ignore', invalid='ignore'):
142
  result = s_func(betas, z_a, y)
 
 
 
143
  return result
144
 
145
  def generate_z_vs_beta_plot(z_a, y, z_min, z_max, beta_steps, z_steps,
 
140
  s_func = sp.lambdify((beta_sym, z_a_sym, y_sym), s_expr, modules=["numpy"])
141
  with np.errstate(divide='ignore', invalid='ignore'):
142
  result = s_func(betas, z_a, y)
143
+ # Ensure result is a numpy array
144
+ if np.isscalar(result):
145
+ result = np.full_like(betas, result)
146
  return result
147
 
148
  def generate_z_vs_beta_plot(z_a, y, z_min, z_max, beta_steps, z_steps,