Spaces:
Running
Running
MilesCranmer
commited on
Commit
·
d3026af
1
Parent(s):
b521bff
Only print conflicting library warning if Julia not initialized
Browse files- pysr/julia_helpers.py +8 -1
pysr/julia_helpers.py
CHANGED
@@ -6,6 +6,8 @@ import os
|
|
6 |
|
7 |
from .version import __version__, __symbolic_regression_jl_version__
|
8 |
|
|
|
|
|
9 |
|
10 |
def install(julia_project=None, quiet=False): # pragma: no cover
|
11 |
"""
|
@@ -101,7 +103,11 @@ def check_for_conflicting_libraries(): # pragma: no cover
|
|
101 |
|
102 |
def init_julia(julia_project=None):
|
103 |
"""Initialize julia binary, turning off compiled modules if needed."""
|
104 |
-
|
|
|
|
|
|
|
|
|
105 |
from julia.core import JuliaInfo, UnsupportedPythonError
|
106 |
|
107 |
julia_project, is_shared = _get_julia_project(julia_project)
|
@@ -135,6 +141,7 @@ def init_julia(julia_project=None):
|
|
135 |
|
136 |
Main = _Main
|
137 |
|
|
|
138 |
return Main
|
139 |
|
140 |
|
|
|
6 |
|
7 |
from .version import __version__, __symbolic_regression_jl_version__
|
8 |
|
9 |
+
julia_initialized = False
|
10 |
+
|
11 |
|
12 |
def install(julia_project=None, quiet=False): # pragma: no cover
|
13 |
"""
|
|
|
103 |
|
104 |
def init_julia(julia_project=None):
|
105 |
"""Initialize julia binary, turning off compiled modules if needed."""
|
106 |
+
global julia_initialized
|
107 |
+
|
108 |
+
if not julia_initialized:
|
109 |
+
check_for_conflicting_libraries()
|
110 |
+
|
111 |
from julia.core import JuliaInfo, UnsupportedPythonError
|
112 |
|
113 |
julia_project, is_shared = _get_julia_project(julia_project)
|
|
|
141 |
|
142 |
Main = _Main
|
143 |
|
144 |
+
julia_initialized = True
|
145 |
return Main
|
146 |
|
147 |
|