libvis package

Submodules

libvis.VisVars module

class libvis.VisVars.VisObject(value)[source]

Bases: libvis.VisVars.VisVars

name = 'VisVar'
class libvis.VisVars.VisVars(*args, **kwargs)[source]

Bases: legimens.Object.Object

name = 'VisVar'

libvis.VisWorker module

class libvis.VisWorker.Vis(ws_port=7700, vis_port=7000, nb_name=None, debug=False, allow_remote=False)[source]

Bases: object

configure_logging(level, sink=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>)[source]
show()[source]

Open libvis dashboard in browser.

start()[source]

Main entry point of legimens. Called upon initialization of this class.

  1. Starts an http server with dashboard app

    on vis_port.

  2. Starts the legimens app using Vis.app.run().

Raises:
Exception: Something went wrong when starting

http or websocket server in legimens.

start_http(port=None)[source]
stop()[source]
stop_http()[source]
use(serializer)[source]
watch(obj, key, serializer=None)[source]

libvis.http_server module

Very simple HTTP server in python. Usage:

./dummy-web-server.py [<port>]
Send a HEAD request::

curl -I http://localhost

Send a POST request::

curl -d “foo=bar&bin=baz” http://localhost

class libvis.http_server.Server(request, client_address, server)[source]

Bases: http.server.BaseHTTPRequestHandler

do_GET()[source]
do_HEAD()[source]
libvis.http_server.create_server(server_class=<class 'http.server.HTTPServer'>, handler_class=<class 'libvis.http_server.Server'>, port=80)[source]
libvis.http_server.get_path(path)[source]
libvis.http_server.read_file(fname)[source]
libvis.http_server.run(server_class=<class 'http.server.HTTPServer'>, handler_class=<class 'libvis.http_server.Server'>, port=80)[source]
libvis.http_server.start_server(port)[source]

libvis.interface module

class libvis.interface.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

default(obj)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
libvis.interface.add_serializer(type, ser)[source]
libvis.interface.infer_type(val)[source]
libvis.interface.is_bokeh(*args, **kwargs)[source]
libvis.interface.is_mpl(*args, **kwargs)[source]
libvis.interface.is_numpy(*args, **kwargs)[source]
libvis.interface.ndarray_val(val)[source]
libvis.interface.numpy_to_image(val)[source]
libvis.interface.preprocess_value(val)[source]
libvis.interface.reset_IFC()[source]

Reinitialize global value of IFC

Should I have global IFC or local to Vis obj? For:

Different Vis instances might share set up visualization so no need to configure them separately.

Against:

Different Vis may serve different purposes, so there might be a need to configure them

differently.

libvis.interface.serialize_to_vis(value)[source]
libvis.interface.vismodule_val(val)[source]

libvis.main module

Module contents