From 4803d41ed005ed6a5b1d7b468dae2ce0dfbadc03 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Sat, 27 Jan 2024 13:47:17 +0900 Subject: [PATCH] Fix PythonCall issue of not converting `np.str_` to `String` --- pysr/sr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pysr/sr.py b/pysr/sr.py index 41ee8e905..a9861ef33 100644 --- a/pysr/sr.py +++ b/pysr/sr.py @@ -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_),