diff --git a/.github/workflows/CI_actions.yml b/.github/workflows/CI_actions.yml index dc6335c..ad75fa4 100644 --- a/.github/workflows/CI_actions.yml +++ b/.github/workflows/CI_actions.yml @@ -1,66 +1,45 @@ -# This workflow will setup GitHub-hosted runners and install the required dependencies for viziphant documentation. -# On pull requests and on pushes to master it will build the documentation . - +# CI Tests that runs unittests and doc build +# Triggered on pull requests and pushes to master name: tests -# define events that trigger workflow 'Viziphant-tests' on: - # run on pull requests to master branch pull_request: branches: [master] types: [synchronize, opened, reopened] - - # run on pushes to master branch push: branches: [master] -# jobs define the steps that will be executed on the runner jobs: - - # install dependencies for the documentation and build .html docs: - runs-on: ${{ matrix.os }} + runs-on: "ubuntu-latest" + env: + PYTHON_VERSION: "3.10" strategy: - - matrix: - # OS [ubuntu-latest, macos-latest, windows-latest] - os: [ubuntu-latest] - # relevant python versions for viziphant: [3.7, 3.8, 3.9, "3.10", 3.11, 3.12] - python-version: [3.8, 3.9, "3.10", 3.11, 3.12] - - # do not cancel all in-progress jobs if any matrix job fails fail-fast: false steps: - - name: Get current year-month id: date - run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT + run: echo "date=$(date +'%Y-%m')" >> "$GITHUB_OUTPUT" - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v6 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ env.PYTHON_VERSION }} - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v5 with: path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding requirements files key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}-${{ hashFiles('**/requirements.txt') }}-${{ steps.date.outputs.date }} - - name: Install dependencies run: | + sudo apt install pandoc python -m pip install --upgrade pip - pip install setuptools - pip install -r requirements/requirements-docs.txt - pip install -r requirements/requirements.txt - pip install . - conda update conda - conda install -c conda-forge pandoc + pip install .["docs"] # run notebooks sed -i -E "s/nbsphinx_execute *=.*/nbsphinx_execute = 'always'/g" doc/conf.py - name: make html @@ -69,50 +48,39 @@ jobs: cd doc make html - # install dependencies and run tests with pytest tests: runs-on: ${{ matrix.os }} strategy: - matrix: - # OS [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest] - # relevant python versions for viziphant: [3.7, 3.8, 3.9, "3.10"] - python-version: [3.9] - - # do not cancel all in-progress jobs if any matrix job fails + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] fail-fast: false steps: - name: Get current year-month id: date - run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT + run: echo "date=$(date +'%Y-%m')" >> "$GITHUB_OUTPUT" - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v5 with: path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding requirements files key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}-${{ hashFiles('**/requirements.txt') }}-${{ steps.date.outputs.date }} - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools - pip install -r requirements/requirements-docs.txt - pip install -r requirements/requirements-tests.txt - pip install -r requirements/requirements.txt - pip install . + pip install .["tests"] - name: run tests run: | python --version - pytest viziphant + pytest diff --git a/requirements/requirements-tests.txt b/requirements/requirements-tests.txt index e079f8a..fd0426d 100644 --- a/requirements/requirements-tests.txt +++ b/requirements/requirements-tests.txt @@ -1 +1,2 @@ pytest +elephant[extras] diff --git a/viziphant/unitary_event_analysis.py b/viziphant/unitary_event_analysis.py index c5a86bb..6bf3b78 100644 --- a/viziphant/unitary_event_analysis.py +++ b/viziphant/unitary_event_analysis.py @@ -177,7 +177,7 @@ def plot_ue(spiketrains, Js_dict, significance_level=0.05, spiketrains2 = [homogeneous_poisson_process(rate=50 * pq.Hz, t_stop=2 * pq.s) for _ in range(5)] - spiketrains = np.stack((spiketrains1, spiketrains2), axis=1) + spiketrains = [ [unit1, unit2] for unit1, unit2 in zip(spiketrains1, spiketrains2)] ue_dict = jointJ_window_analysis(spiketrains, bin_size=5 * pq.ms, win_size=100 * pq.ms,