MilesCranmer commited on
Commit
e644737
1 Parent(s): b4abede

Simplify julia options checking

Browse files
Files changed (1) hide show
  1. 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
- if julia_kwargs_at_initialization != julia_kwargs:
194
- # Record different kwargs:
195
- init_set = set(julia_kwargs_at_initialization.items())
196
- new_set = set(julia_kwargs.items())
197
- set_diff = new_set - init_set
198
- # Remove the `compiled_modules` key, since it is not a user-specified kwarg:
199
- set_diff = {k: v for k, v in set_diff if k != "compiled_modules"}
200
- if len(set_diff) > 0:
201
- warnings.warn(
202
- "Julia has already started. The new Julia options "
203
- + str(set_diff)
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")