-
Notifications
You must be signed in to change notification settings - Fork 356
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 setting volume_transmitter via NodeCollection, instead of naked ID #2853
Conversation
We should probably add a 4.0-tag here, unless that's what "Behavior changes" stands for. But for me that sounds more like a "no API change, just behavioral changes" and that's not the case here. |
As we don't have too many releases and the major releases are often many years apart, we don't adhere to a no-API-changes-in-minor-versions policy too strictly. We usually try to deprecate things at least one release in advance, but have not been totally consistent with that if we deemed that only a small fraction of users will be affected by the change. For example, in NEST 3.4 we have removed some deprecated exotic models and changed the default port for NEST Server. In case of problems, we can always assist people on the mailing list or here in the issue tracker. |
The PR looks good, we just need to correct #2168 |
Interestingly, clang can't compile the same code that gcc compiles. |
Yes, this is odd. But then again, the code is also not really nice and I even struggled a bit to get it to compile on gcc... In the new code we now have My naive thinking was that I should be able to upcast the wr_e.set_receiver( *static_cast< Node* >( cp.get_weight_recorder() ) ); This, however did not even work on gcc and I resorted to the Interestingly, the equivalent C-cast seems to work (at least on gcc): wr_e.set_receiver( *( Node* )( cp.get_weight_recorder() ) ); As does a two line construct that skips explicit casts altogether: Node* wr_tmp = cp.get_weight_recorder();
wr_e.set_receiver( *wr_tmp ); I am leaning towards the last solution, as that is most explicit. What do you think, @JanVogelsang? |
I don't understand why a simple |
Ha! It definitely helps to read the full error message, including the notes 😅
The problem was that the file in question did not include Fixed in db99d60. |
This PR mainly fixes #2152 by allowing to set the
volume_transmitter
on thestdp_dopamine_synapse
using a NodeCollection instead of a naked ID.As this breaks all existing code involving these two models, I took the liberty to also rename the property vt of
stdp_dopamine_synapse
to volume_transmitter as suggested in a comment in the original issue.As the
weight_recorder
is meant to be handled in pretty much the same way as thevolume_transmitter
, I also streamlined the code doing that, so it is more similar. I have also added a type check to that code, so it is less prone to errors.On the way, I added
NodeCollection::create(Node*)
, which allows to conveniently create a NodeCollection from an existing node from a pointer.I also removed the apparently unused function
CommonSynapseProperties::get_node()