Skip to content

Commit af5aace

Browse files
author
Junpeng Lao
committed
Update test, reorganise travis jobs to aviod timeout
1 parent b1ede8a commit af5aace

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ install:
1111
- pip install coveralls pylint
1212

1313
env:
14-
- PYTHON_VERSION=2.7 FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py"
15-
- PYTHON_VERSION=2.7 FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py"
14+
- PYTHON_VERSION=2.7 FLOATX='float32' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py"
15+
- PYTHON_VERSION=2.7 FLOATX='float32' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py"
1616
- PYTHON_VERSION=2.7 FLOATX='float32' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_posteriors.py"
17-
- PYTHON_VERSION=2.7 FLOATX='float64' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py"
18-
- PYTHON_VERSION=2.7 FLOATX='float64' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py"
17+
- PYTHON_VERSION=2.7 FLOATX='float64' TESTCMD="--durations=10 --ignore=pymc3/tests/test_examples.py --cov-append --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py"
18+
- PYTHON_VERSION=2.7 FLOATX='float64' RUN_PYLINT="true" TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py"
1919
- PYTHON_VERSION=2.7 FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_posteriors.py"
20-
- PYTHON_VERSION=3.6 FLOATX='float64' TESTCMD="--durations=10 --cov-append --ignore=pymc3/tests/test_examples.py --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py"
21-
- PYTHON_VERSION=3.6 FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py"
20+
- PYTHON_VERSION=3.6 FLOATX='float64' TESTCMD="--durations=10 --cov-append --ignore=pymc3/tests/test_examples.py --ignore=pymc3/tests/test_distributions_random.py --ignore=pymc3/tests/test_variational_inference.py --ignore=pymc3/tests/test_shared.py --ignore=pymc3/tests/test_smc.py --ignore=pymc3/tests/test_updates.py --ignore=pymc3/tests/test_posteriors.py --ignore=pymc3/tests/test_sampling.py"
21+
- PYTHON_VERSION=3.6 FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_distributions_random.py pymc3/tests/test_shared.py pymc3/tests/test_smc.py pymc3/tests/test_sampling.py"
2222
- PYTHON_VERSION=3.6 FLOATX='float64' TESTCMD="--durations=10 --cov-append pymc3/tests/test_examples.py pymc3/tests/test_variational_inference.py pymc3/tests/test_updates.py pymc3/tests/test_posteriors.py"
2323
script:
2424
- . ./scripts/test.sh $TESTCMD

pymc3/distributions/transforms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def forward(self, x):
137137
return tt.log(x - a) - tt.log(b - x)
138138

139139
def forward_val(self, x, point=None):
140-
a, b = draw_values([self.a, self.b],
140+
a, b = draw_values([self.a-0., self.b-0.],
141141
point=point)
142142
return floatX(tt.log(x - a) - tt.log(b - x))
143143

@@ -166,7 +166,7 @@ def forward(self, x):
166166
return tt.log(x - a)
167167

168168
def forward_val(self, x, point=None):
169-
a = draw_values([self.a],
169+
a = draw_values([self.a-0.],
170170
point=point)[0]
171171
return floatX(tt.log(x - a))
172172

@@ -194,7 +194,7 @@ def forward(self, x):
194194
return tt.log(b - x)
195195

196196
def forward_val(self, x, point=None):
197-
b = draw_values([self.b],
197+
b = draw_values([self.b-0.],
198198
point=point)[0]
199199
return floatX(tt.log(b - x))
200200

pymc3/tests/test_sampling.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,25 @@ def test_soft_update_transformed(self):
150150
pm.sampling._update_start_vals(start, test_point, model)
151151
assert_almost_equal(np.exp(start['a_log__']), start['a'])
152152

153-
def test_soft_update_transformed2(self):
153+
def test_soft_update_parent(self):
154154
with pm.Model() as model:
155155
a = pm.Uniform('a', lower=0., upper=1.)
156-
pm.Uniform('b', lower=0., upper=1.-a)
157-
start = {'a': .3, 'b': .5}
158-
test_point = {'a_interval__': -0.8472978603872037,
159-
'b_interval__': 0.9162907318741552}
156+
b = pm.Uniform('b', lower=2., upper=3.)
157+
pm.Uniform('lower', lower=a, upper=3.)
158+
pm.Uniform('upper', lower=0., upper=b)
159+
pm.Uniform('interv', lower=a, upper=b)
160+
161+
start = {'a': .3, 'b': 2.1, 'lower': 1.4, 'upper': 1.4, 'interv':1.4}
162+
test_point = {'lower_interval__': -0.3746934494414109,
163+
'upper_interval__': 0.693147180559945,
164+
'interv_interval__': 0.4519851237430569}
160165
pm.sampling._update_start_vals(start, model.test_point, model)
161-
assert_almost_equal(start['a_interval__'],
162-
test_point['a_interval__'])
163-
assert_almost_equal(start['b_interval__'],
164-
test_point['b_interval__'])
166+
assert_almost_equal(start['lower_interval__'],
167+
test_point['lower_interval__'])
168+
assert_almost_equal(start['upper_interval__'],
169+
test_point['upper_interval__'])
170+
assert_almost_equal(start['interv_interval__'],
171+
test_point['interv_interval__'])
165172

166173

167174
@pytest.mark.xfail(condition=(theano.config.floatX == "float32"), reason="Fails on float32")

0 commit comments

Comments
 (0)