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

Allow to disconnect with SynapseCollections as arguments #2488

Merged
merged 7 commits into from
Nov 10, 2022

Conversation

hakonsbm
Copy link
Contributor

@hakonsbm hakonsbm commented Oct 4, 2022

Makes it possible to disconnect using a SynapseCollection.

Example:

nodes_a = nest.Create('iaf_psc_alpha', 10)
nodes_b = nest.Create('iaf_psc_exp', 5)
nest.Connect(nodes_a, nodes_a)
nest.Connect(nodes_a, nodes_b)

conns = nest.GetConnections(source=nodes_a, target=nodes_a)

# Only connections gathered from GetConnections() are disconnected.
nest.Disconnect(conns)  
# Alternatively:
conns.disconnect()

Fixes #1457.

@hakonsbm hakonsbm 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 Oct 4, 2022
@hakonsbm hakonsbm added this to PRs in progress in Kernel via automation Oct 4, 2022
Copy link
Member

@nicolossus nicolossus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I only have a very minor suggestion.

pynest/nest/lib/hl_api_connections.py Outdated Show resolved Hide resolved
Co-authored-by: Nicolai Haug <39106781+nicolossus@users.noreply.github.com>
Copy link
Member

@nicolossus nicolossus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks! I only have one comment about the location of the code.

As this changes the PyNEST API, it definitely also needs a sentence in the release notes.

nestkernel/nestmodule.cpp Outdated Show resolved Hide resolved
@hakonsbm hakonsbm requested a review from jougs November 10, 2022 11:46
Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my comments so quickly.

@jougs jougs changed the title Disconnect with SynapseCollection Allow to disconnect with SynapseCollections as arguments Nov 10, 2022
@jougs jougs merged commit dcc103b into nest:master Nov 10, 2022
Kernel automation moved this from PRs in progress to Done (PRs and issues) Nov 10, 2022
@hakonsbm hakonsbm deleted the sc_disconnect branch November 10, 2022 13:41
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 T: Enhancement New functionality, model or documentation
Projects
Kernel
  
Done
Development

Successfully merging this pull request may close these issues.

Suggestion nest3: Disconnect with SynapseCollection
3 participants