-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path__init__.py
More file actions
93 lines (76 loc) · 2.66 KB
/
__init__.py
File metadata and controls
93 lines (76 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import os
import sys
from importlib import metadata
from qcodes import config as qc_config
# Phase 2: stable top-level re-exports from subpackages
from .config import get_data_dir, get_path, set_data_dir # noqa: F401
from .logging_utils import ( # noqa: F401
attach_notebook_logging,
ensure_sweep_logging,
get_sweep_logger,
)
from .sweep.base_sweep import BaseSweep # noqa: F401
from .sweep.gate_leakage import GateLeakage # noqa: F401
from .sweep.simul_sweep import SimulSweep # noqa: F401
from .sweep.sweep0d import Sweep0D # noqa: F401
from .sweep.sweep1d import Sweep1D # noqa: F401
from .sweep.sweep2d import Sweep2D # noqa: F401
from .sweep.sweep_ips import SweepIPS # noqa: F401
from .tools.sweep_queue import DatabaseEntry, SweepQueue # noqa: F401
from .tools.util import init_database # noqa: F401
# Visualization helpers are available under measureit.visualization
qc_config.logger.start_logging_on_import = "always"
qc_config.logger.console_level = "WARNING"
qc_config.station.enable_forced_reconnect = False
__all__ = [
"Sweep0D",
"Sweep1D",
"Sweep2D",
"SimulSweep",
"SweepIPS",
"GateLeakage",
"SweepQueue",
"DatabaseEntry",
"init_database",
"get_path",
"set_data_dir",
"get_data_dir",
"ensure_sweep_logging",
"get_sweep_logger",
"attach_notebook_logging",
"get_all_sweeps",
"get_error_sweeps",
]
# Convenience functions for sweep registry
def get_all_sweeps():
"""Get all registered sweep instances.
Returns
-------
list
List of all sweep instances currently registered (not yet garbage collected).
"""
return BaseSweep.get_all_sweeps()
def get_error_sweeps():
"""Get all sweeps currently in ERROR state.
Returns
-------
list
List of sweep instances in ERROR state. These sweeps are held in memory
until explicitly killed or cleared to allow inspection.
"""
return BaseSweep.get_error_sweeps()
try:
__version__ = metadata.version("qmeasure")
except metadata.PackageNotFoundError: # pragma: no cover - dev installs
__version__ = "1.2.5"
# Display data directory info on first import (only in interactive sessions)
if hasattr(sys, "ps1") or "IPython" in sys.modules:
_shown_key = "_measureit_data_dir_shown"
if not hasattr(sys, _shown_key):
setattr(sys, _shown_key, True)
data_dir = get_data_dir()
env_set = "MEASUREIT_HOME" in os.environ or "MeasureItHome" in os.environ
print(f"\nMeasureIt data directory: {data_dir}")
if not env_set:
print("(Using platform default - set MEASUREIT_HOME to customize)")
print("To change: measureit.set_data_dir('/path')\n")