Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ackurth opened this issue Jun 12, 2022 · 1 comment · Fixed by #2415
Assignees
Labels
I: User Interface Users may need to change their code due to changes in function calls S: Critical Needs to be addressed immediately stale Automatic marker for inactivity, please have another look here T: Bug Wrong statements in the code or documentation

Comments

@ackurth
Copy link
Contributor

ackurth commented Jun 12, 2022

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 ackurth changed the title After slicing spatial metadata (especially positions) is incorrect in NEST >= 3.2 After slicing node collection, spatial metadata (especially positions) is incorrect in NEST >= 3.2 Jun 12, 2022
@terhorstd terhorstd added T: Bug Wrong statements in the code or documentation S: Critical Needs to be addressed immediately I: User Interface Users may need to change their code due to changes in function calls labels Jun 13, 2022
@github-actions
Copy link

Issue automatically marked stale!

@github-actions github-actions bot added the stale Automatic marker for inactivity, please have another look here label Aug 12, 2022
@jessica-mitchell jessica-mitchell moved this to Done in PyNEST Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: User Interface Users may need to change their code due to changes in function calls S: Critical Needs to be addressed immediately stale Automatic marker for inactivity, please have another look here T: Bug Wrong statements in the code or documentation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants