Skip to content

Add neuron selection support to SequenceInterpolator and SpikeInterpolator #375

Add neuron selection support to SequenceInterpolator and SpikeInterpolator

Add neuron selection support to SequenceInterpolator and SpikeInterpolator #375

Workflow file for this run

name: CI - Tests and formatting
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'pull_request' &&
github.repository != github.event.pull_request.head.repo.full_name
)
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run pytest with coverage
run: |
pytest -v --cov=experanto --cov-report=xml tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
lint-and-format:
name: Lint & Auto-format
runs-on: ubuntu-latest
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'pull_request' &&
github.repository != github.event.pull_request.head.repo.full_name
)
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.8'
- name: Install tools
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run Black and Isort
run: |
if [[ "${{ github.event_name }}" == "push" && "${{ github.repository }}" == "${{ github.event.repository.full_name }}" ]]; then
echo "Push event in same repo: Running black and isort with auto-format and commit"
black .
isort .
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if ! git diff --quiet; then
git commit -am "style: auto-format with black and isort"
git push
else
echo "No formatting changes to commit."
fi
elif [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "PR or manual run: Running black and isort in check mode"
black --check . || { echo "Black formatting issues found. Run 'black .' to fix."; exit 1; }
isort --check-only . || { echo "isort import order issues found. Run 'isort .' to fix."; exit 1; }
else
echo "Not a forked PR and not a push. Skipping format."
fi
type-check:
name: Type Check (Pyright)
runs-on: ubuntu-latest
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'pull_request' &&
github.repository != github.event.pull_request.head.repo.full_name
)
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run Pyright
run: |
pyright experanto/