Skip to content

Switch Plexon2 to a cron job/ workflow dispatch #1723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions .github/workflows/io-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ jobs:
# run: |
# pip install --no-dependencies -e .

- name: Install wine
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo dpkg --add-architecture i386
sudo apt-get update -qq
sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 wine
#- name: Install wine
# run: |
# sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
# sudo dpkg --add-architecture i386
# sudo apt-get update -qq
# sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 wine

- name: Pip list
run: |
Expand Down
112 changes: 112 additions & 0 deletions .github/workflows/plexon2-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: NeoPlexon2Test

on:
workflow_dispatch:
schedule:
- cron: "0 12 * * 0" # weekly at noon UTC on Sundays

concurrency: # Cancel previous workflows on the same pull request
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
name: Test on (${{ inputs.os }}) (${{ matrix.python-version}}) (${{ matrix.numpy-version }})
runs-on: ${{ inputs.os }}
strategy:
fail-fast: true
matrix:
python-version: ['3.9', '3.12']
numpy-version: ['1.26', '2.0']
defaults:
# by default run in bash mode (required for conda usage)
run:
shell: bash -l {0}
steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: Get current year-month
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT

- name: Get ephy_testing_data current head hash
# the key depend on the last commit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
id: ephy_testing_data
run: |
echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT

- uses: actions/cache/restore@v4
# Loading cache of ephys_testing_dataset
id: cache-datasets
with:
path: ~/ephy_testing_data
key: ${{ runner.os }}-datasets-${{ steps.ephy_testing_data.outputs.dataset_hash }}
restore-keys: ${{ runner.os }}-datasets-

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: neo-test-env-${{ matrix.python-version }}
python-version: "${{ matrix.python-version }}"

- name: Install testing dependencies
# testing environment is only created from yml if no cache was found
# restore-key hits should result in `cache-hit` == 'false'
#if: steps.cache-conda-env.outputs.cache-hit != 'true'
run: |
conda install pip numpy=${{ matrix.numpy-version }} -c conda-forge
# this command is for updating cache. We are resting removal.
# conda env update --name neo-test-env-${{ matrix.python-version }} --file environment_testing.yml --prune

- name: Install git-annex
# this is the trick from the spikeinterface repo for getting git-annex to work with datalad
# see https://github.com/SpikeInterface/spikeinterface/pull/3877 for more info
shell: bash
run: |
pip install datalad-installer
datalad-installer --sudo ok git-annex --method datalad/packages
git config --global filter.annex.process "git-annex filter-process" # recommended for efficiency

- name: Configure git
run: |
git config --global user.email "neo_ci@fake_mail.com"
git config --global user.name "neo CI"

- name: Python version
run: |
which python
python --version

- name: Install neo including dependencies
# installation with dependencies is only required if no cache was found
# restore-key hits should result in `cache-hit` == 'false'
# if: steps.cache-conda-env.outputs.cache-hit != 'true'
run: |
pip install --upgrade -e .
pip install .[test]


- name: Install wine
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo dpkg --add-architecture i386
sudo apt-get update -qq
sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 wine

- name: Pip list
run: |
pip list

- name: Conda list
run: |
conda list

- name: Test with pytest
env:
HDF5_PLUGIN_PATH: ${{ github.workspace }}/hdf5_local_plugin_path
PLEXON2_TEST: True
run: |
# only neo.rawio and neo.io
pytest --cov=neo neo/test/rawiotest
pytest --cov=neo neo/test/iotest
4 changes: 3 additions & 1 deletion neo/test/iotest/test_plexon2io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import unittest
import os

from neo.io import Plexon2IO
from neo.test.iotest.common_io_test import BaseTestIO
Expand All @@ -17,8 +18,9 @@
except (ImportError, TimeoutError):
HAVE_PYPL2 = False

TEST_PLEXON2 = bool(os.getenv("PLEXON2_TEST"))

@unittest.skipUnless(HAVE_PYPL2, "requires pypl package and all its dependencies")
@unittest.skipUnless(HAVE_PYPL2 and TEST_PLEXON2, "requires pypl package and all its dependencies")
class TestPlexon2IO(BaseTestIO, unittest.TestCase):
entities_to_download = TestPlexon2RawIO.entities_to_download
entities_to_test = TestPlexon2RawIO.entities_to_test
Expand Down
8 changes: 4 additions & 4 deletions neo/test/rawiotest/test_plexon2rawio.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""
Tests of neo.rawio.mearecrawio
Tests of neo.rawio.plexon2

"""

import unittest
import os

from neo.rawio.plexon2rawio import Plexon2RawIO

from neo.test.rawiotest.common_rawio_test import BaseTestRawIO

from numpy.testing import assert_equal

try:
Expand All @@ -18,8 +17,9 @@
except (ImportError, TimeoutError):
HAVE_PYPL2 = False

TEST_PLEXON2 = bool(os.getenv("PLEXON2_TEST"))

@unittest.skipUnless(HAVE_PYPL2, "requires pypl package and all its dependencies")
@unittest.skipUnless(HAVE_PYPL2 and TEST_PLEXON2, "requires pypl package and all its dependencies")
class TestPlexon2RawIO(
BaseTestRawIO,
unittest.TestCase,
Expand Down
Loading