This PR leaves the _compute_psd_welch and _compute_sgramm functions in their irasa_utils.py file but at the same time introduces a consistent and convenient interface for functions that _gen_irasa can use.
The idea is basically that _gen_irasa request a function with a specific set of parameters (which is specified in utils/types.py so mypy catches it). The signature of this function is constraint to be:
The actutal irasa functions (like irasa or irasa_sprint) the generate a lightweight local function following this exact signature and call the respective function that is imported from irasa_utils.py. So, the local function consists only of the definition and the immediatly returned call to the low-level function like this example in irasa:
As you see, the responsibility to handle the kwargs for the low-level functions is now on the local functions and not anymore on the _gen_irasa because it does not really need to care about these....
This is going to make any efforts of porting it to cython much easier btw.
This PR leaves the
_compute_psd_welch
and_compute_sgramm
functions in theirirasa_utils.py
file but at the same time introduces a consistent and convenient interface for functions that_gen_irasa
can use.The idea is basically that
_gen_irasa
request a function with a specific set of parameters (which is specified inutils/types.py
so mypy catches it). The signature of this function is constraint to be:The actutal irasa functions (like
irasa
orirasa_sprint
) the generate a lightweight local function following this exact signature and call the respective function that is imported fromirasa_utils.py
. So, the local function consists only of the definition and the immediatly returned call to the low-level function like this example inirasa
:As you see, the responsibility to handle the kwargs for the low-level functions is now on the local functions and not anymore on the
_gen_irasa
because it does not really need to care about these....This is going to make any efforts of porting it to cython much easier btw.
closes #35