Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions .github/workflows/Linux_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
# python -m pip install https://github.com/google/jax/archive/refs/tags/jax-v0.3.14.tar.gz
# python -m pip install https://github.com/google/jax/archive/refs/tags/jax-v0.3.14.tar.gz
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest brainpy/
4 changes: 2 additions & 2 deletions .github/workflows/MacOS_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
# python -m pip install https://github.com/google/jax/archive/refs/tags/jax-v0.3.14.tar.gz
# python -m pip install https://github.com/google/jax/archive/refs/tags/jax-v0.3.14.tar.gz
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest brainpy/
2 changes: 1 addition & 1 deletion .github/workflows/Windows_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest brainpy/
11 changes: 6 additions & 5 deletions brainpy/integrators/ode/tests/test_delay_ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def __init__(self, *args, **kwargs):
self.ref2 = delay_odeint(20., self.eq1, args={'xdelay': case2_delay}, state_delays={'x': case2_delay}, method='euler')

@parameterized.named_parameters(
{'testcase_name': f'constant_delay_{name}', 'method': name}
{'testcase_name': f'constant_delay_{name}',
'method': name}
for name in get_supported_methods()
)
def test1(self, method):
Expand All @@ -54,8 +55,8 @@ def test1(self, method):
case1 = delay_odeint(20., self.eq1, args={'xdelay': case1_delay}, state_delays={'x': case1_delay}, method=method)
case2 = delay_odeint(20., self.eq1, args={'xdelay': case2_delay}, state_delays={'x': case2_delay}, method=method)

self.assertTrue((case1.x - self.ref1.x).mean() < 1e-3)
self.assertTrue((case2.x - self.ref2.x).mean() < 1e-3)
self.assertTrue((case1['x'] - self.ref1['x']).mean() < 1e-3)
self.assertTrue((case2['x'] - self.ref2['x']).mean() < 1e-3)

# fig, axs = plt.subplots(2, 1)
# fig.tight_layout(rect=[0, 0, 1, 0.95], pad=3.0)
Expand Down Expand Up @@ -90,7 +91,7 @@ def test1(self, method):
case1 = delay_odeint(4., self.eq, args={'xdelay': delay1}, state_delays={'x': delay1}, dt=0.01, method=method)
case2 = delay_odeint(4., self.eq, args={'xdelay': delay2}, state_delays={'x': delay2}, dt=0.01, method=method)

self.assertTrue((case1.x - self.ref1.x).mean() < 1e-1)
self.assertTrue((case2.x - self.ref2.x).mean() < 1e-1)
self.assertTrue((case1['x'] - self.ref1['x']).mean() < 1e-1)
self.assertTrue((case2['x'] - self.ref2['x']).mean() < 1e-1)


16 changes: 8 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The code of BrainPy is open-sourced at GitHub:
:maxdepth: 2
:caption: BDP Tutorials

tutorial_basics/index
tutorial_math/index
tutorial_building/index
tutorial_simulation/index
tutorial_training/index
Expand Down Expand Up @@ -76,13 +76,13 @@ The code of BrainPy is open-sourced at GitHub:
:maxdepth: 1
:caption: Advanced Tutorials

tutorial_math/variables
tutorial_math/base
tutorial_math/compilation
tutorial_math/differentiation
tutorial_math/control_flows
tutorial_math/low-level_operator_customization
tutorial_math/interoperation
tutorial_advanced/variables
tutorial_advanced/base
tutorial_advanced/compilation
tutorial_advanced/differentiation
tutorial_advanced/control_flows
tutorial_advanced/low-level_operator_customization
tutorial_advanced/interoperation


.. toctree::
Expand Down
Loading