marcodsn commited on
Commit
bdd6ccc
·
1 Parent(s): 4cf14cc

Added function docstring

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -16,6 +16,14 @@ import gradio as gr
16
  import numexpr
17
 
18
  def safe_math_eval(expression: str) -> float:
 
 
 
 
 
 
 
 
19
  try:
20
  return numexpr.evaluate(expression).item()
21
  except Exception as e:
 
16
  import numexpr
17
 
18
  def safe_math_eval(expression: str) -> float:
19
+ """Safely evaluate a mathematical formula
20
+
21
+ Args:
22
+ expression: The nunexpr formatted expression to evaluate
23
+
24
+ Returns:
25
+ The result of the evaluation
26
+ """
27
  try:
28
  return numexpr.evaluate(expression).item()
29
  except Exception as e: