Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/brainpy/BrainPy into upda…
Browse files Browse the repository at this point in the history
…te-taichi-aot-call
  • Loading branch information
Routhleck committed Mar 3, 2024
2 parents c25f1fd + 5f1b905 commit 0d85459
Show file tree
Hide file tree
Showing 46 changed files with 1,938 additions and 2,300 deletions.
147 changes: 43 additions & 104 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ permissions:
contents: read # to fetch code
actions: write # to cancel previous workflows


#on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
# This is what will cancel the workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
Expand All @@ -30,14 +28,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # ratchet: styfle/cancel-workflow-action@0.12.1
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Print concurrency group
run: echo '${{ github.workflow }}-${{ github.ref }}'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -53,125 +53,64 @@ jobs:
cd brainpy
pytest _src/
test_linux_with_taichi_numba:
runs-on: ubuntu-latest
test_macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Print concurrency group
run: echo '${{ github.workflow }}-${{ github.ref }}'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest taichi numba
if [ -f requirements-dev-raw.txt ]; then pip install -r requirements-dev-raw.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip uninstall brainpy -y
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 brainpy/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 brainpy/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd brainpy
pytest _src/
test_macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # ratchet: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip uninstall brainpy -y
python setup.py install
- name: Test with pytest
run: |
cd brainpy
pytest -n auto --tb=short _src/
test_windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
os: [ win-2019-16core ]
arch: [ AMD64 ]
python-version: ["3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # ratchet: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
pip uninstall brainpy -y
python setup.py install
- name: Test with pytest
run: |
cd brainpy
pytest _src/
test_macos_with_taichi_numba:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest taichi numba
if [ -f requirements-dev-raw.txt ]; then pip install -r requirements-dev-raw.txt; fi
pip uninstall brainpy -y
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 brainpy/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 brainpy/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd brainpy
pytest _src/
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Print concurrency group
run: echo '${{ github.workflow }}-${{ github.ref }}'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
pip uninstall brainpy -y
python setup.py install
- name: Test with pytest
run: |
cd brainpy
pytest _src/ -p no:faulthandler
2 changes: 1 addition & 1 deletion brainpy/_src/_delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def register_entry(
delay_type = 'homo'
else:
delay_type = 'heter'
delay_step = bm.Array(delay_step)
delay_step = delay_step
elif callable(delay_step):
delay_step = delay_step(self.delay_target_shape)
delay_type = 'heter'
Expand Down
Loading

0 comments on commit 0d85459

Please sign in to comment.