schrodinger.livedesign.json_runner module

class schrodinger.livedesign.json_runner.JsonRunnerDict

Bases: dict

A dictionary to hold JSON runners, allowing for easy retrieval and lazy-loading of functions, to avoid extra inspection overhead. actually stores json_interface wrapped functions internally, and returns JsonRunner instances when accessed.

get(key, default=None)

Return the value for key if key is in the dictionary, else default.

class schrodinger.livedesign.json_runner.JsonRunner(func)

Bases: object

A class to wrap a function that can be called with JSON data.

__init__(func)
validateJson(json_data)

Validate that the JSON data matches the signature of the wrapped function

classmethod validateFunctionSpec(func, func_spec)
getJsonInterfaceContract()

Get a readout of all of the required and optional args, and their expected types

getJsonInterfaceContractStr() str

Get the JSON interface contract as a JSON string