MilesCranmer commited on
Commit
a6bed2c
1 Parent(s): b8a97f1

Fix bug with inplace editing of equation_file_contents_

Browse files
Files changed (1) hide show
  1. pysr/sr.py +4 -1
pysr/sr.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import os
2
  import sys
3
  import numpy as np
@@ -1928,7 +1929,9 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
1928
 
1929
  ret_outputs = []
1930
 
1931
- for output in self.equation_file_contents_:
 
 
1932
 
1933
  scores = []
1934
  lastMSE = None
 
1
+ import copy
2
  import os
3
  import sys
4
  import numpy as np
 
1929
 
1930
  ret_outputs = []
1931
 
1932
+ equation_file_contents = copy.deepcopy(self.equation_file_contents_)
1933
+
1934
+ for output in equation_file_contents:
1935
 
1936
  scores = []
1937
  lastMSE = None