Skip to content

Commit

Permalink
fix: integrate feedback from review
Browse files Browse the repository at this point in the history
  • Loading branch information
drodarie committed Aug 14, 2024
1 parent e27811a commit 4f4b037
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions bsb_nest/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ def predict_mem_iterator(self, pre_nodes, post_nodes, cs):
len(pre_nodes) * 8 * 2 + len(post_nodes) * 8 * 2 + len(cs) * 6 * 8 * (16 + 2)
) * MPI.get_size()
n_chunks = len(cs.get_local_chunks("out"))
predicted_local_mem = (
(predicted_all_mem / n_chunks)
if n_chunks > 0
else 0.0
)
predicted_local_mem = (predicted_all_mem / n_chunks) if n_chunks > 0 else 0.0
if predicted_local_mem > avmem / 2:
# Iterate block-by-block
return self.block_iterator(cs)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_nest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ def spy(_):
self.assertGreaterEqual(err_var, var_rate - expected_var)

@patch("bsb_hdf5.connectivity_set.ConnectivitySet.get_local_chunks")
def test_empty_conn(self, get_content_mock):
def test_regression_issue_9(self, get_content_mock):
# Override get_local_chunks to test empty connection sets
get_content_mock.return_value = []
cfg = get_test_config("gif_pop_psc_exp")
# we delete the NEST connectivity rule
cfg.simulations["test_nest"].connection_models["gif_pop_psc_exp"].rule = None
network = Scaffold(cfg, self.storage)
network.compile()
# The simulation should run despite the absence of connections
network.run_simulation("test_nest")

def test_brunel(self):
Expand Down

0 comments on commit 4f4b037

Please sign in to comment.