Skip to content

Commit 840a3d9

Browse files
nils-braunMaxBenChrist
authored andcommitted
Speed up tests (blue-yonder#308)
* Speed up tests by using less statistics * Only run full tests on master (not on PRs) * Check for master * better use if here * As we run everything with the if, we only have to do one stage * Changed the role of one of the tests * Do not check examples for coverage * Enable full build on PRs * Only use one line for the command * Simplify condition
1 parent ae682ba commit 840a3d9

File tree

5 files changed

+11
-29
lines changed

5 files changed

+11
-29
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ omit = tsfresh/utilities/profiling.py
1111
tsfresh/convenience/__init__.py
1212
tsfresh/examples/har_dataset.py
1313
tsfresh/examples/robot_execution_failures.py
14+
tsfresh/examples/driftbif_simulation.py
1415
tsfresh/examples/test_tsfresh_baseline_dataset.py
1516
tsfresh/scripts/test_timing.py
1617

.travis.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,18 @@ install:
1414
- pip freeze
1515
jobs:
1616
include:
17-
- stage: prepare cache
18-
script: true
19-
python: 2.7.11
20-
- stage: prepare cache
21-
script: true
22-
python: 3.5.2
23-
24-
- stage: Run unit tests
25-
script: py.test tests/units -n 2
26-
python: 2.7.11
27-
- stage: Run unit tests
28-
script: py.test tests/units -n 2
29-
python: 3.5.2
30-
31-
- stage: Run the full test suite
32-
script:
17+
- stage: Run unit tests and deploy
18+
script:
3319
- sed -i 's/\-n auto/\-n 2/g' setup.cfg
34-
- python setup.py test
20+
- "if [ $TRAVIS_PULL_REQUEST == false ] && ! [ $TRAVIS_BRANCH == 'master']; then py.test tests/units -n2; else python setup.py test; fi"
3521
python: 2.7.11
3622
after_success:
3723
- coveralls
38-
- stage: Run the full test suite
24+
- stage: Run unit tests and deploy
3925
script:
4026
- sed -i 's/\-n auto/\-n 2/g' setup.cfg
41-
- python setup.py test
27+
- "if [ $TRAVIS_PULL_REQUEST == false ] && ! [ $TRAVIS_BRANCH == 'master']; then py.test tests/units -n2; else python setup.py test; fi"
4228
python: 3.5.2
43-
44-
- stage: Deploy to pipy
45-
script: skip
4629
deploy:
4730
provider: pypi
4831
user: MaxChrist

tests/units/feature_extraction/test_feature_calculations.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,13 @@ def test_estimate_friedrich_coefficients(self):
777777

778778
# active Brownian motion
779779
ds = velocity(tau=3.8, delta_t=0.05, R=3e-4, seed=0)
780-
v = ds.simulate(1000000, v0=np.zeros(1))
780+
v = ds.simulate(10000, v0=np.zeros(1))
781781
coeff = _estimate_friedrich_coefficients(v[:, 0], **default_params)
782782
self.assertTrue(abs(coeff[-1]) < 0.0001)
783783

784784
# Brownian motion
785785
ds = velocity(tau=2.0 / 0.3 - 3.8, delta_t=0.05, R=3e-4, seed=0)
786-
v = ds.simulate(1000000, v0=np.zeros(1))
786+
v = ds.simulate(10000, v0=np.zeros(1))
787787
coeff = _estimate_friedrich_coefficients(v[:, 0], **default_params)
788788
self.assertTrue(abs(coeff[-1]) < 0.0001)
789789

@@ -799,8 +799,6 @@ def test_friedrich_coefficients(self):
799799
expected_index = ["m_2__r_30__coeff_0",
800800
"m_2__r_30__coeff_1",
801801
"m_2__r_30__coeff_2"]
802-
803-
self.assertIsInstance(res, pd.Series)
804802
six.assertCountEqual(self, list(res.index), expected_index)
805803
self.assertTrue(np.sum(np.isnan(res)), 3)
806804

@@ -812,13 +810,13 @@ def test_max_langevin_fixed_point(self):
812810

813811
# active Brownian motion
814812
ds = velocity(tau=3.8, delta_t=0.05, R=3e-4, seed=0)
815-
v = ds.simulate(1000000, v0=np.zeros(1))
813+
v = ds.simulate(100000, v0=np.zeros(1))
816814
v0 = max_langevin_fixed_point(v[:, 0], **default_params)
817-
self.assertTrue(abs(ds.deterministic - v0) < 0.0001)
815+
self.assertTrue(abs(ds.deterministic - v0) < 0.001)
818816

819817
# Brownian motion
820818
ds = velocity(tau=2.0 / 0.3 - 3.8, delta_t=0.05, R=3e-4, seed=0)
821-
v = ds.simulate(1000000, v0=np.zeros(1))
819+
v = ds.simulate(10000, v0=np.zeros(1))
822820
v0 = max_langevin_fixed_point(v[:, 0], **default_params)
823821
self.assertTrue(v0 < 0.001)
824822

0 commit comments

Comments
 (0)