Spaces:
Running
Running
build: make `juliapkg` operate dynamically rather than with json file
Browse files- pysr/julia_import.py +10 -0
- pysr/juliapkg.json +0 -13
- requirements.txt +1 -0
pysr/julia_import.py
CHANGED
|
@@ -4,6 +4,8 @@ import warnings
|
|
| 4 |
from types import ModuleType
|
| 5 |
from typing import cast
|
| 6 |
|
|
|
|
|
|
|
| 7 |
# Check if JuliaCall is already loaded, and if so, warn the user
|
| 8 |
# about the relevant environment variables. If not loaded,
|
| 9 |
# set up sensible defaults.
|
|
@@ -36,6 +38,14 @@ else:
|
|
| 36 |
):
|
| 37 |
os.environ[k] = os.environ.get(k, default)
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
autoload_extensions = os.environ.get("PYSR_AUTOLOAD_EXTENSIONS")
|
| 41 |
if autoload_extensions is not None:
|
|
|
|
| 4 |
from types import ModuleType
|
| 5 |
from typing import cast
|
| 6 |
|
| 7 |
+
import juliapkg
|
| 8 |
+
|
| 9 |
# Check if JuliaCall is already loaded, and if so, warn the user
|
| 10 |
# about the relevant environment variables. If not loaded,
|
| 11 |
# set up sensible defaults.
|
|
|
|
| 38 |
):
|
| 39 |
os.environ[k] = os.environ.get(k, default)
|
| 40 |
|
| 41 |
+
juliapkg.require_julia("~1.6.7, ~1.7, ~1.8, ~1.9, =1.10.0, ^1.10.3")
|
| 42 |
+
juliapkg.add(
|
| 43 |
+
"SymbolicRegression",
|
| 44 |
+
"8254be44-1295-4e6a-a16d-46603ac705cb",
|
| 45 |
+
version="=0.24.5",
|
| 46 |
+
)
|
| 47 |
+
juliapkg.add("Serialization", "9e88b42a-f829-5b0c-bbe9-9e923198166b", version="1")
|
| 48 |
+
|
| 49 |
|
| 50 |
autoload_extensions = os.environ.get("PYSR_AUTOLOAD_EXTENSIONS")
|
| 51 |
if autoload_extensions is not None:
|
pysr/juliapkg.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"julia": "~1.6.7, ~1.7, ~1.8, ~1.9, =1.10.0, ^1.10.3",
|
| 3 |
-
"packages": {
|
| 4 |
-
"SymbolicRegression": {
|
| 5 |
-
"uuid": "8254be44-1295-4e6a-a16d-46603ac705cb",
|
| 6 |
-
"version": "=0.24.5"
|
| 7 |
-
},
|
| 8 |
-
"Serialization": {
|
| 9 |
-
"uuid": "9e88b42a-f829-5b0c-bbe9-9e923198166b",
|
| 10 |
-
"version": "1"
|
| 11 |
-
}
|
| 12 |
-
}
|
| 13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -2,6 +2,7 @@ sympy>=1.0.0,<2.0.0
|
|
| 2 |
pandas>=0.21.0,<3.0.0
|
| 3 |
numpy>=1.13.0,<3.0.0
|
| 4 |
scikit_learn>=1.0.0,<2.0.0
|
|
|
|
| 5 |
juliacall==0.9.20
|
| 6 |
click>=7.0.0,<9.0.0
|
| 7 |
setuptools>=50.0.0
|
|
|
|
| 2 |
pandas>=0.21.0,<3.0.0
|
| 3 |
numpy>=1.13.0,<3.0.0
|
| 4 |
scikit_learn>=1.0.0,<2.0.0
|
| 5 |
+
juliapkg==0.1.13
|
| 6 |
juliacall==0.9.20
|
| 7 |
click>=7.0.0,<9.0.0
|
| 8 |
setuptools>=50.0.0
|