Modifier#

The available modifiers:

mmodel.modifier.loop_input(parameter)

Modify function to iterate one given parameter.

mmodel.modifier.zip_loop_inputs(parameters)

Modify function to iterate the parameters pairwise.

mmodel.modifier.profile_time([number, ...])

Profile the execution time of a function.

modifier module#

mmodel.modifier.format_time(dt, precision)[source]#

Format time in seconds to a human-readable string.

mmodel.modifier.loop_input(parameter: str)[source]#

Modify function to iterate one given parameter.

Parameters:

parameter (list) – target parameter to loop The target parameter name is changed to f”{param}_loop”

mmodel.modifier.profile_time(number=1, repeat=1, verbose=False, precision=2)[source]#

Profile the execution time of a function.

The modifier behaves similarly to the timeit module. However, the modifier does not suppress garbage collection during the function execution; therefore, the result might be slightly different.

mmodel.modifier.zip_loop_inputs(parameters: list)[source]#

Modify function to iterate the parameters pairwise.

Parameters:

parameters (list) – list of the parameters to loop only one parameter is allowed. If a string of the parameters is provided, the parameters should be delimited by “, “.