Spaces:
Running
Running
MilesCranmer
commited on
Merge pull request #650 from MilesCranmer/deps-update
Browse files- .github/workflows/CI.yml +3 -9
- .github/workflows/CI_Windows.yml +5 -11
- .github/workflows/CI_docker.yml +6 -12
- .github/workflows/CI_mac.yml +4 -10
- pysr/export_jax.py +1 -0
- pysr/export_torch.py +4 -6
- pysr/sr.py +1 -7
- requirements.txt +1 -1
.github/workflows/CI.yml
CHANGED
@@ -5,20 +5,14 @@ on:
|
|
5 |
branches:
|
6 |
- '**'
|
7 |
paths:
|
8 |
-
- '
|
9 |
-
- 'pysr/**'
|
10 |
-
- '.github/workflows/CI.yml'
|
11 |
-
- 'setup.py'
|
12 |
tags:
|
13 |
- 'v*.*.*'
|
14 |
pull_request:
|
15 |
branches:
|
16 |
-
- '
|
17 |
paths:
|
18 |
-
- '
|
19 |
-
- 'pysr/**'
|
20 |
-
- '.github/workflows/CI.yml'
|
21 |
-
- 'setup.py'
|
22 |
|
23 |
jobs:
|
24 |
test:
|
|
|
5 |
branches:
|
6 |
- '**'
|
7 |
paths:
|
8 |
+
- '**'
|
|
|
|
|
|
|
9 |
tags:
|
10 |
- 'v*.*.*'
|
11 |
pull_request:
|
12 |
branches:
|
13 |
+
- 'master'
|
14 |
paths:
|
15 |
+
- '**'
|
|
|
|
|
|
|
16 |
|
17 |
jobs:
|
18 |
test:
|
.github/workflows/CI_Windows.yml
CHANGED
@@ -3,22 +3,16 @@ name: Windows
|
|
3 |
on:
|
4 |
push:
|
5 |
branches:
|
6 |
-
- '
|
7 |
paths:
|
8 |
-
- '
|
9 |
-
- 'pysr/**'
|
10 |
-
- '.github/workflows/CI_Windows.yml'
|
11 |
-
- 'setup.py'
|
12 |
tags:
|
13 |
- 'v*.*.*'
|
14 |
pull_request:
|
15 |
branches:
|
16 |
-
- '
|
17 |
paths:
|
18 |
-
- '
|
19 |
-
- 'pysr/**'
|
20 |
-
- '.github/workflows/CI_Windows.yml'
|
21 |
-
- 'setup.py'
|
22 |
|
23 |
jobs:
|
24 |
test:
|
@@ -52,7 +46,7 @@ jobs:
|
|
52 |
- name: "Install PySR"
|
53 |
run: |
|
54 |
python -m pip install --upgrade pip
|
55 |
-
pip install pytest nbval
|
56 |
pip install .
|
57 |
python -c 'import pysr'
|
58 |
- name: "Run tests"
|
|
|
3 |
on:
|
4 |
push:
|
5 |
branches:
|
6 |
+
- 'master'
|
7 |
paths:
|
8 |
+
- '**'
|
|
|
|
|
|
|
9 |
tags:
|
10 |
- 'v*.*.*'
|
11 |
pull_request:
|
12 |
branches:
|
13 |
+
- 'master'
|
14 |
paths:
|
15 |
+
- '**'
|
|
|
|
|
|
|
16 |
|
17 |
jobs:
|
18 |
test:
|
|
|
46 |
- name: "Install PySR"
|
47 |
run: |
|
48 |
python -m pip install --upgrade pip
|
49 |
+
pip install pytest nbval "numpy<2.0.0"
|
50 |
pip install .
|
51 |
python -c 'import pysr'
|
52 |
- name: "Run tests"
|
.github/workflows/CI_docker.yml
CHANGED
@@ -3,22 +3,16 @@ name: Docker
|
|
3 |
on:
|
4 |
push:
|
5 |
branches:
|
6 |
-
- '
|
7 |
paths:
|
8 |
-
- '
|
9 |
-
|
10 |
-
- '
|
11 |
-
- 'setup.py'
|
12 |
-
- 'Dockerfile'
|
13 |
pull_request:
|
14 |
branches:
|
15 |
-
- '
|
16 |
paths:
|
17 |
-
- '
|
18 |
-
- 'pysr/**'
|
19 |
-
- '.github/workflows/CI_docker.yml'
|
20 |
-
- 'setup.py'
|
21 |
-
- 'Dockerfile'
|
22 |
|
23 |
jobs:
|
24 |
test:
|
|
|
3 |
on:
|
4 |
push:
|
5 |
branches:
|
6 |
+
- 'master'
|
7 |
paths:
|
8 |
+
- '**'
|
9 |
+
tags:
|
10 |
+
- 'v*.*.*'
|
|
|
|
|
11 |
pull_request:
|
12 |
branches:
|
13 |
+
- 'master'
|
14 |
paths:
|
15 |
+
- '**'
|
|
|
|
|
|
|
|
|
16 |
|
17 |
jobs:
|
18 |
test:
|
.github/workflows/CI_mac.yml
CHANGED
@@ -3,22 +3,16 @@ name: macOS
|
|
3 |
on:
|
4 |
push:
|
5 |
branches:
|
6 |
-
- '
|
7 |
paths:
|
8 |
-
- '
|
9 |
-
- 'pysr/**'
|
10 |
-
- '.github/workflows/CI_mac.yml'
|
11 |
-
- 'setup.py'
|
12 |
tags:
|
13 |
- 'v*.*.*'
|
14 |
pull_request:
|
15 |
branches:
|
16 |
-
- '
|
17 |
paths:
|
18 |
-
- '
|
19 |
-
- 'pysr/**'
|
20 |
-
- '.github/workflows/CI_mac.yml'
|
21 |
-
- 'setup.py'
|
22 |
|
23 |
jobs:
|
24 |
test:
|
|
|
3 |
on:
|
4 |
push:
|
5 |
branches:
|
6 |
+
- 'master'
|
7 |
paths:
|
8 |
+
- '**'
|
|
|
|
|
|
|
9 |
tags:
|
10 |
- 'v*.*.*'
|
11 |
pull_request:
|
12 |
branches:
|
13 |
+
- 'master'
|
14 |
paths:
|
15 |
+
- '**'
|
|
|
|
|
|
|
16 |
|
17 |
jobs:
|
18 |
test:
|
pysr/export_jax.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import sympy
|
2 |
|
3 |
# Special since need to reduce arguments.
|
|
|
1 |
+
import numpy as np # noqa: F401
|
2 |
import sympy
|
3 |
|
4 |
# Special since need to reduce arguments.
|
pysr/export_torch.py
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
-
|
2 |
-
# From https://github.com/patrick-kidger/sympytorch
|
3 |
-
# Copied here to allow PySR-specific tweaks
|
4 |
-
#####
|
5 |
|
6 |
import collections as co
|
7 |
import functools as ft
|
8 |
|
|
|
9 |
import sympy
|
10 |
|
11 |
|
@@ -84,7 +82,7 @@ def _initialize_torch():
|
|
84 |
}
|
85 |
|
86 |
class _Node(torch.nn.Module):
|
87 |
-
"""
|
88 |
|
89 |
def __init__(self, *, expr, _memodict, _func_lookup, **kwargs):
|
90 |
super().__init__(**kwargs)
|
@@ -161,7 +159,7 @@ def _initialize_torch():
|
|
161 |
return self._torch_func(*args)
|
162 |
|
163 |
class _SingleSymPyModule(torch.nn.Module):
|
164 |
-
"""
|
165 |
|
166 |
def __init__(
|
167 |
self, expression, symbols_in, selection=None, extra_funcs=None, **kwargs
|
|
|
1 |
+
# Fork of https://github.com/patrick-kidger/sympytorch
|
|
|
|
|
|
|
2 |
|
3 |
import collections as co
|
4 |
import functools as ft
|
5 |
|
6 |
+
import numpy as np # noqa: F401
|
7 |
import sympy
|
8 |
|
9 |
|
|
|
82 |
}
|
83 |
|
84 |
class _Node(torch.nn.Module):
|
85 |
+
"""Forked from https://github.com/patrick-kidger/sympytorch"""
|
86 |
|
87 |
def __init__(self, *, expr, _memodict, _func_lookup, **kwargs):
|
88 |
super().__init__(**kwargs)
|
|
|
159 |
return self._torch_func(*args)
|
160 |
|
161 |
class _SingleSymPyModule(torch.nn.Module):
|
162 |
+
"""Forked from https://github.com/patrick-kidger/sympytorch"""
|
163 |
|
164 |
def __init__(
|
165 |
self, expression, symbols_in, selection=None, extra_funcs=None, **kwargs
|
pysr/sr.py
CHANGED
@@ -2060,13 +2060,7 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
|
|
2060 |
"Note: you are running with 10 features or more. "
|
2061 |
"Genetic algorithms like used in PySR scale poorly with large numbers of features. "
|
2062 |
"You should run PySR for more `niterations` to ensure it can find "
|
2063 |
-
"the correct variables, "
|
2064 |
-
"or, alternatively, do a dimensionality reduction beforehand. "
|
2065 |
-
"For example, `X = PCA(n_components=6).fit_transform(X)`, "
|
2066 |
-
"using scikit-learn's `PCA` class, "
|
2067 |
-
"will reduce the number of features to 6 in an interpretable way, "
|
2068 |
-
"as each resultant feature "
|
2069 |
-
"will be a linear combination of the original features. "
|
2070 |
)
|
2071 |
|
2072 |
# Assertion checks
|
|
|
2060 |
"Note: you are running with 10 features or more. "
|
2061 |
"Genetic algorithms like used in PySR scale poorly with large numbers of features. "
|
2062 |
"You should run PySR for more `niterations` to ensure it can find "
|
2063 |
+
"the correct variables, and consider using a larger `maxsize`."
|
|
|
|
|
|
|
|
|
|
|
|
|
2064 |
)
|
2065 |
|
2066 |
# Assertion checks
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
sympy>=1.0.0,<2.0.0
|
2 |
pandas>=0.21.0,<3.0.0
|
3 |
-
numpy>=1.13.0,<
|
4 |
scikit_learn>=1.0.0,<2.0.0
|
5 |
juliacall==0.9.20
|
6 |
click>=7.0.0,<9.0.0
|
|
|
1 |
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
|