nest / nestml

A domain specific language for neuron and synapse models in spiking neural network simulation
GNU General Public License v2.0
46 stars 45 forks source link

Introduce ``ASTExternalVariableType`` #1073

Open clinssen opened 3 months ago

clinssen commented 3 months ago

This is a design idea for a refactoring/cleanup.

ASTExternalVariable now covers several scenarios: fetch a variable from the postsynaptic partner, fetch a variable from the postsynaptic partner at a specific time in the spiking history buffer, and at a specific time in a continuous-time history buffer.

To keep these cases separated, it might be an option to introduce a variable type enum covering each of these cases as a class attribute.

This would help to clean up the following lines of code in the printer:

https://github.com/nest/nestml/blob/dea633c46ecbb328637a28aa443c4866f51fec4b/pynestml/codegeneration/printers/nest_variable_printer.py#L65