Skip to content

Commit

Permalink
Fix Travis (#258)
Browse files Browse the repository at this point in the history
* Fix Travis, change in Homebrew

* Relax np.array_equal->np.allclose
  • Loading branch information
vuolleko committed Apr 3, 2018
1 parent 13b4a0b commit 8c61b43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ matrix:
- mkdir -p /Users/travis/.matplotlib
- "echo 'backend: TkAgg' > /Users/travis/.matplotlib/matplotlibrc"
- brew update
- brew install python3
- virtualenv env -p python3
- source env/bin/activate
- brew upgrade python
- pip3 install virtualenv
- virtualenv py3env -p python3
- source py3env/bin/activate

cache: pip

Expand Down
9 changes: 5 additions & 4 deletions tests/functional/test_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
def check_consistent_sample(sample, sample_diff, sample_same):
assert not np.array_equal(sample.outputs['t1'], sample_diff.outputs['t1'])

assert np.array_equal(sample.outputs['t1'], sample_same.outputs['t1'])
assert np.array_equal(sample.outputs['t2'], sample_same.outputs['t2'])
assert np.allclose(sample.outputs['t1'], sample_same.outputs['t1'])
assert np.allclose(sample.outputs['t2'], sample_same.outputs['t2'])

# BOLFI does not have d in its outputs
if 'd' in sample.outputs:
assert np.array_equal(sample.outputs['d'], sample_same.outputs['d'])
assert np.allclose(sample.outputs['d'], sample_same.outputs['d'])


@pytest.mark.usefixtures('with_all_clients')
Expand Down Expand Up @@ -101,7 +101,8 @@ def test_bo(ma2):
check_consistent_sample(res, res_diff, res_same)

assert not np.array_equal(res.x_min, res_diff.x_min)
assert np.array_equal(res.x_min, res_same.x_min)
assert np.allclose(res.x_min['t1'], res_same.x_min['t1'], atol=1e-07)
assert np.allclose(res.x_min['t2'], res_same.x_min['t2'], atol=1e-07)


# TODO: skipped in travis due to NUTS initialization failing too often. Should be fixed.
Expand Down

0 comments on commit 8c61b43

Please sign in to comment.