nest-simulator icon indicating copy to clipboard operation
nest-simulator copied to clipboard

After slicing node collection, spatial metadata (especially positions) is incorrect in NEST >= 3.2

Open ackurth opened this issue 2 years ago • 1 comments

Describe the bug When creating a node collection with spatial metadata containing more than one node, slicing and then fetching the positions of the nodes returns the positions of the unsliced node collection

To Reproduce Steps to reproduce the behavior:

import nest

pos = nest.spatial.free(nest.random.uniform(min=-1, max=1), num_dimensions=2)
neurons = nest.Create('iaf_psc_exp', 4, positions=pos)

print('Unsliced spatial metadata')
print(neurons.spatial['positions'])

print('Metadata of first neuron (sliced)')
print(neurons[0].spatial['positions'])

Expected behavior Current output of script (NEST 3.{2,3})

Unsliced spatial metadata
((-0.8159621639194029, 0.5941591316888912), (0.9729112299093539, 0.8045728891036548), (0.14663393556443527, 0.9932176868300935), (0.5942436258656982, 0.14225231771482116))
Metadata of first neuron (sliced)
((-0.8159621639194029, 0.5941591316888912), (0.9729112299093539, 0.8045728891036548), (0.14663393556443527, 0.9932176868300935), (0.5942436258656982, 0.14225231771482116))t:

Expected output (NEST 3.{0,1})

Unsliced spatial metadata
((0.6056290698729638, 0.8032383312784959), (0.30696417498750406, 0.06813707528606527), (0.07954423852188541, 0.48527301645329035), (-0.9040011501580714, 0.4658873531315879))
Metadata of first neuron (sliced)
((0.6056290698729638, 0.8032383312784959),)

Desktop/Environment (please complete the following information):

  • Python 3.9.7
  • GCC 11.2.0
  • macOS Monterey (12.2) or
  • Python 3.8.12
  • GCC 9.3.0
  • ubuntu 20.04.3

Additional context Tested with @jasperalbers

ackurth avatar Jun 12 '22 15:06 ackurth

Issue automatically marked stale!

github-actions[bot] avatar Aug 12 '22 08:08 github-actions[bot]