check_conn_before_init#

andes.routines.base.check_conn_before_init(func)[source]#

A decorator that ensures the connection is active before calling the init or run method of a BaseRoutine derived class.

This decorator calls the act method on self.system.conn to ensure the connection is active before proceeding with the initialization.

Parameters:
funcfunction

The init method of a BaseRoutine derived class.

Returns:
function

The wrapped function with connection check.