From 32175b270608018ae263ce20fafe4a2b4db46a09 Mon Sep 17 00:00:00 2001 From: chaoming Date: Sat, 5 Nov 2022 10:03:21 +0800 Subject: [PATCH 1/3] fix `parameter()` bug --- brainpy/__init__.py | 2 +- brainpy/initialize/generic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/brainpy/__init__.py b/brainpy/__init__.py index 130bade43..183e1b19e 100644 --- a/brainpy/__init__.py +++ b/brainpy/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -__version__ = "2.2.3.4" +__version__ = "2.2.3.5" try: diff --git a/brainpy/initialize/generic.py b/brainpy/initialize/generic.py index b0630e938..2c4d1df5f 100644 --- a/brainpy/initialize/generic.py +++ b/brainpy/initialize/generic.py @@ -75,7 +75,7 @@ def parameter( else: raise ValueError(f'Unknown param type {type(param)}: {param}') if allow_scalar: - if param.shape == () or param.shape != (1,): + if param.shape == () or param.shape == (1,): return param if param.shape != size: raise ValueError(f'The shape of the parameters should be {size}, but we got {param.shape}') From a589829e262d80f0a4e1223fb6672e8cf1ba0838 Mon Sep 17 00:00:00 2001 From: chaoming Date: Sat, 5 Nov 2022 10:12:35 +0800 Subject: [PATCH 2/3] update requirements --- .github/workflows/Windows_CI.yml | 2 +- requirements-dev.txt | 6 ++++-- requirements-win.txt | 13 ------------- 3 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 requirements-win.txt diff --git a/.github/workflows/Windows_CI.yml b/.github/workflows/Windows_CI.yml index 29e3f7ae5..420899e14 100644 --- a/.github/workflows/Windows_CI.yml +++ b/.github/workflows/Windows_CI.yml @@ -31,7 +31,7 @@ jobs: python -m pip install numpy>=1.21.0 python -m pip install "jaxlib==0.3.14" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver python -m pip install https://github.com/google/jax/archive/refs/tags/jax-v0.3.14.tar.gz - python -m pip install -r requirements-win.txt + python -m pip install -r requirements-dev.txt python -m pip install tqdm brainpylib python setup.py install - name: Lint with flake8 diff --git a/requirements-dev.txt b/requirements-dev.txt index 41d92e5f8..43aaf37cf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,6 @@ --r requirements.txt - +numpy>=1.15 +jax>=0.3.0 +tqdm numba matplotlib>=3.4 jaxlib>=0.3.0 @@ -11,3 +12,4 @@ pillow # test requirements pytest +absl-py diff --git a/requirements-win.txt b/requirements-win.txt deleted file mode 100644 index 0d38ed128..000000000 --- a/requirements-win.txt +++ /dev/null @@ -1,13 +0,0 @@ -numpy -tqdm -numba -h5py -matplotlib>=3.4 -scipy>=1.1.0 -brainpylib>=0.0.5 -jaxlib>=0.3.0 -pillow -requests - -# test requirements -pytest From 450fc0707b962e773cd322aa915b061e485d0ada Mon Sep 17 00:00:00 2001 From: chaoming Date: Sat, 5 Nov 2022 10:50:20 +0800 Subject: [PATCH 3/3] update tests --- brainpy/math/tests/test_numpy_einsum.py | 5 +++++ brainpy/math/tests/test_numpy_indexing.py | 2 ++ brainpy/math/tests/test_numpy_ops.py | 2 ++ 3 files changed, 9 insertions(+) diff --git a/brainpy/math/tests/test_numpy_einsum.py b/brainpy/math/tests/test_numpy_einsum.py index b4ed2f868..b9673ce6f 100644 --- a/brainpy/math/tests/test_numpy_einsum.py +++ b/brainpy/math/tests/test_numpy_einsum.py @@ -14,6 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. + +import pytest +pytest.skip("No need to test.", allow_module_level=True) + + import itertools from collections import defaultdict from functools import partial diff --git a/brainpy/math/tests/test_numpy_indexing.py b/brainpy/math/tests/test_numpy_indexing.py index 039f2d516..f6832dd58 100644 --- a/brainpy/math/tests/test_numpy_indexing.py +++ b/brainpy/math/tests/test_numpy_indexing.py @@ -16,6 +16,8 @@ import pytest +pytest.skip("No need to test.", allow_module_level=True) + import enum import itertools import typing diff --git a/brainpy/math/tests/test_numpy_ops.py b/brainpy/math/tests/test_numpy_ops.py index 4522bae19..cf0220e92 100644 --- a/brainpy/math/tests/test_numpy_ops.py +++ b/brainpy/math/tests/test_numpy_ops.py @@ -14,6 +14,8 @@ import pytest +pytest.skip("No need to test.", allow_module_level=True) + import collections import functools from functools import partial