Skip to content

Commit

Permalink
Merge #4674
Browse files Browse the repository at this point in the history
4674: Remove deprecated import of loop etc at the top level of qcodes r=jenshnielsen a=jenshnielsen

- [ ] Needs a breaking change note

Co-authored-by: Jens H. Nielsen <Jens.Nielsen@microsoft.com>
Co-authored-by: Jens Hedegaard Nielsen <jenshnielsen@gmail.com>
  • Loading branch information
3 people authored Oct 4, 2022
2 parents 77f1609 + 008663c commit 99d8221
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 34 deletions.
2 changes: 2 additions & 0 deletions docs/changes/newsfragments/4674.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The deprecated imports of `Loop`, `Measure` and members of `qcodes.data` in the toplevel QCoDeS namespace has been
removed.
37 changes: 3 additions & 34 deletions qcodes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,43 +79,12 @@
from qcodes.utils import QCoDeSDeprecationWarning

warnings.warn(
"import_legacy_api config option is deprecated and will be removed "
"in a future release please update your imports to import these "
"modules directly.",
"`core.import_legacy_api` and `gui.plotlib` config option has no effect "
"and will be removed in the future. "
"Please avoid setting this in your `qcodesrc.json` config file.",
QCoDeSDeprecationWarning,
)

plotlib = config.gui.plotlib
if plotlib in {"QT", "all"}:
try:
from qcodes.plots.pyqtgraph import QtPlot
except Exception:
print(
"pyqtgraph plotting not supported, "
'try "from qcodes.plots.pyqtgraph import QtPlot" '
"to see the full error"
)

if plotlib in {"matplotlib", "all"}:
try:
from qcodes.plots.qcmatplotlib import MatPlot
except Exception:
print(
"matplotlib plotting not supported, "
'try "from qcodes.plots.qcmatplotlib import MatPlot" '
"to see the full error"
)
from qcodes.actions import BreakIf, Task, Wait
from qcodes.data.data_array import DataArray
from qcodes.data.data_set import DataSet, load_data, new_data
from qcodes.data.format import Formatter
from qcodes.data.gnuplot_format import GNUPlotFormat
from qcodes.data.hdf5_format import HDF5Format
from qcodes.data.io import DiskIO
from qcodes.data.location import FormatLocation
from qcodes.loops import Loop, active_data_set, active_loop
from qcodes.measure import Measure


try:
_register_magic = config.core.get('register_magic', False)
Expand Down

0 comments on commit 99d8221

Please sign in to comment.