def check_co_co(cls, node: ASTNeuron): """ Ensures the coco for the handed over neuron. :param node: a single neuron instance. """ equations_defined_visitor = EquationsDefinedVisitor() node.accept(equations_defined_visitor) integrate_odes_called_visitor = IntegrateOdesCalledVisitor() node.accept(integrate_odes_called_visitor) if equations_defined_visitor.equations_defined() and not integrate_odes_called_visitor.integrate_odes_called(): code, message = Messages.get_equations_defined_but_integrate_odes_not_called() Logger.log_message(code=code, message=message, error_position=node.get_source_position(), log_level=LoggingLevel.ERROR)
def check_co_co(cls, node: ASTNeuron): """ Ensures the coco for the handed over neuron. :param node: a single neuron instance. """ if isinstance(node, ASTSynapse): return # XXX: TODO: check that there are no equations other than the ones moved to the neuron (if any) equations_defined_visitor = EquationsDefinedVisitor() node.accept(equations_defined_visitor) integrate_odes_called_visitor = IntegrateOdesCalledVisitor() node.accept(integrate_odes_called_visitor) if equations_defined_visitor.equations_defined( ) and not integrate_odes_called_visitor.integrate_odes_called(): code, message = Messages.get_equations_defined_but_integrate_odes_not_called( ) Logger.log_message(code=code, message=message, error_position=node.get_source_position(), log_level=LoggingLevel.ERROR)