Skip to content

Commit

Permalink
Merge pull request #232 from blakecaldwell/hnn_core_v2
Browse files Browse the repository at this point in the history
[MRG] hnn-core integration
  • Loading branch information
blakecaldwell authored Mar 21, 2021
2 parents a09bb08 + d95319e commit f876500
Show file tree
Hide file tree
Showing 151 changed files with 8,899 additions and 26,801 deletions.
194 changes: 58 additions & 136 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,28 @@ matrix:
include:
# OSX
- os: osx
name: "MacOS sierra"
osx_image: xcode9.2
env:
- PYTHON_VERSION=3.7
- NEURON_VERSION=7.7

- os: osx
name: "MacOS el capitan"
osx_image: xcode8
env:
- PYTHON_VERSION=3.7
- NEURON_VERSION=7.7

- os: osx
name: "MacOS mojave"
osx_image: xcode11.3
env:
- PYTHON_VERSION=3.7
- NEURON_VERSION=7.7
name: "MacOS Catalina"
osx_image: xcode12

- os: osx
name: "MacOS high sierra"
osx_image: xcode10.1
# WSL
- os: windows
name: "WSL"
env:
- PYTHON_VERSION=3.7
- NEURON_VERSION=7.7
- WSL_INSTALL=1
- USE_CONDA=0

# Windows
- os: windows
name: "Windows"
env:
- PYTHON_VERSION=3.7
- NEURON_VERSION=7.7
- WSL_INSTALL=0

# Linux
- os: linux
dist: xenial
name: "Ubuntu xenial"
env:
- NEURON_VERSION=7.7
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- xvfb

- os: linux
dist: bionic
name: "Ubuntu bionic"
name: "Ubuntu Bionic"
env:
- NEURON_VERSION=7.7
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- xvfb

- os: linux
dist: disco
name: "Ubuntu disco"
env:
- NEURON_VERSION=7.7
- USE_CONDA=1
apt:
sources:
- ubuntu-toolchain-r-test
Expand All @@ -75,112 +35,74 @@ matrix:
- os: linux
dist: focal
name: "Ubuntu focal"
env:
- NEURON_VERSION=7.7
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- xvfb

before_install:
- set -e # error on any command failure
- | # function exports
export TRAVIS_TESTING=1
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
# for start_vcxsrv_print and stop_vcxsrv
source "scripts/docker_functions.sh"
set_globals
fi
# source utility functions
export LOGFILE="hnn_travis.log"
source scripts/utils.sh
export -f cleanup
- |
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then # install osx prerequisites
echo "Installing macOS prerequisites"
scripts/setup-travis-mac.sh
export PATH=${HOME}/Miniconda3/bin:$PATH
export PATH=$PATH:/Applications/NEURON-${NEURON_VERSION}/nrn/x86_64/bin
export PYTHONPATH=/Applications/NEURON-${NEURON_VERSION}/nrn/lib/python:$PYTHONPATH
export PYTHON=python3
source activate hnn && echo "activated conda HNN environment"
fi
- | # windows
if [ "${TRAVIS_OS_NAME}" == "windows" ]; then
echo "Installing windows prerequisites"
scripts/setup-travis-windows.sh
# Step 0: set common environment variables
# add miniconda python to the path
export PATH=$PATH:$HOME/Miniconda3/Scripts
export PATH=$HOME/Miniconda3/envs/hnn/:$PATH
export PATH=$HOME/Miniconda3/envs/hnn/Scripts:$PATH
export PATH=$HOME/Miniconda3/envs/hnn/Library/bin:$PATH
# for using X server
export PATH="$PATH:/c/Program\ Files/VcXsrv"
# for MESA dll's
export PATH=$PATH:/c/tools/msys64/mingw64/bin
set -e
export TRAVIS_TESTING=1
export DISPLAY=:0
export LOGFILE="hnn_travis.log"
export PATH="$PATH:$HOME/.local/bin"
if [[ "${WSL_INSTALL}" -eq 1 ]]; then
# for sharing with WSL environment
export WSLENV=TRAVIS_TESTING/u
# set other variables for neuron and HNN
export PATH=$PATH:/c/nrn/bin
export DISPLAY="localhost:0"
export NEURONHOME=/c/nrn
export PYTHON=python
export OMPI_MCA_btl_vader_single_copy_mechanism=none
export WSLENV=TRAVIS_TESTING/u:DISPLAY/u:OMPI_MCA_btl_vader_single_copy_mechanism/u:WSL_INSTALL/u
fi
- | # Linux
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
echo "Installing Linux prerequisites"
export DISPLAY=:0
export PATH=/usr/bin:/usr/local/bin:$PATH
echo "Starting fake Xserver"
Xvfb $DISPLAY -listen tcp -screen 0 1024x768x24 > /dev/null &
echo "Starting Ubuntu install script"
installer/ubuntu/hnn-ubuntu.sh
- |
# Step 1: install prerequisites
NLOPT_LIB=$(ls -d $HOME/.local/lib/python*/site-packages)
echo $NLOPT_LIB
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NLOPT_LIB
export PYTHON=python3
if [[ "${WSL_INSTALL}" -eq 1 ]]; then
powershell.exe -ExecutionPolicy Bypass -File ./scripts/setup-travis-wsl.ps1
# scripts/setup-travis-wsl.sh
else
echo "Installing ${TRAVIS_OS_NAME} prerequisites"
scripts/setup-travis-${TRAVIS_OS_NAME}.sh
# test X server
xset -display $DISPLAY -q > /dev/null;
source "$HOME/Miniconda3/etc/profile.d/conda.sh"
conda activate hnn
fi
install:
- | # for mac build HNN .mod files
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
make -j2
- |
# Step 2: install hnn Python module and modules for testing
if [[ "${WSL_INSTALL}" -ne 1 ]]; then
pip install flake8 pytest pytest-cov coverage coveralls mne pytest-qt
python setup.py install
else
wsl -- pip install flake8 pytest pytest-cov coverage coveralls mne \
pytest-qt
wsl -- python3 setup.py install --user
fi
- | # testing packages
pip install flake8 pytest pytest-cov coverage coveralls mne
script:
- | # Check that the GUI starts on host OS
echo "Testing GUI on host OS..."
$PYTHON hnn.py
- | # Run py.test that includes running a simulation and verifying results
echo "Running Python tests on host OS..."
py.test --cov=. tests/
- | # Test WSL-based version on windows (needs VcXsrv)
if [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
find_command_suggested_path "vcxsrv" "/c/Program Files/VcXsrv" && \
start_vcxsrv_print || script_fail
wsl -- bash -e //home/hnn_user/hnn/scripts/run-travis-wsl.sh
stop_vcxsrv || script_fail
- |
# Step 3: run CI tests with py.test
if [[ "${WSL_INSTALL}" -eq 1 ]]; then
wsl -- //home/hnn_user/hnn/scripts/run-pytest.sh
else
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# NEURON will fail to import if DISPLAY is set
unset DISPLAY
elif [[ "${TRAVIS_OS_NAME}" == "windows" ]]; then
# Python will search path to find neuron dll's
export PATH=$PATH:/c/nrn/bin
# run tests first as a user with a space (TODO)
# runas //user:"test user" //wait "bash" "scripts/run-pytest.sh" < "$HOME/test_user_creds"
# echo "Finished test with 'test user'"
fi
scripts/run-pytest.sh
fi
after_success:
Expand Down
139 changes: 0 additions & 139 deletions DataViewGUI.py

This file was deleted.

Loading

0 comments on commit f876500

Please sign in to comment.