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

SelectNodesByMask() and DumpLayerConnections() combination problem #3154

Open
xavierotazuGDS opened this issue Mar 14, 2024 · 1 comment
Open
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority stale Automatic marker for inactivity, please have another look here T: Enhancement New functionality, model or documentation
Projects

Comments

@xavierotazuGDS
Copy link

xavierotazuGDS commented Mar 14, 2024

Is your feature request related to a problem? Please describe.
It is not possible to use the output (NodeCollection) of SelectNodesByMask() as an input to DumpLayerConnections().

Describe the solution you'd like
One possibility is to use the output of SelectNodesByMask() as input (layer) to DumpLayerConnections().

Another possibility would be to implement a DumpConnections(my_connections) functions that save to file the connections of imput parameter 'my_connections' (in this case they would be obtained by SelectNodesByMask() )

Describe alternatives you've considered
I am using this as a workaround (trying to use a subset of a layer) to avoid calling DumpLayerConnections() with a whole layer, because DumpLayerConnections() is very slow (see issue #3142).

Additional context
The following code raises the error: nest.lib.hl_api_exceptions.LayerExpected:
LayerExpected in SLI function DumpLayerConnections_os_g_g_l

import nest

pos = nest.spatial.grid(shape = [100,100] )

input_l = nest.Create('iaf_psc_alpha', positions=pos)
layer_0 = nest.Create('iaf_psc_alpha', positions=pos)

conn_neur = {'rule':'pairwise_bernoulli', 'mask': {'grid':{'shape':[10,10]}} }
syn_0 = {'synapse_model': 'static_synapse'}

nest.Connect(input_l, layer_0, conn_neur, syn_0)

mask_specs = {'lower_left':[-0.25,-0.25], 'upper_right':[0.25,0.25]}
mask_obj = nest.CreateMask(masktype='rectangular', specs=mask_specs, anchor=[0.0,0.0])
center_neur = nest.SelectNodesByMask(layer_0,[0.0,0.0],mask_obj)
nest.DumpLayerConnections(input_l,center_neur, 'static_synapse', 'conn.txt')

@gtrensch gtrensch added T: Enhancement New functionality, model or documentation S: Normal Handle this with default priority I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Mar 22, 2024
@gtrensch gtrensch added this to To do (open issues) in Kernel via automation Mar 22, 2024
Copy link

Issue automatically marked stale!

@github-actions github-actions bot added the stale Automatic marker for inactivity, please have another look here label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority stale Automatic marker for inactivity, please have another look here T: Enhancement New functionality, model or documentation
Projects
Kernel
  
To do (open issues)
Development

No branches or pull requests

2 participants