Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pynest/nest/lib/hl_api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,26 @@ def __str__(self):
def __repr__(self):
return sli_func("pcvs", self._datum)

@property
def positions(self) -> tuple | tuple(tuple):
"""
Return the spatial locations.

Returns
-------
tuple or tuple of tuple(s):
Tuple of position with 2- or 3-elements or list of positions

Notes
-----
In an MPI-parallel simulation, this returns only positions for nodes on the current MPI rank.
"""

if not self.spatial:
raise BadProperty("NodeCollection has no spatial positions.")

return self.spatial['positions']

def get(self, *params, **kwargs):
"""
Get parameters from nodes.
Expand Down
Loading