module tools.code_helper#

Short summary#

module mlprodict.tools.code_helper

A couple of tools unrelated to what the package does.

source on GitHub

Functions#

function

truncated documentation

debug_dump

Dumps an object for debug purpose.

debug_print

Displays informations on an object.

make_callable

Creates a callable function able to cope with default values as the combination of functions compile and exec

numpy_max

Returns the maximum of an array. Deals with text as well.

numpy_min

Returns the maximum of an array. Deals with text as well.

numpy_min_max

Returns the minimum of an array. Deals with text as well.

print_code

Returns the code with line number.

Documentation#

A couple of tools unrelated to what the package does.

source on GitHub

mlprodict.tools.code_helper.debug_dump(clname, obj, folder=None, ops=None)#

Dumps an object for debug purpose.

Parameters:
  • clname – class name

  • obj – object

  • folder – folder

  • ops – operator to dump

Returns:

filename

source on GitHub

mlprodict.tools.code_helper.debug_print(k, obj, printed)#

Displays informations on an object.

Parameters:
  • k – name

  • obj – object

  • printed – memorizes already printed object

source on GitHub

mlprodict.tools.code_helper.make_callable(fct, obj, code, gl, debug)#

Creates a callable function able to cope with default values as the combination of functions compile and exec does not seem able to take them into account.

Parameters:
  • fct – function name

  • obj – output of function compile

  • code – code including the signature

  • gl – context (local and global)

  • debug – add debug function

Returns:

callable functions

source on GitHub

mlprodict.tools.code_helper.numpy_max(x)#

Returns the maximum of an array. Deals with text as well.

source on GitHub

mlprodict.tools.code_helper.numpy_min(x)#

Returns the maximum of an array. Deals with text as well.

source on GitHub

mlprodict.tools.code_helper.numpy_min_max(x, fct, minmax=False)#

Returns the minimum of an array. Deals with text as well.

source on GitHub

mlprodict.tools.code_helper.print_code(code, begin=1)#

Returns the code with line number.

source on GitHub