Skip to content

Comments

Step 7 - Single PSM code string#612

Merged
neworderofjamie merged 4 commits intogenn_5from
single_psm
Jan 31, 2024
Merged

Step 7 - Single PSM code string#612
neworderofjamie merged 4 commits intogenn_5from
single_psm

Conversation

@neworderofjamie
Copy link
Contributor

This is the last syntax change I want to make. Previously, postsynaptic models had two code strings "decay code" and "apply input code" (the latter of which could also be configured via "custom converter code" in C++ for backward compatibility). This separation doesn't really make any sense and it's not obvious (if you'd asked me before I made this change, I couldn't tell you) what order they're run in. With this change:

exp_curr_model = create_postsynaptic_model(
        "exp_curr",
        decay_code=
        """
        inSyn *= expDecay;
        """,
        apply_input_code=
        """
        Isyn += init * inSyn;
        """,
        params=["tau"],
        derived_params=[....])

becomes:

exp_curr_model = create_postsynaptic_model(
        "exp_curr",
        sim_code=
        """
        injectCurrent(init * inSyn);
        inSyn *= expDecay;
        """,
        params=["tau"],
        derived_params=[....])

The user is no longer expected to know that Isyn is a magical thing you can only meaningfully add to (and can be renamed by setting post_target_var on the synapse group) and the injection of current uses the same syntax as current sources.

Base automatically changed from event_merging to genn_5 January 31, 2024 10:02
Copy link
Member

@tnowotny tnowotny left a comment

Choose a reason for hiding this comment

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

Yes, I think this is worth doing and makes things simpler and more sensible.

@neworderofjamie neworderofjamie merged commit 5678911 into genn_5 Jan 31, 2024
@neworderofjamie neworderofjamie deleted the single_psm branch January 31, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants