pomdp_py.utils package

Submodules

pomdp_py.utils.util module

pomdp_py.utils.util.remap(oldvalue, oldmin, oldmax, newmin, newmax)[source]
pomdp_py.utils.util.plot_points(xvals, yvals, color=None, size=1.5, label=None, connected=True, style='--', linewidth=1.5, xlabel='x', ylabel='f(x)', loc='lower right')[source]
pomdp_py.utils.util.save_plot(path, bbox_inches='tight')[source]
pomdp_py.utils.util.lighter(color, percent)[source]

assumes color is rgb between (0, 0, 0) and (255, 255, 255)

pomdp_py.utils.util.rgb_to_hex(rgb)[source]
pomdp_py.utils.util.hex_to_rgb(hx)[source]

hx is a string, begins with #. ASSUME len(hx)=7.

pomdp_py.utils.util.inverse_color_rgb(rgb)[source]
pomdp_py.utils.util.inverse_color_hex(hx)[source]

hx is a string, begins with #. ASSUME len(hx)=7.

pomdp_py.utils.util.random_unique_color(colors, ctype=1)[source]

ctype=1: completely random ctype=2: red random ctype=3: blue random ctype=4: green random ctype=5: yellow random

pomdp_py.utils.util.json_safe(obj)[source]
pomdp_py.utils.util.vec(p1, p2)[source]

vector from p1 to p2

pomdp_py.utils.util.proj(vec1, vec2, scalar=False)[source]
pomdp_py.utils.util.R_x(th)[source]
pomdp_py.utils.util.R_y(th)[source]
pomdp_py.utils.util.R_z(th)[source]
pomdp_py.utils.util.T(dx, dy, dz)[source]
pomdp_py.utils.util.to_radians(th)[source]
pomdp_py.utils.util.R_between(v1, v2)[source]
pomdp_py.utils.util.approx_equal(v1, v2, epsilon=1e-06)[source]
pomdp_py.utils.util.safe_slice(arr, start, end)[source]
class pomdp_py.utils.util.bcolors[source]

Bases: object

WHITE = '\x1b[97m'
CYAN = '\x1b[96m'
MAGENTA = '\x1b[95m'
BLUE = '\x1b[94m'
GREEN = '\x1b[92m'
YELLOW = '\x1b[93m'
RED = '\x1b[91m'
BOLD = '\x1b[1m'
ENDC = '\x1b[0m'
static disable()[source]
static s(color, content)[source]

Returns a string with color when shown on terminal. color is a constant in bcolors class.

pomdp_py.utils.util.print_info(content)[source]
pomdp_py.utils.util.print_note(content)[source]
pomdp_py.utils.util.print_error(content)[source]
pomdp_py.utils.util.print_warning(content)[source]
pomdp_py.utils.util.print_success(content)[source]
pomdp_py.utils.util.print_info_bold(content)[source]
pomdp_py.utils.util.print_note_bold(content)[source]
pomdp_py.utils.util.print_error_bold(content)[source]
pomdp_py.utils.util.print_warning_bold(content)[source]
pomdp_py.utils.util.print_success_bold(content)[source]