Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .conda/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ then
CONDA_HOME="$HOME"/miniconda3
fi

"$CONDA_HOME"/bin/conda build --python=$python_version "$DIR"/..
if [ $(which xcrun) ]
then
sdk_path=$(xcrun --show-sdk-path)
variants_prefix="--variants"
variants="{'CONDA_BUILD_SYSROOT': ['${sdk_path}']}"
fi

"$CONDA_HOME"/bin/conda build --python=$python_version \
"$variants_prefix" "$variants" "$DIR"/..
2 changes: 1 addition & 1 deletion .conda/bin/jenkins-server-customization
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This Bash script must be sourced, not executed
# Customizations required for the server that currently runs Jenkins

conda install --yes mpi4py tensorflow
conda install --yes mpi4py tensorflow scipy\<1.3
module unload gcc
8 changes: 0 additions & 8 deletions .conda/build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/bin/bash

if [[ "$OSTYPE" == "darwin"* ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this block go away?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MACOSX_DEPLOYMENT_TARGET is set by conda-build based on the SDK we pass. The compiler variables are not used; instead, conda-build installs and uses compilers based on its configuration.

export MACOSX_DEPLOYMENT_TARGET=10.9
export CC=$(which clang)
export CXX=$(which clang++)
fi

echo $PREFIX

# Install pymanopt via pip because there isn't a conda package
PIP_NO_INDEX=False $PYTHON -m pip install pymanopt

Expand Down
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
branches:
only:
- master

matrix:
include:
- os: linux
Expand Down Expand Up @@ -41,7 +37,6 @@ matrix:
script: ./.conda/bin/build

- os: osx
osx_image: xcode8
install: ./.conda/bin/install-miniconda
script: ./.conda/bin/build

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class BuildExt(build_ext):
c_opts['unix'] += ['-lirc', '-lintlc']

if sys.platform == 'darwin':
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7',
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.9',
'-ftemplate-depth-1024']

def build_extensions(self):
Expand Down Expand Up @@ -126,7 +126,8 @@ def finalize_options(self):
# https://travis-ci.org/brainiak/brainiak/jobs/545838666
'mpi4py>=3',
'nitime',
'numpy',
# https://github.com/numpy/numpy/issues/14189
'numpy<1.17',
'scikit-learn[alldeps]>=0.18',
# See https://github.com/scipy/scipy/pull/8082
# and https://github.com/pymanopt/pymanopt/issues/77
Expand Down
13 changes: 9 additions & 4 deletions tests/eventseg/test_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ def test_fit_shapes():
"Segmentation from find_events not correctly normalized"

es_invalid = EventSegment(K)
with pytest.raises(ValueError, message="T < K should cause error"):
with pytest.raises(ValueError):
es_invalid.model_prior(K-1)
with pytest.raises(ValueError, message="#Events < K should cause error"):
# ``with`` block is about to end with no error.
pytest.fail("T < K should cause error")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't obvious to me why adding pytest.fail() here or how that would work until reading the link you added in the commit message.
Maybe add a comment above pytest.fail(), something like:
"If we reach here the expected exception wan't thrown, call pytest.fail() to display custom message"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

with pytest.raises(ValueError):
es_invalid.set_event_patterns(np.zeros((V, K-1)))
pytest.fail("#Events < K should cause error")


def test_simple_boundary():
Expand All @@ -60,11 +63,13 @@ def test_event_transfer():
es = EventSegment(2)
sample_data = np.asarray([[1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1]])

with pytest.raises(NotFittedError, message="Should need to set variance"):
with pytest.raises(NotFittedError):
seg = es.find_events(sample_data.T)[0]
pytest.fail("Should need to set variance")

with pytest.raises(NotFittedError, message="Should need to set patterns"):
with pytest.raises(NotFittedError):
seg = es.find_events(sample_data.T, np.asarray([1, 1]))[0]
pytest.fail("Should need to set patterns")

es.set_event_patterns(np.asarray([[1, 0], [0, 1]]))
seg = es.find_events(sample_data.T, np.asarray([1, 1]))[0]
Expand Down