imhr.settings

@purpose: Default settings for processing.py
@date: Created on Sat May 1 15:12:38 2019
@author: Semeon Risom

Functions

console(message[, color]) Allows user-friend console logging using ANSI escape codes.
link(name, url) Create popover of variable in html.
popover(name, title, description[, url]) Create popover of variable in html.
stn(source) Convert to scientific notation.
library([required]) Check if required libraries are available.
imhr.settings.console(message, color='blue')[source]

Allows user-friend console logging using ANSI escape codes.

Parameters:
message : str

Message to send to console.

color : str

Name of color or ANSI escape event to use.

Returns:
result : str

ANSI escape code.

Notes

Colors are produced using ASCII Oct format. For example: ‘. See http://jafrog.com/2013/11/23/colors-in-terminal.html for more.

Examples

>>> console(self, message, color='blue)

Create popover of variable in html.

Parameters:
name : str

Name of variable.

url : str

URL to link to.

Returns:
link : str

HTML <a> element.

Examples

>>> link(name=roi, url="#boxplot")
<a href="#boxplot" class="anchor">roi</a>
imhr.settings.popover(name, title, description, url=None, **kwargs)[source]

Create popover of variable in html.

Parameters:
name : str

Local name of variable.

title : str

Title of variable in popover.

description : str

Description of variable in popover.

url : str or str

URL to include. Default None.

**kwargs : str or None, optional

Additional properties, relevent for specific content types. Here’s a list of available properties:

Property Description
img : dict {‘src’: str,’className’: str} Create an image to be included in the popover
Returns:
link : str

HTML <a> element.

Examples

>>> description = "Chambers, J., Hastie, T. (1992). Statistical Models in S. Wadsworth & Brooks/Cole."
>>> popover(name="anova", title="Statistical Models in S", description=description)
<a tabindex="0" class="popover-anchor" link-id="anova" data-toggle="popover" data-content="Chambers, J., Hastie, T. (1992).             Statistical Models in S. Wadsworth & Brooks/Cole." title="" data-original-title="Statistical Models in S">Chambers, Hastie, 1992</a>
imhr.settings.stn(source)[source]

Convert to scientific notation.

Parameters:
source : float

Original number.

Returns:
output : str

Number in scientific notation, if (number < 0.0001) or (if number > 9999).

imhr.settings.library(required=None)[source]

Check if required libraries are available.

Parameters:
required : list

List of required libraries.