Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add configuration system to qcodes #302

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions qcodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,35 @@
from multiprocessing import active_children

from qcodes.version import __version__

# load config system
import qcodes.config
from qcodes.config import (is_int, is_bool, is_text, is_float,
is_instance_factory, is_one_of_factory,
get_default_val)
from qcodes.config import (get_option, set_option, reset_option,
describe_option, option_context, options)

# create various options
usezmq_doc = """
: bool
If set to True the framework will install a hook to send logging data
to a ZMQ socket.
"""

with config.config_prefix('display'):
config.register_option(
'frontend', 1, 'frontend that is used (1: notebook, 0: unknown, 2: spyder', validator=is_int)
with config.config_prefix('logging'):
config.register_option('usezmq', 1, usezmq_doc, validator=is_int)


# load config file
path = qcodes.config.qcodes_fname()
if path is not None:
qcodes.config.from_file(path)


from qcodes.process.helpers import set_mp_method
from qcodes.utils.helpers import in_notebook

Expand Down
Loading