This adds ql.initialize() to the Python interface. It's purpose is to ensure that OpenQL is put in a well-defined, default state. Currently that only amounts to resetting options to their default values. If an option is set or a platform is constructed before initialize() is called, initialize() is called automatically and a warning is printed; this is just there for backward compatibility, and to teach people to call it themselves. The latter is necessary in the context of a shared python interpreter, such as a ipython/jupyter running on a shared server or during test suites, to prevent side-effects from the previous runs of OpenQL from affecting the latest run.
This replaces the current behavior of resetting options implicitly at the end of compile().
This adds
ql.initialize()
to the Python interface. It's purpose is to ensure that OpenQL is put in a well-defined, default state. Currently that only amounts to resetting options to their default values. If an option is set or a platform is constructed before initialize() is called, initialize() is called automatically and a warning is printed; this is just there for backward compatibility, and to teach people to call it themselves. The latter is necessary in the context of a shared python interpreter, such as a ipython/jupyter running on a shared server or during test suites, to prevent side-effects from the previous runs of OpenQL from affecting the latest run.This replaces the current behavior of resetting options implicitly at the end of compile().