Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Brian 2.7 #315

Merged
merged 3 commits into from
Jun 6, 2024
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
39 changes: 0 additions & 39 deletions brian2cuda/tests/test_neurongroup.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,10 @@
import numpy as np
import pytest
from numpy.testing import assert_equal

from brian2.core.clocks import defaultclock
from brian2.core.magic import run
from brian2.groups.neurongroup import NeuronGroup
from brian2.synapses import Synapses
from brian2.tests.utils import assert_allclose
from brian2.utils.logger import catch_logs
from brian2.units import second

# Adapted from brian2/tests/test_neurongroup.py::test_semantics_floor_division
# (brian2 test asserts for 0 warnings, brian2cuda warns for int to float64 conversion)
# Can be removed with the next version that includes brian-team/brian2#1519
@pytest.mark.standalone_compatible
def test_semantics_floor_division():
# See Brian2 github issues #815 and #661
G = NeuronGroup(11, '''a : integer
b : integer
x : 1
y : 1
fvalue : 1
ivalue : integer''',
dtype={'a': np.int32, 'b': np.int64,
'x': np.float32, 'y': np.float64})
int_values = np.arange(-5, 6)
float_values = np.arange(-5.0, 6.0, dtype=np.float64)
G.ivalue = int_values
G.fvalue = float_values
with catch_logs() as l:
G.run_regularly('''
a = ivalue//3
b = ivalue//3
x = fvalue//3
y = fvalue//3
''')
run(defaultclock.dt)
# XXX: brian2 test adapted here for 1 warning
assert len(l) == 1
assert_equal(G.a[:], int_values // 3)
assert_equal(G.b[:], int_values // 3)
assert_allclose(G.x[:], float_values // 3)
assert_allclose(G.y[:], float_values // 3)


@pytest.mark.standalone_compatible
def test_group_variable_set_copy_to_host():

Expand Down
2 changes: 1 addition & 1 deletion frozen_repos/brian2
Submodule brian2 updated 40 files
+2 −3 .github/workflows/publish.yml
+20 −0 .github/workflows/test_latest.yml
+16 −2 .github/workflows/testsuite.yml
+1 −1 .pre-commit-config.yaml
+1 −0 AUTHORS
+9 −6 CITATION.cff
+72 −0 README.md
+0 −125 README.rst
+1 −1 brian2/__init__.py
+9 −0 brian2/codegen/runtime/GSLcython_rt/GSLcython_rt.py
+5 −3 brian2/codegen/runtime/numpy_rt/numpy_rt.py
+24 −9 brian2/core/base.py
+1 −2 brian2/core/functions.py
+3 −0 brian2/core/network.py
+11 −3 brian2/core/variables.py
+3 −6 brian2/devices/cpp_standalone/templates/objects.cpp
+3 −5 brian2/groups/neurongroup.py
+5 −0 brian2/groups/subgroup.py
+10 −1 brian2/parsing/rendering.py
+1 −1 brian2/sphinxext/docscrape.py
+6 −2 brian2/sphinxext/examplefinder.py
+21 −0 brian2/tests/test_codegen.py
+1 −1 brian2/tests/test_cpp_standalone.py
+64 −1 brian2/tests/test_logger.py
+15 −0 brian2/tests/test_network.py
+15 −15 brian2/tests/test_neurongroup.py
+1 −1 brian2/units/fundamentalunits.py
+16 −2 brian2/utils/logger.py
+4 −3 dev/continuous-integration/run_test_suite.py
+1 −1 dev/tools/docs/build_html_brian2.py
+1 −1 dev/tools/docs/quick_rebuild_html_brian2.py
+41 −36 docs_sphinx/conf.py
+44 −0 docs_sphinx/introduction/release_notes.rst
+2 −2 examples/advanced/stochastic_odes.py
+0 −4 examples/frompapers/Brunel_Wang_2001.py
+ examples/multiprocessing/standalone307987/main
+1 −1 numpy2.pyproject.toml
+8 −7 pyproject.toml
+0 −5 setup.py
+1 −2 versions.md
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name = "Brian2Cuda"
authors = [
{name = 'Denis Alevi'},
{name = 'Moritz Augustin'},
{name ='Marcel Stimberg'}
{name = 'Marcel Stimberg'}
]
requires-python = '>=3.9'
requires-python = '>=3.10'
dependencies = [
'brian2==2.6.0',
'brian2==2.7.0',
]
dynamic = ["version", "readme"]
description = 'A Brian2 extension to simulate spiking neural networks on GPUs'
Expand Down Expand Up @@ -52,4 +52,3 @@ requires = [
"setuptools_scm[toml]>=6.2"
]
build-backend = "setuptools.build_meta"

Loading