module asv_benchmark.asv_exports#

Short summary#

module mlprodict.asv_benchmark.asv_exports

Functions to help exporting json format into text.

source on GitHub

Functions#

function

truncated documentation

_coor_to_str

_dict2str

_enumerate_classes

Extracts the classes of a file.

_figures2dict

Converts the data from list to dictionaries.

_retrieve_class_parameters

Imports files in bdir, compile files and extra metadata from them.

_update_test_metadata

enumerate_export_asv_json

Looks into asv results and wraps all of them into a dataframe or flat data.

export_asv_json

Looks into asv results and wraps all of them into a dataframe or flat data.

fix_missing_imports

The execution of a file through function exec does not import new modules. They must be there when it is …

Documentation#

Functions to help exporting json format into text.

source on GitHub

mlprodict.asv_benchmark.asv_exports._coor_to_str(cc)#
mlprodict.asv_benchmark.asv_exports._dict2str(d)#
mlprodict.asv_benchmark.asv_exports._enumerate_classes(filename)#

Extracts the classes of a file.

source on GitHub

mlprodict.asv_benchmark.asv_exports._figures2dict(metrics, coor, baseline=None)#

Converts the data from list to dictionaries.

Parameters:
  • metrics – single array of values

  • coor – list of list of coordinates names

  • baseline – one coordinates is the baseline

Returns:

dictionary of metrics

source on GitHub

mlprodict.asv_benchmark.asv_exports._retrieve_class_parameters(bdir)#

Imports files in bdir, compile files and extra metadata from them.

source on GitHub

mlprodict.asv_benchmark.asv_exports._update_test_metadata(row, class_meta)#
mlprodict.asv_benchmark.asv_exports.enumerate_export_asv_json(folder, as_df=False, last_one=False, baseline=None, conf=None)#

Looks into asv results and wraps all of them into a dataframe or flat data.

Parameters:
  • folder – location of the results

  • last_one – to return only the last one

  • baseline – defines a baseline and computes ratios

  • conf – configuration file, may be used to add additional data

Returns:

dataframe or flat data

source on GitHub

mlprodict.asv_benchmark.asv_exports.export_asv_json(folder, as_df=False, last_one=False, baseline=None, conf=None)#

Looks into asv results and wraps all of them into a dataframe or flat data.

Parameters:
  • folder – location of the results

  • as_df – returns a dataframe or a list of dictionaries

  • last_one – to return only the last one

  • baseline – computes ratio against the baseline

  • conf – configuration file, may be used to add additional data

Returns:

dataframe or flat data

source on GitHub

mlprodict.asv_benchmark.asv_exports.fix_missing_imports()#

The execution of a file through function exec does not import new modules. They must be there when it is done. This function fills the gap for some of them.

Returns:

added names

source on GitHub