Skip to content

Commit

Permalink
simplified travis build and introduced single VERSION file (NeuralEns…
Browse files Browse the repository at this point in the history
…emble#222)

* simplified travis build

* added requirements min version test

* refactored setup.py

* [SPADE] fim as an extra module

* test_spade.py: print if fim.so is found during the test

* always install neo by pip

* inlcude test/*.txt in a pypi tarball

* Revert "[SPADE] fim as an extra module"

* test conda 3.5 -> pip 3.5

* download fim.so at 'pip install .'

* fix travis

* moved downloading fim.so from setup.py to spade

* pep 8 fix

* added test_download_spade_fim
  • Loading branch information
dizcza authored and mdenker committed Jun 26, 2019
1 parent f9c2c5c commit 73628d1
Show file tree
Hide file tree
Showing 18 changed files with 194 additions and 294 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ Thumbs.db

# Things specific to this project #
###################################
# ignored folder for fast prototyping
ignored/
116 changes: 78 additions & 38 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,84 @@
dist: precise
dist: xenial
language: python
sudo: false

addons:
apt:
packages:
- libatlas3gf-base
- libatlas-dev
- libatlas-base-dev
- liblapack-dev
- gfortran
- python-scipy

python:
- 2.7.13

env:
matrix:
# This environment tests the newest supported anaconda env
- DISTRIB="conda" PYTHON_VERSION="2.7" INSTALL_MKL="true"
NUMPY_VERSION="1.15.1" SCIPY_VERSION="1.1.0" PANDAS_VERSION="0.23.4"
SIX_VERSION="1.10.0" COVERAGE="true"
- DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="true"
NUMPY_VERSION="1.15.1" SCIPY_VERSION="1.1.0" PANDAS_VERSION="0.23.4"
SIX_VERSION="1.10.0" COVERAGE="true"
# This environment tests minimal dependency versions
- DISTRIB="conda_min" PYTHON_VERSION="2.7" INSTALL_MKL="false"
SIX_VERSION="1.10.0" NUMPY_VERSION="1.8.2" SCIPY_VERSION="0.14.0" COVERAGE="true"
- DISTRIB="conda_min" PYTHON_VERSION="3.4" INSTALL_MKL="false"
SIX_VERSION="1.10.0" NUMPY_VERSION="1.8.2" SCIPY_VERSION="0.14.0" COVERAGE="true"
# basic Ubuntu build environment
- DISTRIB="ubuntu" PYTHON_VERSION="2.7" INSTALL_ATLAS="true"
COVERAGE="true"
# This environment tests for mpi
- DISTRIB="mpi" PYTHON_VERSION="3.5" INSTALL_MKL="false"
NUMPY_VERSION="1.15.1" SCIPY_VERSION="1.1.0" SIX_VERSION="1.10.0"
MPI_VERSION="2.0.0" COVERAGE="true" MPI="true"

install: source continuous_integration/install.sh
script: bash continuous_integration/test_script.sh
update: true


matrix:
include:
- name: "conda 2.7"
python: 2.7
env: DISTRIB="conda"

- name: "pip 2.7"
python: 2.7
env: DISTRIB="pip"

- name: "pip 3.5"
python: 3.5
env: DISTRIB="pip"

- name: "conda 3.6"
python: 3.6
env: DISTRIB="conda"

- name: "pip 3.6"
python: 3.6
env: DISTRIB="pip"

- name: "pip 3.6 requirements-extras"
python: 3.6
env: DISTRIB="pip"
before_install: sudo apt install -y libopenmpi-dev openmpi-bin
before_script: pip install -r requirements-extras.txt
script: mpiexec -n 1 nosetests --with-coverage --cover-package=elephant

- name: "conda 3.7"
python: 3.7
env: DISTRIB="conda"

exclude:
- name: "pip 3.6 requirements min version"
# excluded due to unmet dependencies in neo, quantities, and scipy
python: 3.6
env: DISTRIB="pip"
before_install:
- sudo apt install libblas-dev liblapack-dev libatlas-base-dev gfortran
- sed -i 's/>=/==/g' requirements.txt


install:
- if [[ "${DISTRIB}" == "conda" ]];
then
export MINICONDA_PATH=${HOME}/miniconda;
export PATH=${MINICONDA_PATH}/bin:${PATH};
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p ${MINICONDA_PATH};
conda config --set always_yes yes;
conda update conda;
conda create --name elephant_env python=${TRAVIS_PYTHON_VERSION};
source activate elephant_env;
conda install mkl;
conda config --append channels conda-forge;
sed '/^neo/d' requirements.txt > requirements-conda.txt;
conda install --file requirements-conda.txt;
echo "'neo' will be installed by pip from requirements.txt later on";
pip list;
else
pip install -r requirements.txt;
fi

- pip -V
- pip install coverage coveralls nose
- pip install .
- pip list
- python --version

script:
nosetests --with-coverage --cover-package=elephant

after_success:
- if [[ "$COVERAGE" == "true" ]]; then coveralls || echo "failed"; fi
cache: apt
coveralls || echo "coveralls failed"
12 changes: 8 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Include requirements
include requirement*.txt
include README.rst
include LICENSE.txt
include AUTHORS.txt
include elephant/test/spike_extraction_test_data.npz
include elephant/VERSION
include elephant/current_source_density_src/README.md
include elephant/current_source_density_src/test_data.mat
include elephant/spade_src/LICENCE
include elephant/test/spike_extraction_test_data.txt
recursive-include doc *
prune doc/build

# special care for the files, used in setup.py
include elephant/spade_src/fim_manager.py
135 changes: 0 additions & 135 deletions continuous_integration/install.sh

This file was deleted.

23 changes: 0 additions & 23 deletions continuous_integration/test_script.sh

This file was deleted.

10 changes: 7 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#

root_dir = os.path.dirname(os.path.dirname(__file__))
with open(os.path.join(root_dir, 'elephant', 'VERSION')) as version_file:
# The full version, including alpha/beta/rc tags.
release = version_file.read().strip()

# The short X.Y version.
version = '0.6'
# The full version, including alpha/beta/rc tags.
release = '0.6.2'
version = '.'.join(release.split('.')[:-1])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
9 changes: 4 additions & 5 deletions doc/developers_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,18 @@ All code should conform as much as possible to `PEP 8`_, and should run with
Python 2.7 and 3.2-3.5.


Making a release
Making a release (maintainers only)
----------------

.. TODO: discuss branching/tagging policy.
.. Add a section in /doc/releases/<version>.rst for the release.
First, check that the version string (in :file:`elephant/__init__.py`, :file:`setup.py`,
:file:`doc/conf.py`, and :file:`doc/install.rst`) is correct.
1. Increment the Elephant package version in :file:`elephant/VERSION`, if necessary.

Second, check that the copyright statement (in :file:`LICENCE.txt`, :file:`README.md`, and :file:`doc/conf.py`) is correct.
2. Check that the copyright statement (in :file:`LICENCE.txt`, :file:`README.md`, and :file:`doc/conf.py`) is correct.

Third, if there is a new module do not forget to add the modulename to the :file:`doc/module.rst` and make a file with a short description in :file:`doc/reference/<modulename>.rst`.
3. If there is a new module do not forget to add the modulename to the :file:`doc/module.rst` and make a file with a short description in :file:`doc/reference/<modulename>.rst`.

To build a source package::

Expand Down
1 change: 1 addition & 0 deletions elephant/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.6.2
32 changes: 8 additions & 24 deletions elephant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,13 @@
:license: Modified BSD, see LICENSE.txt for details.
"""

from . import (statistics,
spike_train_generation,
spike_train_correlation,
unitary_event_analysis,
cubic,
spectral,
kernels,
spike_train_dissimilarity,
spike_train_surrogates,
signal_processing,
current_source_density,
change_point_detection,
phase_analysis,
sta,
conversion,
neo_tools,
spade,
cell_assembly_detection)

try:
from . import pandas_bridge
from . import asset
except ImportError:
pass
def _get_version():
import os
elephant_dir = os.path.dirname(__file__)
with open(os.path.join(elephant_dir, 'VERSION')) as version_file:
version = version_file.read().strip()
return version

__version__ = "0.6.2"

__version__ = _get_version()
2 changes: 1 addition & 1 deletion elephant/current_source_density_src/utility_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def check_for_duplicated_electrodes(elec_pos):
-------
has_duplicated_elec : Boolean
"""
unique_elec_pos = np.vstack({tuple(row) for row in elec_pos})
unique_elec_pos = np.unique(elec_pos, axis=0)
has_duplicated_elec = unique_elec_pos.shape == elec_pos.shape
return has_duplicated_elec

Expand Down

0 comments on commit 73628d1

Please sign in to comment.