Skip to content

Commit e6d6892

Browse files
committed
fix test bugs
1 parent f4ff69a commit e6d6892

File tree

3 files changed

+16
-26
lines changed

3 files changed

+16
-26
lines changed

brainpy/_src/measure/correlation.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -147,33 +147,23 @@ def voltage_fluctuation(potentials, numpy=True, method='loop'):
147147
\chi^2 \left( N \right) = \frac{\sigma_V^2}{ \frac{1}{N} \sum_{i=1}^N
148148
\sigma_{V_i}^2}
149149
150-
Parameters
151-
----------
152-
potentials : ndarray
153-
The membrane potential matrix of the neuron group.
154-
numpy: bool
155-
Whether we use numpy array as the functional output.
156-
If ``False``, this function can be JIT compiled.
157-
method: str
158-
The method to calculate all pairs of cross correlation.
159-
Supports two kinds of methods: `loop` and `vmap`.
160-
`vmap` method will consume much more memory.
161-
162-
.. versionadded:: 2.2.3.4
163-
164-
165-
Returns
166-
-------
167-
sync_index : float
168-
The synchronization index.
169-
170-
References
171-
----------
172150
.. [1] Golomb, D. and Rinzel J. (1993) Dynamics of globally coupled
173151
inhibitory neurons with heterogeneity. Phys. Rev. E 48:4810-4814.
174152
.. [2] Golomb D. and Rinzel J. (1994) Clustering in globally coupled
175153
inhibitory neurons. Physica D 72:259-282.
176154
.. [3] David Golomb (2007) Neuronal synchrony measures. Scholarpedia, 2(1):1347.
155+
156+
Args:
157+
potentials: The membrane potential matrix of the neuron group.
158+
numpy: Whether we use numpy array as the functional output. If ``False``, this function can be JIT compiled.
159+
method: The method to calculate all pairs of cross correlation.
160+
Supports two kinds of methods: `loop` and `vmap`.
161+
`vmap` method will consume much more memory.
162+
163+
.. versionadded:: 2.2.3.4
164+
165+
Returns:
166+
sync_index: The synchronization index.
177167
"""
178168

179169
potentials = bm.as_jax(potentials)

brainpy/_src/measure/tests/test_correlation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ def test_cc5(self):
6464

6565
class TestVoltageFluctuation(unittest.TestCase):
6666
def test_vf1(self):
67-
rng = bm.random.RandomState(122)
68-
voltages = rng.normal(0, 10, size=(1000, 100))
67+
bm.random.seed()
68+
voltages = bm.random.normal(0, 10, size=(100, 10))
6969
print(bp.measure.voltage_fluctuation(voltages))
7070

7171
bm.enable_x64()
72-
voltages = bm.ones((1000, 100)).value
72+
voltages = bm.ones((100, 10)).value
7373
r1 = bp.measure.voltage_fluctuation(voltages)
7474

7575
jit_f = jit(partial(bp.measure.voltage_fluctuation, numpy=False))

docs/tutorial_advanced/analysis.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Interoperation
1+
Analysis
22
================
33

44
.. toctree::

0 commit comments

Comments
 (0)