-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from sparsh-989/Template_Support
Template support
- Loading branch information
Showing
21 changed files
with
276 additions
and
358 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Monitors variable{{ expander.check_plural(group['variables']) }}: {%- for var in group['variables'] -%} | ||
{{ expander.render_expression(var) }}{%- if not loop.last -%}, {%- endif -%} | ||
{%- endfor %} of {{ expander.expand_SpikeSource(group['source']) }} {%- if group['record'] is boolean -%} | ||
{%- if group['record'] -%} for all members {%- else -%} for no member {%- endif -%} | ||
{%- else -%} | ||
{%- if group['record']|length == 0 -%} for no member {%- else -%} for member{{ expander.check_plural(group['record']) }}: {{ group['record'] | join(', ') }} {%- endif -%} | ||
{%- endif -%} when event **{{ group['event'] }}** is triggered |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| **Monitors** | **Variables** | **Source** | **Record** | **Event** | | ||
|-----------------|------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|------------------------------------------------------------------------------------------------------------|-------------------------------------| | ||
| Monitors variable{{ expander.check_plural(group['variables']) }}: {%- for var in group['variables'] -%} | ||
{{ expander.render_expression(var) }}{%- if not loop.last -%}, {%- endif -%} | ||
{%- endfor %} | of {{ expander.expand_SpikeSource(group['source']) }} | | ||
{%- if group['record'] is boolean -%} | ||
{%- if group['record'] -%} for all members {%- else -%} for no member {%- endif -%} | ||
{%- else -%} | ||
{%- if group['record']|length == 0 -%} for no member {%- else -%} for member{{ expander.check_plural(group['record']) }}: {{ group['record'] | join(', ') }} {%- endif -%} | ||
{%- endif -%} | when event **{{ group['event'] }}** is triggered | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## Network details | ||
**Neuron population:** | ||
Group {{ (group['name']) }}, consisting of {{ (group['N']) }} neurons. | ||
{{ tab }}{{ ('Model dynamics:') }} | ||
{{ expander.expand_equations(group['equations']) }} | ||
{% if group['user_method'] %} | ||
{{ tab }}The equations are integrated with the '{{ group['user_method'] }}' method. | ||
{% endif %} | ||
{% if 'events' in group %} | ||
{{ tab }}{{ ('Events:') }} | ||
{{ expander.expand_events(group['events']) }} | ||
{% endif %} | ||
{% if 'identifiers' in group %} | ||
{{ tab }}{{ ('Constants:') }} {{ expander.expand_identifiers(group['identifiers']) }} | ||
{% endif %} | ||
{% if not expander.keep_initializer_order and 'initializer' in group and group['initializer']|length %} | ||
{{ tab }}{{ ('Initial values:') }} | ||
{% for initializer in group['initializer'] %} | ||
{{ tab }}* {{ expander.expand_initializer(initializer) }} | ||
{% endfor %} | ||
{% endif %} | ||
{% if 'run_regularly' in group %} | ||
{{ tab }}{{ ('Run regularly') }}{{ expander.check_plural(group['run_regularly']) }}: | ||
{% for run_reg in group['run_regularly'] %} | ||
{{ expander.expand_runregularly(run_reg) }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|-------------------------------|------------------------------------------------| | ||
| **Neuron population** | Group {{ (group['name']) }}, consisting of {{ (group['N']) }} neurons. | | ||
| **Model dynamics** | {{ expander.expand_equations(group['equations']) }} | | ||
| **Integration method** | {% if group['user_method'] %} The equations are integrated with the '{{ group['user_method'] }}' method. {% endif %} | | ||
| **Events** (if present) | {% if 'events' in group %} {{ expander.expand_events(group['events']) }} {% endif %} | | ||
| **Constants** (if present) | {% if 'identifiers' in group %} {{ expander.expand_identifiers(group['identifiers']) }} {% endif %} | | ||
| **Initial values** (if present)| {% if not expander.keep_initializer_order and 'initializer' in group and group['initializer']|length %} {% for initializer in group['initializer'] %} {{ initializer.variable }}: {{ initializer.value }}{% if initializer.unit %} [{{ initializer.unit }}]{% endif %} {% if not loop.last %}\n{% endif %}{% endfor %} {% endif %} | | ||
| **Run regularly** (if present)| {% if 'run_regularly' in group %} {% for run_reg in group['run_regularly'] %} {{ expander.expand_runregularly(run_reg) }} {% if not loop.last %}\n{% endif %}{% endfor %} {% endif %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Name {{ group['name'] }} of population size {{ group['N'] }} and rate as {{ expander.render_expression(group['rates']) }}. | ||
|
||
{% if group.get('identifiers', None) %} | ||
Constants: | ||
{{ expander.expand_identifiers(group['identifiers']) }} | ||
{% endif %} | ||
|
||
{% if group.get('run_regularly', None) %} | ||
Run regularly: | ||
{% for run_reg in group['run_regularly'] %} | ||
{{ expander.expand_runregularly(run_reg) }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
| **Variable** | **Value** | | ||
|---------------------------------|------------------------------------------------| | ||
| **Name** | {{ group['name'] }} | | ||
| **Population size** | {{ group['N'] }} | | ||
| **Rate** | {{ expander.render_expression(group['rates']) }} | | ||
| **Constants** (if present) | {% if group.get('identifiers', None) %} {{ expander.expand_identifiers(group['identifiers']) }} {% endif %} | | ||
| **Run regularly** (if present) | {% if group.get('run_regularly', None) %} {% for run_reg in group['run_regularly'] %} {{ expander.expand_runregularly(run_reg) }} {% endfor %} {% endif %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{# Jinja2 template for PoissonInput in a simple text format #} | ||
|
||
PoissonInput with size {{ group['N'] }} gives input to variable {{ expander.render_expression(group['target_var']) }} with rate {{ expander.render_expression(group['rate']) }} and weight of {{ expander.render_expression(group['weight']) }}. | ||
|
||
{% if 'identifiers' in group %} | ||
**Constants:** | ||
{% for identifier, value in group['identifiers'].items() %} | ||
- {{ identifier }}: {{ value }} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{# Jinja2 template for PoissonInput in table format #} | ||
|
||
|-------------------------------|------------------------------------------------| | ||
| **PoissonInput Size** | {{ group['N'] }} | | ||
| **Target Variable** | {{ expander.render_expression(group['target_var']) }} | | ||
| **Rate** | {{ expander.render_expression(group['rate']) }} | | ||
| **Weight** | {{ expander.render_expression(group['weight']) }} | | ||
| **Constants** (if present) | {% if 'identifiers' in group %} {% for identifier, value in group['identifiers'].items() %} {{ identifier }}: {{ value }} {% if not loop.last %}\n{% endif %}{% endfor %} {% endif %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{# Jinja2 template for PopRateMonitor in simple text format #} | ||
|
||
Monitors the population of {{ expander.expand_SpikeSource(group['source']) }}. | ||
|
||
{{ endll }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{# Jinja2 template for PopRateMonitor in table format #} | ||
|
||
|-------------------------------|--------------------------------------------------| | ||
| **Monitored Population** | {{ expander.expand_SpikeSource(group['source']) }} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{# Basic information about the SpikeGeneratorGroup #} | ||
{{ tab }}Name {{ (group['name']) }}, | ||
with population size {{ (group['N']) }}, | ||
has neuron{{ 's' if group['indices']|length > 1 else '' }}: | ||
{{ expander.prepare_array(group['indices']) }} | ||
that spike at times | ||
{{ expander.prepare_array(group['times']) }}, | ||
with period {{ group['period'] }}. | ||
{{ endll }} | ||
|
||
{# Check for the 'run_regularly' key and expand if it exists #} | ||
{% if 'run_regularly' in group %} | ||
{{ tab }}{{ ('Run regularly:') }} | ||
{{ endll }} | ||
{% for run_reg in group['run_regularly'] %} | ||
{{ expander.expand_runregularly(run_reg) }} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{# Jinja2 template for SpikeGeneratorGroup in table format #} | ||
|
||
|-------------------------------|------------------------------------------------| | ||
| **Name** | {{ group['name'] }} | | ||
| **Population Size** | {{ group['N'] }} | | ||
| **Neurons** | {{ expander.prepare_array(group['indices']) }} | | ||
| **Spike Times** | {{ expander.prepare_array(group['times']) }} | | ||
| **Period** | {{ group['period'] }} | | ||
| **Run Regularly** (if present) | {% if 'run_regularly' in group %} {% for run_reg in group['run_regularly'] %} {{ expander.expand_runregularly(run_reg) }}{% if not loop.last %}\n{% endif %}{% endfor %} {% endif %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{%extends "EventMonitor-default.md" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{%extends "EventMonitor-table.md" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{# Jinja2 template for Statemon in simple text format #} | ||
Monitors variable{{ expander.check_plural(group['variables']) }}: {%- for var in group['variables'] -%} | ||
{{ expander.render_expression(var) }}{%- if not loop.last -%}, {%- endif -%} | ||
{%- endfor %} of {{ expander.expand_SpikeSource(group['source']) }} {%- if group['record'] is boolean -%} | ||
{%- if group['record'] -%} for all members {%- else -%} for no member {%- endif -%} | ||
{%- else -%} | ||
{%- if group['record']|length == 0 -%} for no member {%- else -%} for member{{ expander.check_plural(group['record']) }}: {{ group['record'] | join(', ') }} {%- endif -%} | ||
{%- endif -%} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| **Monitors** | **Variables** | **Source** | **Record** | | ||
|-----------------|------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|------------------------------------------------------------------------------------------------------------| | ||
| Monitors variable{{ expander.check_plural(group['variables']) }}: {%- for var in group['variables'] -%} | ||
{{ expander.render_expression(var) }}{%- if not loop.last -%}, {%- endif -%} | ||
{%- endfor %} | of {{ expander.expand_SpikeSource(group['source']) }} | | ||
{%- if group['record'] is boolean -%} | ||
{%- if group['record'] -%} for all members {%- else -%} for no member {%- endif -%} | ||
{%- else -%} | ||
{%- if group['record']|length == 0 -%} for no member {%- else -%} for member{{ expander.check_plural(group['record']) }}: {{ group['record'] | join(', ') }} {%- endif -%} | ||
{%- endif -%} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Connections {{ group['name'] }}, connecting {{ expander.expand_SpikeSource(group['source']) }} to {{ expander.expand_SpikeSource(group['target']) }} | ||
{% if not expander.keep_initializer_order and 'connectors' in group and group['connectors']|length -%} | ||
{{ tab }}{{ expander.expand_connector(group['connectors'][0]) }} | ||
{% endif %} | ||
{% if 'equations' in group -%} | ||
{{ tab }}{{ bold('Model dynamics:') }} | ||
{{ expander.expand_equations(group['equations']) }} | ||
{% if 'user_method' in group -%} | ||
{{ tab }}The equations are integrated with the '{{ group['user_method'] }}' method.{{ endll }} | ||
{% endif %} | ||
{% endif %} | ||
{% if 'pathways' in group -%} | ||
{{ expander.expand_pathways(group['pathways']) }} | ||
{% if 'equations' not in group and 'identifiers' in group -%} | ||
{{ tab }}, where {{ expander.expand_identifiers(group['identifiers']) }}. | ||
{% endif %} | ||
{% endif %} | ||
{% if 'summed_variables' in group -%} | ||
{{ tab }}{{ bold('Summed variables:') }} | ||
{{ expander.expand_summed_variables(group['summed_variables']) }} | ||
{% endif %} | ||
{% if 'identifiers' in group and 'equations' in group -%} | ||
{{ tab }}{{ bold('Constants:') }} {{ expander.expand_identifiers(group['identifiers']) }} | ||
{% endif %} | ||
{% if not expander.keep_initializer_order and 'initializer' in group and group['initializer']|length -%} | ||
{{ tab }}{{ bold('Initial values:') }} | ||
{% for initializer in group['initializer'] -%} | ||
{{ tab }}* {{ expander.expand_initializer(initializer) }} | ||
{% endfor %} | ||
{% endif %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|-------------------------------|------------------------------------------------| | ||
| **Connections** | {{ group['name'] }}, connecting {{ expander.expand_SpikeSource(group['source']) }} to {{ expander.expand_SpikeSource(group['target']) }} | | ||
| **Connector** (if present) | {% if not expander.keep_initializer_order and 'connectors' in group and group['connectors']|length %} {{ expander.expand_connector(group['connectors'][0]) }} {% endif %} | | ||
| **Model dynamics** (if present)| {% if 'equations' in group %} {% for key, eqn in group['equations'].items() %} $\frac{d}{d t} {{ key }}$ = {{ eqn.expr }}{% if eqn.unit %} [{{ eqn.unit }}]{% endif %} {% if not loop.last %}\n{% endif %}{% endfor %} {% endif %} | | ||
| **Integration method** (if present) | {% if 'user_method' in group %} The equations are integrated with the '{{ group['user_method'] }}' method. {% endif %} | | ||
| **Pathways** (if present) | {% if 'pathways' in group %} {{ expander.expand_pathways(group['pathways']) }} {% if 'equations' not in group and 'identifiers' in group %} , where {{ expander.expand_identifiers(group['identifiers']) }}. {% endif %} {% endif %} | | ||
| **Summed variables** (if present) | {% if 'summed_variables' in group %} {{ expander.expand_summed_variables(group['summed_variables']) }} {% endif %} | | ||
| **Constants** (if present) | {% if 'identifiers' in group and 'equations' in group %} {% for identifier, value in group['identifiers'].items() %} {{ identifier }}: {{ value }} {% if not loop.last %}\n{% endif %}{% endfor %} {% endif %} | | ||
| **Initial values** (if present) | {% if not expander.keep_initializer_order and 'initializer' in group and group['initializer']|length %} {% for initializer in group['initializer'] %} {{ initializer.variable }}: {{ initializer.value }}{% if initializer.unit %} [{{ initializer.unit }}]{% endif %} {% if not loop.last %}\n{% endif %}{% endfor %} {% endif %} | |