pynestml.codegeneration.printers package
Submodules
pynestml.codegeneration.printers.ast_printer module
- class pynestml.codegeneration.printers.ast_printer.ASTPrinter
Bases:
objectPrinter for ``ASTNode``s.
Printers are instantiated rather than having only static methods. This is the “compositionality over inheritance” pattern, chosen because “lower” grammar elements need to be printed in different ways (for instance, references to variables which could live in different data structures depending on the context) while the “higher” grammar element printers stay the same (for instance, printing a composite expression).
Some printers have internal parameters/settings, like the
with_vector_parameterattribute of theNESTVariablePrinter.
pynestml.codegeneration.printers.c_simple_expression_printer module
- class pynestml.codegeneration.printers.c_simple_expression_printer.CSimpleExpressionPrinter(variable_printer: VariablePrinter, constant_printer: ConstantPrinter, function_call_printer: FunctionCallPrinter)
Bases:
SimpleExpressionPrinterPrinter for ASTSimpleExpressions in C syntax.
- print_simple_expression(node: ASTSimpleExpression) str
Print a simple expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.constant_printer module
pynestml.codegeneration.printers.cpp_expression_printer module
- class pynestml.codegeneration.printers.cpp_expression_printer.CppExpressionPrinter(simple_expression_printer: SimpleExpressionPrinter)
Bases:
ExpressionPrinterPrinter for
ASTExpressionnodes in C++ syntax.- print_expression(node: ASTExpressionNode) str
Print an expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.cpp_function_call_printer module
- class pynestml.codegeneration.printers.cpp_function_call_printer.CppFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
FunctionCallPrinterPrinter for ASTFunctionCall in C++ syntax.
- print_function_call(function_call: ASTFunctionCall) str
Print a function call, including bracketed arguments list.
- Parameters:
node – The function call node to print.
- Returns:
The function call string.
- Return type:
s
pynestml.codegeneration.printers.cpp_printer module
- class pynestml.codegeneration.printers.cpp_printer.CppPrinter(expression_printer: ExpressionPrinter)
Bases:
ModelPrinterThis class can be used to print any ASTNode to C++ syntax.
- print_assignment(node: ASTAssignment) str
- print_comparison_operator(node: ASTComparisonOperator) str
- print_delay_parameter(variable: VariableSymbol) str
Prints the delay parameter :param variable: Variable with delay parameter :return: the corresponding delay parameter
- print_expression(node: ASTExpressionNode) str
Prints the handed over rhs to a nest readable format. :param node: a single meta_model node. :return: the corresponding string representation
- print_function_call(node: ASTFunctionCall) str
- print_simple_expression(node: ASTSimpleExpression) str
- print_variable(node: ASTVariable) str
pynestml.codegeneration.printers.cpp_simple_expression_printer module
- class pynestml.codegeneration.printers.cpp_simple_expression_printer.CppSimpleExpressionPrinter(variable_printer: VariablePrinter, constant_printer: ConstantPrinter, function_call_printer: FunctionCallPrinter)
Bases:
CSimpleExpressionPrinterPrinter for ASTSimpleExpressions in C++ syntax.
- print_simple_expression(node: ASTSimpleExpression) str
Print a simple expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.cpp_type_symbol_printer module
- class pynestml.codegeneration.printers.cpp_type_symbol_printer.CppTypeSymbolPrinter
Bases:
TypeSymbolPrinterReturns a C++ syntax version of the handed over type.
- print(type_symbol: TypeSymbol) str
Converts the name of the type symbol to a corresponding nest representation. :param type_symbol: a single type symbol :return: the corresponding string representation.
pynestml.codegeneration.printers.cpp_variable_printer module
- class pynestml.codegeneration.printers.cpp_variable_printer.CppVariablePrinter(expression_printer: ExpressionPrinter)
Bases:
VariablePrinter- print_variable(node: ASTVariable) str
Print a variable. :param node: a single variable symbol or variable :return: a string representation
pynestml.codegeneration.printers.expression_printer module
- class pynestml.codegeneration.printers.expression_printer.ExpressionPrinter(simple_expression_printer: SimpleExpressionPrinter)
Bases:
ASTPrinterConverts expressions to the executable platform dependent code.
This class is used to transform only parts of the grammar and not NESTML as a whole.
- abstract print_expression(node: ASTExpressionNode) str
Print an expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.function_call_printer module
- class pynestml.codegeneration.printers.function_call_printer.FunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
ASTPrinterConverts function calls to the executable platform dependent code.
This class is used to transform only parts of the grammar and not NESTML as a whole.
- abstract print_function_call(node: ASTFunctionCall) str
Print a function call.
- Parameters:
node – The node to print.
- Returns:
The string representation.
- Return type:
s
pynestml.codegeneration.printers.gsl_variable_printer module
- class pynestml.codegeneration.printers.gsl_variable_printer.GSLVariablePrinter(expression_printer: ExpressionPrinter)
Bases:
CppVariablePrinterReference converter for C++ syntax and using the GSL (GNU Scientific Library) API from inside the
extern "C"stepping function.- print_variable(node: ASTVariable) str
Converts a single name reference to a gsl processable format. :param node: a single variable :return: a gsl processable format of the variable
pynestml.codegeneration.printers.latex_expression_printer module
- class pynestml.codegeneration.printers.latex_expression_printer.LatexExpressionPrinter(simple_expression_printer: SimpleExpressionPrinter)
Bases:
ExpressionPrinterExpressions printer for LaTeX. Assumes to be printing in a LaTeX environment where math mode is already on.
- print(node: ASTExpressionNode) str
- print_expression(node: ASTExpressionNode) str
Print an expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
- print_function_call(function_call) str
Print function call.
- Parameters:
function_call (ASTFunctionCall) – a function call
- Returns:
the corresponding string representation
pynestml.codegeneration.printers.latex_function_call_printer module
- class pynestml.codegeneration.printers.latex_function_call_printer.LatexFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
FunctionCallPrinterPrinter for ASTFunctionCall in LaTeX syntax.
- print_function_call(function_call: ASTFunctionCall) str
Print a function call.
- Parameters:
node – The node to print.
- Returns:
The string representation.
- Return type:
s
pynestml.codegeneration.printers.latex_simple_expression_printer module
- class pynestml.codegeneration.printers.latex_simple_expression_printer.LatexSimpleExpressionPrinter(variable_printer: VariablePrinter, constant_printer: ConstantPrinter, function_call_printer: FunctionCallPrinter)
Bases:
SimpleExpressionPrinterPrinter for ASTSimpleExpressions in LaTeX syntax.
- print_simple_expression(node: ASTSimpleExpression) str
Print a simple expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.latex_variable_printer module
- class pynestml.codegeneration.printers.latex_variable_printer.LatexVariablePrinter(expression_printer: ExpressionPrinter)
Bases:
VariablePrinter- print_variable(node: ASTVariable) str
Convert name reference.
- Parameters:
ast_variable – a single variable
- Returns:
the corresponding string representation
pynestml.codegeneration.printers.model_printer module
- class pynestml.codegeneration.printers.model_printer.ModelPrinter
Bases:
ASTPrinterGeneric base class for printing any ASTNode.
- print_arithmetic_operator(node: ASTArithmeticOperator) str
- print_assignment(node: ASTAssignment) str
- print_bit_operator(node: ASTBitOperator) str
- print_block_with_variables(node: ASTBlockWithVariables) str
- print_comparison_operator(node: ASTComparisonOperator) str
- print_compilation_unit(node: ASTNestMLCompilationUnit) str
- print_compound_stmt(node: ASTCompoundStmt) str
- print_data_type(node: ASTDataType) str
- print_declaration(node: ASTDeclaration) str
- print_elif_clause(node: ASTElifClause) str
- print_else_clause(node: ASTElseClause) str
- print_equations_block(node: ASTEquationsBlock) str
- print_for_stmt(node: ASTForStmt) str
- print_function(node: ASTFunction) str
- print_if_clause(node: ASTIfClause) str
- print_inline_expression(node: ASTInlineExpression) str
- print_input_block(node: ASTInputBlock) str
- print_input_port(node: ASTInputPort) str
- print_input_qualifier(node: ASTInputQualifier) str
- print_logical_operator(node: ASTLogicalOperator) str
- print_model_body(node: ASTModelBody) str
- print_ode_equation(node: ASTOdeEquation) str
- print_on_condition_block(node: ASTOnConditionBlock) str
- print_on_receive_block(node: ASTOnReceiveBlock) str
- print_output_block(node: ASTOutputBlock) str
- print_parameter(node: ASTParameter) str
- print_return_stmt(node: ASTReturnStmt) str
- print_small_stmt(node: ASTSmallStmt) str
- print_stmts_body(node: ASTStmtsBody) str
- print_unary_operator(node: ASTUnaryOperator) str
- print_unit_type(node: ASTUnitType) str
- print_update_block(node: ASTUpdateBlock) str
- print_variable(node: ASTVariable) str
- print_while_stmt(node: ASTWhileStmt) str
pynestml.codegeneration.printers.nest2_cpp_function_call_printer module
- class pynestml.codegeneration.printers.nest2_cpp_function_call_printer.NEST2CppFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
NESTCppFunctionCallPrinterThis class is used to convert function calls to the GSL (GNU Scientific Library) syntax.
pynestml.codegeneration.printers.nest2_gsl_function_call_printer module
- class pynestml.codegeneration.printers.nest2_gsl_function_call_printer.NEST2GSLFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
NEST2CppFunctionCallPrinterThis class is used to convert function calls to the GSL (GNU Scientific Library) syntax.
pynestml.codegeneration.printers.nest_cpp_function_call_printer module
- class pynestml.codegeneration.printers.nest_cpp_function_call_printer.NESTCppFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
CppFunctionCallPrinterPrinter for ASTFunctionCall in C++ syntax.
pynestml.codegeneration.printers.nest_cpp_type_symbol_printer module
- class pynestml.codegeneration.printers.nest_cpp_type_symbol_printer.NESTCppTypeSymbolPrinter
Bases:
CppTypeSymbolPrinterReturns a C++ syntax version of the handed over type.
- print(type_symbol: TypeSymbol) str
Converts the name of the type symbol to a corresponding nest representation. :param type_symbol: a single type symbol :return: the corresponding string representation.
pynestml.codegeneration.printers.nest_gsl_function_call_printer module
- class pynestml.codegeneration.printers.nest_gsl_function_call_printer.NESTGSLFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
NESTCppFunctionCallPrinterThis class is used to convert function calls to the GSL (GNU Scientific Library) syntax.
pynestml.codegeneration.printers.nest_variable_printer module
- class pynestml.codegeneration.printers.nest_variable_printer.NESTVariablePrinter(expression_printer: ExpressionPrinter, with_origin: bool = True, with_vector_parameter: bool = True, enforce_getter: bool = True, variables_special_cases: Dict[str, str] | None = None)
Bases:
CppVariablePrinterVariable printer for C++ syntax and the NEST API.
- print_variable(variable: ASTVariable) str
Converts a single variable to nest processable format. :param variable: a single variable. :return: a nest processable format.
- set_getter_string(s)
pynestml.codegeneration.printers.nestml_printer module
- class pynestml.codegeneration.printers.nestml_printer.NESTMLPrinter
Bases:
ModelPrinterThis class can be used to print any ASTNode to NESTML syntax.
- dec_indent()
- inc_indent()
- print_arithmetic_operator(node: ASTArithmeticOperator) str
- print_assignment(node: ASTAssignment) str
- print_bit_operator(node: ASTBitOperator) str
- print_block_with_variables(node: ASTBlockWithVariables) str
- print_comparison_operator(node: ASTComparisonOperator) str
- print_compilation_unit(node: ASTNestMLCompilationUnit) str
- print_compound_stmt(node: ASTCompoundStmt) str
- print_data_type(node: ASTDataType) str
- print_declaration(node: ASTDeclaration) str
- print_elif_clause(node: ASTElifClause) str
- print_else_clause(node: ASTElseClause) str
- print_equations_block(node: ASTEquationsBlock) str
- print_expression(node: ASTExpression) str
- print_for_stmt(node: ASTForStmt) str
- print_function(node: ASTFunction) str
- print_function_call(node: ASTFunctionCall) str
- print_if_clause(node: ASTIfClause) str
- print_inline_expression(node: ASTInlineExpression) str
- print_input_block(node: ASTInputBlock) str
- print_input_port(node: ASTInputPort) str
- print_input_qualifier(node: ASTInputQualifier) str
- print_logical_operator(node: ASTLogicalOperator) str
- print_model_body(node: ASTModelBody) str
- print_ode_equation(node: ASTOdeEquation) str
- print_on_condition_block(node: ASTOnConditionBlock) str
- print_on_receive_block(node: ASTOnReceiveBlock) str
- print_output_block(node: ASTOutputBlock) str
- print_parameter(node: ASTParameter) str
- print_return_stmt(node: ASTReturnStmt)
- print_simple_expression(node: ASTSimpleExpression) str
- print_small_stmt(node: ASTSmallStmt) str
- print_stmts_body(node: ASTStmtsBody) str
- print_unary_operator(node: ASTUnaryOperator) str
- print_unit_type(node: ASTUnitType) str
- print_update_block(node: ASTUpdateBlock)
- print_variable(node: ASTVariable)
- print_while_stmt(node: ASTWhileStmt) str
pynestml.codegeneration.printers.nestml_variable_printer module
- class pynestml.codegeneration.printers.nestml_variable_printer.NestMLVariablePrinter(expression_printer: ExpressionPrinter)
Bases:
VariablePrinterPrint ``ASTVariable``s in NESTML syntax.
- print_variable(node: ASTVariable) str
Print a variable node :param node: the node to print :return: string representation
pynestml.codegeneration.printers.ode_toolbox_expression_printer module
- class pynestml.codegeneration.printers.ode_toolbox_expression_printer.ODEToolboxExpressionPrinter(simple_expression_printer: SimpleExpressionPrinter)
Bases:
CppExpressionPrinterPrinter for
ASTExpressionnodes in ODE-toolbox syntax.
pynestml.codegeneration.printers.ode_toolbox_function_call_printer module
- class pynestml.codegeneration.printers.ode_toolbox_function_call_printer.ODEToolboxFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
FunctionCallPrinterPrinter for ASTFunctionCall in sympy syntax.
- print_function_call(function_call: ASTFunctionCall) str
Print a function call, including bracketed arguments list.
- Parameters:
node – The function call node to print.
- Returns:
The function call string.
- Return type:
s
pynestml.codegeneration.printers.ode_toolbox_variable_printer module
- class pynestml.codegeneration.printers.ode_toolbox_variable_printer.ODEToolboxVariablePrinter(expression_printer: ExpressionPrinter)
Bases:
VariablePrinterConvert into a format accepted by ODE-toolbox as input.
- print_variable(node: ASTVariable) str
Print variable. :param node: the node to print :return: string representation
pynestml.codegeneration.printers.python_expression_printer module
- class pynestml.codegeneration.printers.python_expression_printer.PythonExpressionPrinter(simple_expression_printer: SimpleExpressionPrinter)
Bases:
ExpressionPrinterPrinter for
ASTExpressionnodes in Python syntax.- print_arithmetic_operator(node: ASTExpressionNode) str
Prints an arithmetic operator. :param op: an arithmetic operator object :return: a string representation
- print_bit_operator(node: ASTExpressionNode) str
Prints a bit operator in NEST syntax. :param op: a bit operator object :return: a string representation
- print_comparison_operator(node: ASTExpressionNode) str
Prints a comparison operator. :param op: a comparison operator object :return: a string representation
- print_expression(node: ASTExpressionNode) str
Print an expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
- print_logical_not(node: ASTExpression) str
Prints a logical NOT operator. :return: a string representation
- print_logical_operator(node: ASTExpressionNode) str
Prints a logical operator. :param op: a logical operator object :return: a string representation
pynestml.codegeneration.printers.python_function_call_printer module
- class pynestml.codegeneration.printers.python_function_call_printer.PythonFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
FunctionCallPrinterPrinter for ASTFunctionCall in Python syntax.
- print_function_call(function_call: ASTFunctionCall) str
Print a function call, including bracketed arguments list.
- Parameters:
node – The function call node to print.
- Returns:
The function call string.
- Return type:
s
pynestml.codegeneration.printers.python_simple_expression_printer module
- class pynestml.codegeneration.printers.python_simple_expression_printer.PythonSimpleExpressionPrinter(variable_printer: VariablePrinter, constant_printer: ConstantPrinter, function_call_printer: FunctionCallPrinter)
Bases:
SimpleExpressionPrinterPrinter for ASTSimpleExpressions in Python syntax.
- print_simple_expression(node: ASTSimpleExpression) str
Print a simple expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.python_standalone_printer module
- class pynestml.codegeneration.printers.python_standalone_printer.PythonStandalonePrinter(expression_printer: ExpressionPrinter)
Bases:
ModelPrinterThis class can be used to print any ASTNode to Python syntax.
- print_assignment(node: ASTAssignment) str
- print_comparison_operator(node: ASTComparisonOperator) str
- print_delay_parameter(variable: VariableSymbol) str
Prints the delay parameter :param variable: Variable with delay parameter :return: the corresponding delay parameter
- print_expression(node: ASTExpressionNode) str
Prints the handed over rhs to a nest readable format. :param node: a single meta_model node. :return: the corresponding string representation
- print_function_call(node: ASTFunctionCall) str
- print_simple_expression(node: ASTSimpleExpression) str
- print_variable(node: ASTVariable) str
pynestml.codegeneration.printers.python_stepping_function_function_call_printer module
- class pynestml.codegeneration.printers.python_stepping_function_function_call_printer.PythonSteppingFunctionFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
PythonFunctionCallPrinterPrinter for ASTFunctionCall in Python syntax.
pynestml.codegeneration.printers.python_stepping_function_variable_printer module
- class pynestml.codegeneration.printers.python_stepping_function_variable_printer.PythonSteppingFunctionVariablePrinter(expression_printer: ExpressionPrinter)
Bases:
VariablePrinterPrinter for variables in Python syntax and in the context of an ODE solver stepping function.
- print_delay_variable(variable: ASTVariable) str
Print a delay variable. :param variable: the variable to be printed :return: the string representation
- print_variable(node: ASTVariable) str
Print a variable. :param node: the variable to be printed :return: the string representation
pynestml.codegeneration.printers.python_type_symbol_printer module
- class pynestml.codegeneration.printers.python_type_symbol_printer.PythonTypeSymbolPrinter
Bases:
TypeSymbolPrinterReturns a Python syntax version of the handed over type.
- print(type_symbol: TypeSymbol) str
Converts the name of the type symbol to a corresponding Python syntax representation. :param type_symbol: a single type symbol :return: the corresponding string representation.
pynestml.codegeneration.printers.python_variable_printer module
- class pynestml.codegeneration.printers.python_variable_printer.PythonVariablePrinter(expression_printer: ExpressionPrinter, with_origin: bool = True, with_vector_parameter: bool = True)
Bases:
VariablePrinterVariable printer for Python syntax.
- print_variable(variable: ASTVariable) str
Converts a single variable to nest processable format. :param variable: a single variable. :return: a string representation
pynestml.codegeneration.printers.simple_expression_printer module
- class pynestml.codegeneration.printers.simple_expression_printer.SimpleExpressionPrinter(variable_printer: VariablePrinter, constant_printer: ConstantPrinter, function_call_printer: FunctionCallPrinter)
Bases:
ASTPrinterConverts expressions to the executable platform dependent code.
This class is used to transform only parts of the grammar and not NESTML as a whole.
- abstract print_simple_expression(node: ASTSimpleExpression) str
Print a simple expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.spinnaker_c_function_call_printer module
- class pynestml.codegeneration.printers.spinnaker_c_function_call_printer.SpinnakerCFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
FunctionCallPrinterPrinter for ASTFunctionCall in C Spinnaker API syntax.
- print_function_call(node: ASTFunctionCall) str
Converts a single handed over function call to C Spinnaker API syntax.
- Parameters:
function_call – The function call node to convert.
- Returns:
The function call string in C syntax.
- Return type:
s
pynestml.codegeneration.printers.spinnaker_c_type_symbol_printer module
- class pynestml.codegeneration.printers.spinnaker_c_type_symbol_printer.SpinnakerCTypeSymbolPrinter
Bases:
TypeSymbolPrinterReturns a Spinnaker C API syntax version of the handed over type.
- print(type_symbol: TypeSymbol) str
Converts the name of the type symbol to a corresponding nest representation. :param type_symbol: a single type symbol :return: the corresponding string representation.
pynestml.codegeneration.printers.spinnaker_c_variable_printer module
- class pynestml.codegeneration.printers.spinnaker_c_variable_printer.SpinnakerCVariablePrinter(expression_printer: ExpressionPrinter, with_origin: bool = True, with_vector_parameter: bool = True)
Bases:
CppVariablePrinterVariable printer for C syntax and the Spinnaker API.
- print_variable(variable: ASTVariable) str
Converts a single variable to Spinnaker processable format. :param variable: a single variable. :return: a Spinnaker processable format.
pynestml.codegeneration.printers.spinnaker_gsl_function_call_printer module
- class pynestml.codegeneration.printers.spinnaker_gsl_function_call_printer.SpinnakerGSLFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
SpinnakerCFunctionCallPrinterThis class is used to convert function calls to the GSL (GNU Scientific Library) syntax.
pynestml.codegeneration.printers.spinnaker_python_function_call_printer module
- class pynestml.codegeneration.printers.spinnaker_python_function_call_printer.SpinnakerPythonFunctionCallPrinter(expression_printer: ExpressionPrinter)
Bases:
PythonFunctionCallPrinterPrinter for ASTFunctionCall in Python syntax.
pynestml.codegeneration.printers.spinnaker_python_simple_expression_printer module
pynestml.codegeneration.printers.spinnaker_python_type_symbol_printer module
- class pynestml.codegeneration.printers.spinnaker_python_type_symbol_printer.SpinnakerPythonTypeSymbolPrinter
Bases:
TypeSymbolPrinterReturns a Python syntax version of the handed over type.
- print(type_symbol: TypeSymbol) str
Converts the name of the type symbol to a corresponding Python syntax representation. :param type_symbol: a single type symbol :return: the corresponding string representation.
pynestml.codegeneration.printers.symbol_printer module
pynestml.codegeneration.printers.type_symbol_printer module
pynestml.codegeneration.printers.unitless_c_simple_expression_printer module
- class pynestml.codegeneration.printers.unitless_c_simple_expression_printer.UnitlessCSimpleExpressionPrinter(variable_printer: VariablePrinter, constant_printer: ConstantPrinter, function_call_printer: FunctionCallPrinter)
Bases:
CSimpleExpressionPrinterAn adjusted version of the printer which prints in the units of the target platform (XXX: just nest?)
- print_simple_expression(node: ASTSimpleExpression) str
Print an expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.unitless_cpp_simple_expression_printer module
- class pynestml.codegeneration.printers.unitless_cpp_simple_expression_printer.UnitlessCppSimpleExpressionPrinter(variable_printer: VariablePrinter, constant_printer: ConstantPrinter, function_call_printer: FunctionCallPrinter)
Bases:
CppSimpleExpressionPrinterAn adjusted version of the printer which prints in the units of the target platform (XXX: just nest?)
- print_simple_expression(node: ASTSimpleExpression) str
Print an expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.unitless_sympy_simple_expression_printer module
- class pynestml.codegeneration.printers.unitless_sympy_simple_expression_printer.UnitlessSympySimpleExpressionPrinter(variable_printer: VariablePrinter, constant_printer: ConstantPrinter, function_call_printer: FunctionCallPrinter)
Bases:
CppSimpleExpressionPrinterPrinter for ASTSimpleExpressions in Sympy syntax.
- print_simple_expression(node: ASTSimpleExpression) str
Print a simple expression.
- Parameters:
node – The expression node to print.
- Returns:
The expression string.
- Return type:
s
pynestml.codegeneration.printers.variable_printer module
- class pynestml.codegeneration.printers.variable_printer.VariablePrinter(expression_printer: ExpressionPrinter)
Bases:
ASTPrinterConverts variables to the executable platform dependent code.
This class is used to transform only parts of the grammar and not NESTML as a whole.
- abstract print_variable(node: ASTVariable) str
Print a variable.
- Parameters:
node – The node to print.
- Returns:
The string representation.
- Return type:
s