MilesCranmer commited on
Commit
b4abede
1 Parent(s): 4300bea

Only print `set_diff` if has contents

Browse files
Files changed (1) hide show
  1. pysr/julia_helpers.py +6 -5
pysr/julia_helpers.py CHANGED
@@ -197,11 +197,12 @@ def init_julia(julia_project=None, quiet=False, julia_kwargs=None):
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
- warnings.warn(
201
- "Julia has already started. The new Julia options "
202
- + str(set_diff)
203
- + " will be ignored."
204
- )
 
205
 
206
  if julia_initialized:
207
  Main.eval("using Pkg")
 
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")