Skip to content

Commit 3dc8897

Browse files
committed
Update
1 parent 41dcd23 commit 3dc8897

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
python -m pip install numpy sympy scipy matplotlib deap pmlb scikit-learn requests pandas
31-
python -m pip install flake8 pytest pytest-xdist
31+
python -m pip install flake8 pytest pytest-xdist pytest-timeout
3232
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3333
- name: Lint with flake8
3434
run: |
@@ -38,4 +38,4 @@ jobs:
3838
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3939
- name: Test with pytest
4040
run: |
41-
pytest -v -n auto
41+
pytest -v -n auto --timeout 600

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ It is possible to export results to CSV file with ```csv_filename```.
2424

2525
For more information, see existing tests.
2626
```pytest -v```
27-
If pytest-xdist is installed:
28-
```pytest -v -n auto```
27+
If ```pytest-xdist``` and ```pytest-timeout``` is installed:
28+
```pytest -v -n auto --timeout 600```

tests/test_ode-strogatz.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ def test_d_lv1():
284284
binary_operators = {"*": (operator.mul, operator.mul),
285285
"+": (operator.add, operator.add)},
286286
operator_depth = {"*": 3, "+": 3},
287+
discrete_param_values = ["(-3, 3)"],
287288
#callback = callback,
288289
#monothread = True,
289290
foundBreak = True)
@@ -312,6 +313,7 @@ def test_d_lv2():
312313
binary_operators = {"*": (operator.mul, operator.mul),
313314
"+": (operator.add, operator.add)},
314315
operator_depth = {"*": 3, "+": 3},
316+
discrete_param_values = ["(-2, 2)"],
315317
#callback = callback,
316318
#monothread = True,
317319
foundBreak = True)

tests/test_sr.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,11 @@ def test_x1_add_x2():
195195

196196
assert(len(model.bestExpressions) == 1)
197197
assert(model.bestExpressions[0][0] == sympy.sympify("x1+x2"))
198-
"""
198+
199199
def test_x1_2_add_x2_2_sub_x1_mul_x2():
200200
model = sr.SR(niterations = 3,
201201
binary_operators = {"*": (operator.mul, operator.mul),
202202
"+": (operator.add, operator.add)},
203-
discrete_param_values = ["(-1, 1)"],
204203
foundBreak = True)
205204

206205
n = 10
@@ -213,7 +212,7 @@ def test_x1_2_add_x2_2_sub_x1_mul_x2():
213212

214213
assert(len(model.bestExpressions) == 1)
215214
assert(sr.expr_eq(sympy.expand(model.bestExpressions[0][0]), sympy.expand(sympy.sympify("(x1-x2)**2+x1*x2"))))
216-
"""
215+
217216
def test_a_mul_x1_add_b():
218217
model = sr.SR(niterations = 3,
219218
binary_operators = {"+": (operator.add, operator.add)},
@@ -261,7 +260,7 @@ def test_pysr():
261260
binary_operators = {"+": (operator.add, operator.add),
262261
"*": (operator.mul, operator.mul)},
263262
operator_depth = {"cos": 1},
264-
discrete_param_values = [0, 1, -0.5, 2.5382],
263+
#discrete_param_values = [0, 1, -0.5, 2.5382],
265264
foundBreak = True,
266265
eps = 1e-6)
267266

@@ -384,7 +383,7 @@ def test_plane():
384383
model.fit([x, y, z], np.zeros(len(x)), ["x", "y", "z"])
385384

386385
assert(sr.sym_expr_eq(model.bestExpressions[0][0], sympy.sympify("a * x + b * y + c * z + d"), sympy.symbols("x y z")))
387-
"""
386+
388387
def test_sphere():
389388
p0 = 10 * np.random.rand(3) - 5 * np.ones(3)
390389
p0 = np.array([1., 2., 3.])
@@ -418,7 +417,7 @@ def test_sphere():
418417

419418
assert(len(model.bestExpressions) >= 1)
420419
assert(sr.sym_expr_eq(model.bestExpressions[0][0], sympy.sympify("a * ((x - x0) ** 2 + (y - y0) ** 2 + (z - z0) ** 2 - R ** 2)"), sympy.symbols("x y z")))
421-
"""
420+
422421
def test_gplearn():
423422
from sklearn.utils.random import check_random_state
424423

@@ -499,7 +498,6 @@ def test_3():
499498
foundBreak = True,
500499
#verbose = True,
501500
)
502-
#Ajouter du code pour ordonner les tâches des moins complexes aux plus complexes
503501

504502
n = 100
505503
xmin = -5

0 commit comments

Comments
 (0)