PySpeedIT.utils

Overview

This module defines a couple of helpers.

Classes

class PySpeedIT.utils.Err(error_type, info)

Prints an own raised Project Error

Parameters:
  • error_type – (str) to specify mostly from which part the error comes: e.g. CONFIG
  • info – (list) list of strings (text info) to print as message: each list item starts at a new line

Functions

PySpeedIT.utils.build_cython_extension(py_or_pyx_file_path, cython_force_rebuild=True)

Build a cython extension from a .py or .pyx file

  • build will be done in a sub-folder named _pyxbld in the py_or_pyx_file_path
Parameters:
  • py_or_pyx_file_path – (str) path to a .py or .pyx file
  • cython_force_rebuild – (bool) If True the cython extension is rebuild even if it was already build
Returns:

(tuple) cython_extension_module_path, cython_module_c_file_path, cython_build_dir_path

PySpeedIT.utils.format_time(time_)

Returns a formatted time string in the Orders of magnitude (time)

Parameters:time – (float) if if -1.0 return ‘NOT-MEASURED’‘
Returns:(str) formatted time: Orders of magnitude (time)
Orders of magnitude (time)
Name Symbol Definition
second ( s ) One second
millisecond ( ms ) One thousandth of one second
microsecond ( µs ) One millionth of one second
nanosecond ( ns ) One billionth of one second

This Page