Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
e644737
1
Parent(s):
b4abede
Simplify julia options checking
Browse files- pysr/julia_helpers.py +11 -13
pysr/julia_helpers.py
CHANGED
@@ -190,19 +190,17 @@ def init_julia(julia_project=None, quiet=False, julia_kwargs=None):
|
|
190 |
|
191 |
if julia_initialized and julia_kwargs_at_initialization is not None:
|
192 |
# Check if the kwargs are the same as the previous initialization
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
+ " will be ignored."
|
205 |
-
)
|
206 |
|
207 |
if julia_initialized:
|
208 |
Main.eval("using Pkg")
|
|
|
190 |
|
191 |
if julia_initialized and julia_kwargs_at_initialization is not None:
|
192 |
# Check if the kwargs are the same as the previous initialization
|
193 |
+
init_set = set(julia_kwargs_at_initialization.items())
|
194 |
+
new_set = set(julia_kwargs.items())
|
195 |
+
set_diff = new_set - init_set
|
196 |
+
# Remove the `compiled_modules` key, since it is not a user-specified kwarg:
|
197 |
+
set_diff = {k: v for k, v in set_diff if k != "compiled_modules"}
|
198 |
+
if len(set_diff) > 0:
|
199 |
+
warnings.warn(
|
200 |
+
"Julia has already started. The new Julia options "
|
201 |
+
+ str(set_diff)
|
202 |
+
+ " will be ignored."
|
203 |
+
)
|
|
|
|
|
204 |
|
205 |
if julia_initialized:
|
206 |
Main.eval("using Pkg")
|