Skip to content

Commit

Permalink
Try harder
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Apr 17, 2020
1 parent c0d7441 commit 391880c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ env:
matrix:
fast_finish: true
include:
- os: osx
language: generic
env:
- USE_PIP=true
- python: 3.7
env:
- PYTHON=3.7
- ARCH_CYTHON_COVERAGE=true
- os: osx
osx_image: xcode11.3
language: generic
env:
- USE_PIP=true
- python: 3.8
env:
- PYTHON=3.8
Expand Down Expand Up @@ -82,6 +83,8 @@ matrix:
- PYTEST_PATTERN="(slow or not slow)"

before_install:
- source ci/travis-osx-setup.sh
- python --version
- git fetch --tags
# Avoid noise from matplotlib
- mkdir -p $HOME/.config/matplotlib
Expand All @@ -101,20 +104,19 @@ before_install:
install:
- |
if [[ "$COVERAGE" == true ]]; then
pip install -e .
pip install -e . --no-build-isolation
else
pip install .
fi
script:
- set -e
- python ci/performance.py
- echo pytest -r a -m "$PYTEST_PATTERN" ${COVERAGE_OPTS} --durations=25 arch
- |
if [[ "$COVERAGE" == true ]]; then
echo pytest -r a -m "$PYTEST_PATTERN" ${COVERAGE_OPTS} --durations=25 arch/tests/univariate/test_rescale.py
pytest -r a -m "$PYTEST_PATTERN" ${COVERAGE_OPTS} --durations=25 arch
else
pip install .
mkdir arch_test
cd arch_test
python -c "import arch; arch.test(['-r a','-m (not slow)'])"
Expand Down
7 changes: 2 additions & 5 deletions arch/tests/univariate/test_rescale.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

import numpy as np
from numpy.testing import assert_allclose
import pandas as pd
Expand Down Expand Up @@ -36,12 +34,11 @@ def test_reproducibility(small_data, small_data2):
pd.testing.assert_series_equal(small_data, small_data2)


@pytest.mark.skipif(sys.platform == "darwin", reason="Buggy on OSX/pip NumPy")
def test_blank(small_data, std_data):
small_mod = ZeroMean(small_data, volatility=GARCH(), rescale=False)
small_res = small_mod.fit(disp="off")
small_res = small_mod.fit()
mod = ZeroMean(std_data, volatility=GARCH(), rescale=False)
res = mod.fit(disp="off")
res = mod.fit()
assert_allclose(1e3 * small_res.params[0], res.params[0], rtol=5e-3)


Expand Down
14 changes: 14 additions & 0 deletions ci/travis-osx-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
echo "OSX Python Information"
python3 --version
which python3
which pip3
echo unlink /usr/local/bin/python
unlink /usr/local/bin/python
echo ln -s /usr/local/bin/python3 /usr/local/bin/python
ln -s /usr/local/bin/python3 /usr/local/bin/python
echo unlink /usr/local/bin/pip
unlink /usr/local/bin/pip
echo ln -s /usr/local/bin/pip3 /usr/local/bin/pip
ln -s /usr/local/bin/pip3 /usr/local/bin/pip
fi

0 comments on commit 391880c

Please sign in to comment.