rcognita.main

class rcognita.main(*args, logger=<Logger rcognita (WARNING)>, callbacks=[<class 'rcognita.callbacks.StateCallback'>, <class 'rcognita.callbacks.ObjectiveCallback'>], **kwargs)

The decorator used to invoke rcognita’s config pipeline.

Use it to decorate your main function like so:

@rcognita.main(config_path=..., config_name=...)
def my_main(config):
    ...

if __name__ == '__main__':
    my_main()
__init__(*args, logger=<Logger rcognita (WARNING)>, callbacks=[<class 'rcognita.callbacks.StateCallback'>, <class 'rcognita.callbacks.ObjectiveCallback'>], **kwargs)

Create an instance of rcognita.main.

Parameters
  • config_path (str) – path to the folder containing your config(s)

  • config_name (str) – the name of your config (without extension)

  • callbacks (list[class], optional) – list of uninstantiated callbacks (classes) to be registered

  • logger (Logger, optional) – a logger instance to be supplied to callbacks

Methods

__init__(*args[, logger, callbacks])

Create an instance of rcognita.main.

apply_assignments(cfg)

post_assignment(key, value[, weak])

post_weak_assignment(key, value)

Attributes

assignments

callbacks

logger

weak_assignments