py_csv_speed

View page source

Record a Python Speed Result in a Csv File

Prototype

def csv_speed(
   file_name, rate, min_time, package, algorithm, special, option
   ) :
   assert type(file_name) == str
   assert type(rate)      == float
   assert type(min_time)  == float
   assert type(package)   == str
   assert type(algorithm) == str
   assert type(special)   == bool
   assert type(option)    == dict
   #
   assert package in [ 'none', 'autograd', 'cppad_py', 'jax', 'torch' ]
   #
   assert type( option['n_arg'] )      == int
   assert type( option['n_other'] )    == int
   assert type( option['time_setup'] ) == bool

file_name

This is the name of the file were the results will be recorded. This file uses the csv_column format.

  1. If the file is empty on input, the following csv header line is written as the first line of the file; i.e.,

   rate,min_time,package,algorithm,n_arg,date,compiler,debug,language
  1. A line is added to this file corresponding to this call to csv_speed.

rate

see rate

min_time

see min_time

package

see package

algorithm

see algorithm

special

see special

option

n_arg

see n_arg

n_other

see n_other

time_setup

see time_setup

Example

xam_csv_speed.py contains an example and test of this routine.