diff --git a/README.md b/README.md index 5b227c55..0ba7a0ed 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://github.com/dbbs-lab/bsb-core/actions/workflows/build.yml/badge.svg)](https://github.com/dbbs-lab/bsb-core/actions/workflows/build.yml) +[![Build Status](https://github.com/dbbs-lab/bsb-core/actions/workflows/main.yml/badge.svg)](https://github.com/dbbs-lab/bsb-core/actions/workflows/main.yml) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Documentation Status](https://readthedocs.org/projects/bsb/badge/?version=latest)](https://bsb.readthedocs.io/en/latest/?badge=latest) [![codecov](https://codecov.io/gh/dbbs-lab/bsb-core/branch/main/graph/badge.svg)](https://codecov.io/gh/dbbs-lab/bsb-core) diff --git a/bsb/placement/arrays.py b/bsb/placement/arrays.py index d7a20317..94b05817 100644 --- a/bsb/placement/arrays.py +++ b/bsb/placement/arrays.py @@ -83,7 +83,7 @@ def place(self, chunk, indicators): cells[(i * len(x)) : ((i + 1) * len(x)), 1] = y cells[(i * len(x)) : ((i + 1) * len(x)), 2] = z # Place all the cells in 1 batch (more efficient) - positions = cells[cells[:, 0] < width - radius] + positions = cells[cells[:, 0] < prt.data.ldc[0] + width - radius] # Determine in which chunks the cells must be placed cs = self.scaffold.configuration.network.chunk_size diff --git a/tests/test_placement.py b/tests/test_placement.py index 09e6c26c..5483e689 100644 --- a/tests/test_placement.py +++ b/tests/test_placement.py @@ -342,6 +342,38 @@ def test_parallel_arrays(self): self.assertAll(pos[:, 1] <= cfg.partitions.test_layer.data.mdc[1], "not in layer") self.assertAll(pos[:, 1] >= cfg.partitions.test_layer.data.ldc[1], "not in layer") + def test_regression_issue_889(self): + cfg = Configuration.default( + regions={ + "cerebellar_cortex": {"type": "group", "children": ["purkinje_layer"]} + }, + partitions={ + "purkinje_layer": { + "type": "rhomboid", + "origin": [100, 100, 0], + "dimensions": [100, 100, 15], + } + }, + cell_types={ + "purkinje_cell": { + "spatial": {"planar_density": 0.00045, "radius": 7.5}, + } + }, + placement={ + "purkinje_layer_placement": { + "strategy": "bsb.placement.ParallelArrayPlacement", + "partitions": ["purkinje_layer"], + "cell_types": ["purkinje_cell"], + "spacing_x": 50, + "angle": 0, + } + }, + ) + network = Scaffold(cfg, self.storage) + network.compile(clear=True) + ps = network.get_placement_set("purkinje_cell") + self.assertEqual(4, len(ps), "parallel array placement with offset is broken") + class TestVoxelDensities(RandomStorageFixture, unittest.TestCase, engine_name="hdf5"): def test_particle_vd(self):