poli.core.registry.set_observer

poli.core.registry.set_observer#

poli.core.registry.set_observer(observer: Union[AbstractObserver, Type[AbstractObserver]], conda_environment_location: Optional[str] = None, python_paths: Optional[List[str]] = None, observer_name: Optional[str] = None)#

Defines an external observer to be run in a separate process.

This function takes an observer, a conda environment, a list of python environments, and an observer name. With these, it creates a script that can be run to instantiate the observer in a separate process. If no observer name is passed, the observer is set as the default observer.

After registering an observer using this function, the user can instantiate it by using the ExternalObserver class, passing the relevant observer name.

Parameters
  • observer (AbstractObserver) – The observer to be registered.

  • conda_environment_location (str) – The location of the conda environment to be used.

  • python_paths (List[str]) – A list of paths to append to the python path of the run script.

  • observer_name (str) – The name of the observer to be registered.

Notes

The observer script MUST accept port and password as arguments.