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

Step 7 - Single PSM code string #612

Merged
merged 4 commits into from
Jan 31, 2024
Merged

Step 7 - Single PSM code string #612

merged 4 commits into from
Jan 31, 2024

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
1 check passed
@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