Skip to content

Commit

Permalink
Fix PythonCall issue of not converting np.str_ to String
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Jan 27, 2024
1 parent 3bcbc49 commit 4803d41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pysr/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1732,8 +1732,10 @@ def _run(self, X, y, mutated_params, weights, seed):
jl_y,
weights=jl_weights,
niterations=int(self.niterations),
variable_names=jl_array(self.feature_names_in_.tolist()),
display_variable_names=jl_array(self.display_feature_names_in_.tolist()),
variable_names=jl_array([str(v) for v in self.feature_names_in_]),
display_variable_names=jl_array(
[str(v) for v in self.display_feature_names_in_]
),
y_variable_names=jl_y_variable_names,
X_units=jl_array(self.X_units_),
y_units=jl_array(self.y_units_),
Expand Down

0 comments on commit 4803d41

Please sign in to comment.