astrobase.cpserver.checkplotserver_handlers module

These are Tornado handlers for serving checkplots and operating on them.

class astrobase.cpserver.checkplotserver_handlers.FrontendEncoder(*, 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

This overrides Python’s default JSONEncoder so we can serialize custom objects.

default(obj)[source]

Overrides the default serializer for JSONEncoder.

This can serialize the following objects in addition to what JSONEncoder can already do.

  • np.array
  • bytes
  • complex
  • np.float64 and other np.dtype objects
Parameters:obj (object) – A Python object to serialize to JSON.
Returns:A JSON encoded representation of the input object.
Return type:str
class astrobase.cpserver.checkplotserver_handlers.IndexHandler(application: tornado.web.Application, request: tornado.httputil.HTTPServerRequest, **kwargs)[source]

Bases: tornado.web.RequestHandler

This handles the index page.

This page shows the current project.

initialize(currentdir, assetpath, cplist, cplistfile, executor, readonly, baseurl)[source]

handles initial setup.

get()[source]

This handles GET requests to the index page.

TODO: provide the correct baseurl from the checkplotserver options dict, so the frontend JS can just read that off immediately.