Skip to content

Fix directionality #319

Fix directionality

Fix directionality #319

Workflow file for this run

name: PR Test
on:
push:
branches: [ main, master ]
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
branches: [ main, master ]
paths-ignore:
- '**.md'
- 'docs/**'
# Auto-cancel in-progress runs for the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Principle of least privilege
permissions:
contents: read
jobs:
run-tests:
name: Tests (${{ matrix.os }} • py${{ matrix.python }})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ] # add macos-latest, windows-latest as needed
python: [ "3.11" ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Use Miniforge + mamba for faster, reproducible env solves
- name: Set up Conda (Miniforge)
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
use-mamba: true
auto-update-conda: false
auto-activate-base: false
channel-priority: strict
channels: conda-forge,franklab,edeno
activate-environment: replay_trajectory_classification
environment-file: environment.yml
python-version: ${{ matrix.python }}
# Cache conda packages to speed up solves
- name: Cache conda pkgs
uses: actions/cache@v4
with:
path: ~/.conda/pkgs
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda-
- name: Show Conda info
shell: bash -l {0}
run: |
conda info
conda list
- name: Install package (editable)
shell: bash -l {0}
run: |
python -V
pip install --upgrade pip
pip install -e .
# Execute tutorial notebooks to ensure they run end-to-end
- name: Test notebooks
shell: bash -l {0}
env:
NB_KERNEL: python3
run: |
set -euo pipefail
for nb in \
notebooks/tutorial/01-Introduction_and_Data_Format.ipynb \
notebooks/tutorial/02-Decoding_with_Sorted_Spikes.ipynb \
notebooks/tutorial/03-Decoding_with_Clusterless_Spikes.ipynb \
notebooks/tutorial/04-Classifying_with_Sorted_Spikes.ipynb \
notebooks/tutorial/05-Classifying_with_Clusterless_Spikes.ipynb
do
echo "Executing $nb"
jupyter nbconvert \
--to notebook \
--inplace \
--ExecutePreprocessor.kernel_name="$NB_KERNEL" \
--ExecutePreprocessor.timeout=1800 \
--execute "$nb"
done
# Always upload executed notebooks to aid debugging
- name: Upload executed notebooks
if: always()
uses: actions/upload-artifact@v4
with:
name: executed-notebooks-${{ matrix.os }}-py${{ matrix.python }}
path: |
notebooks/tutorial/*.ipynb
if-no-files-found: warn