Skip to content

Commit

Permalink
Test openmp compilation on travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
moorepants committed Nov 7, 2017
1 parent 6af7683 commit 60f6788
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ install:
- conda info -a
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
- source activate test-environment
- conda install sympy cython cyipopt nose coverage sphinx matplotlib
- conda install sympy cython cyipopt nose coverage sphinx matplotlib openmp
script:
- nosetests -v --with-coverage --cover-package=opty
- python setup.py install
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ To run all of the examples the following additional dependencies are required:
- pytables
- pandas
- yeadon
- openmp

**Currently only Linux and Mac are officially supported.** Although, it should
be possible to install this on Windows with an appropriate Cython compilation
Expand Down
11 changes: 9 additions & 2 deletions opty/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def eval_matrix_loop_numpy(a_vals, b_vals, c_vals):
result[:, 0, 0] = a_vals**2 * np.cos(b_vals)**c_vals
result[:, 0, 1] = np.tan(b_vals) / np.sin(a_vals + b_vals) + c_vals**4
result[:, 1, 0] = a_vals**2 + b_vals**2 - np.sqrt(c_vals)
result[:, 1, 1] = (((a_vals + b_vals + c_vals) * (a_vals + b_vals))
/ a_vals * np.sin(b_vals))
result[:, 1, 1] = (((a_vals + b_vals + c_vals) * (a_vals + b_vals)) /
a_vals * np.sin(b_vals))

return result

Expand All @@ -119,6 +119,13 @@ def eval_matrix_loop_numpy(a_vals, b_vals, c_vals):
testing.assert_allclose(f(result, a_vals, b_vals, c_val),
eval_matrix_loop_numpy(a_vals, b_vals, c_val))

f = utils.ufuncify_matrix((a, b, c), sym_mat, const=(c,), parallel=True)

result = np.empty((n, 4))

testing.assert_allclose(f(result, a_vals, b_vals, c_val),
eval_matrix_loop_numpy(a_vals, b_vals, c_val))


def test_substitute_matrix():

Expand Down

0 comments on commit 60f6788

Please sign in to comment.