Skip to content

Commit 67a8f6a

Browse files
committed
Format Python and correct copyright header
1 parent 2f33444 commit 67a8f6a

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

nestkernel/sp_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ SPManager::get_neuron_pair_index( int id1, int id2 )
277277
{
278278
int max_id = std::max( id1, id2 );
279279
int min_id = std::min( id1, id2 );
280-
int index = ( ( max_id ) * ( max_id - 1 ) ) / 2 + ( min_id - 1 );
280+
int index = ( ( max_id ) * ( max_id - 1 ) ) / 2 + ( min_id - 1 );
281281
return index;
282282
}
283283

@@ -307,7 +307,7 @@ SPManager::roulette_wheel_selection( const std::vector< double >& probabilities,
307307

308308
// Perform binary search to find the selected index
309309
auto it = std::lower_bound( cumulative.begin(), cumulative.end(), randomValue );
310-
return static_cast< int >( std::distance( cumulative.begin(), it ) );
310+
return static_cast< int >( std::distance( cumulative.begin(), it ) );
311311
}
312312

313313

pynest/nest/lib/hl_api_simulation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ def Install(module_name):
333333

334334
@check_stack
335335
def EnableStructuralPlasticity(
336-
use_gaussian_kernel=False, gaussian_kernel_sigma=0.0, cache_probabilites=False, max_distance=float('inf'),
336+
use_gaussian_kernel=False,
337+
gaussian_kernel_sigma=0.0,
338+
cache_probabilites=False,
339+
max_distance=float("inf"),
337340
):
338341
"""Enable structural plasticity for the network simulation
339342

testsuite/pytests/test_sp/test_sp_manager.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ def test_register_synapses(self):
6666
nest.structural_plasticity_synapses = {"syn1": syn_dict}
6767
kernel_status = nest.structural_plasticity_synapses
6868
assert "syn1" in kernel_status
69-
for kv in extract_dict_a_from_b(
70-
kernel_status["syn1"], syn_dict
71-
).items():
69+
for kv in extract_dict_a_from_b(kernel_status["syn1"], syn_dict).items():
7270
assert kv in kernel_status["syn1"].items()
7371

7472
def test_min_max_delay_using_default_delay(self):

testsuite/pytests/test_sp/test_sp_manager_spatial.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# test_sp_manager.py
3+
# test_sp_manager_spatial.py
44
#
55
# This file is part of NEST.
66
#
@@ -120,9 +120,7 @@ def test_structural_plasticity_with_positions(self):
120120
positions=nest.spatial.free(pos=positions.tolist()),
121121
)
122122

123-
nest.EnableStructuralPlasticity(
124-
use_gaussian_kernel=True, gaussian_kernel_sigma=1.0
125-
)
123+
nest.EnableStructuralPlasticity(use_gaussian_kernel=True, gaussian_kernel_sigma=1.0)
126124
nest.Simulate(10.0)
127125

128126
connections = nest.GetConnections(neurons, neurons, synapse_model="sp_synapse")
@@ -168,9 +166,7 @@ def test_distance_dependent_without_positions(self):
168166

169167
# Expecting a NEST CppException due to missing positions
170168
with self.assertRaises(nest.NESTErrors.CppException) as context:
171-
nest.EnableStructuralPlasticity(
172-
use_gaussian_kernel=True, gaussian_kernel_sigma=1.0
173-
)
169+
nest.EnableStructuralPlasticity(use_gaussian_kernel=True, gaussian_kernel_sigma=1.0)
174170
nest.Simulate(10.0)
175171

176172
# Check the error message

0 commit comments

Comments
 (0)