MilesCranmer commited on
Commit
546ea43
1 Parent(s): 81ba2f3

Only preprocess floats if given string

Browse files
Files changed (1) hide show
  1. pysr/sr.py +5 -1
pysr/sr.py CHANGED
@@ -2355,4 +2355,8 @@ _apply_regexp_sci = lambda x: _regexp_sci.sub(r"\1e\2", x)
2355
 
2356
 
2357
  def _preprocess_julia_floats(s: str) -> str:
2358
- return _apply_regexp_sci(_apply_regexp_im_sci(_apply_regexp_im(s)))
 
 
 
 
 
2355
 
2356
 
2357
  def _preprocess_julia_floats(s: str) -> str:
2358
+ if isinstance(s, str):
2359
+ s = _apply_regexp_im(s)
2360
+ s = _apply_regexp_im_sci(s)
2361
+ s = _apply_regexp_sci(s)
2362
+ return s