Miscellany utils

Log messages

Show error and log messages.

misc_utils.log_messages.error(msg)
misc_utils.log_messages.log(msg)
misc_utils.log_messages.to_file(fName)
misc_utils.log_messages.warning(msg)

Pickle utils

class misc_utils.pickle_utils.interp1dPicklable(xi, yi, **kwargs)

class wrapper for piecewise linear function

Staircase function

class misc_utils.staircase_function.StairCaseFunction(xi, vi, leftDefaultValue=0.0, rightDefaultValue=0.0)

Bases: object

Function defined as a series of constant values in consecutive intervals

String utils

String manipulation utilities.

misc_utils.string_utils.remove_accents(input_str)
misc_utils.string_utils.slugify(s)

Simplifies ugly strings into something URL-friendly. >>> print(slugify(“[Some] _ Article’s Title–”)) some-articles-title

Unit utils

misc_utils.units_utils.convert_inches(n)

Return (feet,inches,inches’ fraction) equivalent to number n of inches given as parameter, where n is a real number.

misc_utils.units_utils.feet_and_inches(n)
misc_utils.units_utils.roundLst(lst, decpl)

return a list with the values of ‘lst’ rounded to ‘decpl’ decimal places

misc_utils.units_utils.show_inches(inches, fractions)

Pretty printing of (inches,fractions) given as parameter