Skip to content

Various notebook cleanups - #8442

Merged
Jens Hedegaard Nielsen (jenshnielsen) merged 7 commits into
microsoft:mainfrom
jenshnielsen:notebook_cleanup
Aug 25, 2026
Merged

Various notebook cleanups#8442
Jens Hedegaard Nielsen (jenshnielsen) merged 7 commits into
microsoft:mainfrom
jenshnielsen:notebook_cleanup

Conversation

@jenshnielsen

@jenshnielsenJens Hedegaard Nielsen (jenshnielsen) commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Extracted from #8441

The top level aliases such as qcodes.Station and qcodes.Measurement are
deprecated and emit a warning at runtime. They are also hidden from type
checkers on purpose, so every use was reported as an unresolved
attribute.
Import the names from their submodules, which is what the deprecation
warning asks for, and drop the qcodes alias where nothing else used it.
Infiniium was renamed to KeysightInfiniium and WaveformGenerator_33XXX
to Keysight33xxx, and the deprecated aliases have since been removed, so
Example Measurements with Real Instruments failed at its import cell.
Use KeysightInfiniium and the model specific Keysight33522B, which is
the instrument the example actually connects to and which the base
classes tell you to use in preference to themselves.
The DPO 72004C notebook imported TekronixDPOWaveform, missing a t. Note
that the same misspelling appears in a docstring in DPO7200xx.py.
Correcting the DPO import uncovered that the notebook attaches a
waveform source straight to the instrument, while the driver declares
the parent as a channel. The surrounding text already presents this as
future work, so record that on the line rather than widening the
driver's annotation.
The drivers_api docs present qcodes.instrument_drivers.<vendor> as the
public module, and the vendor packages re-export their drivers, so the
examples should not reach into the module that happens to define a
class.
Most notebooks already did this. Only SR830, TektronixDPOWaveform and a
commented Weinschel8320 line still reached deeper, and all three names
are re-exported. Verified by importing each name from the package before
rewriting.
The classes were renamed from Tekronix to Tektronix in 0.45.0, but this
cross reference in the TektronixDPOWaveformFormat docstring was missed
and now points at a class that does not exist.
The remaining occurrences are in the 0.45.0 changelog, which documents
that rename and so refers to the old names on purpose.
qcodes.measure and qcodes.plots were split out into the qcodes_loop
package in 0.38.0, and the deprecated aliases have since been removed,
so both notebooks raised ModuleNotFoundError on their import cell.
Import from qcodes_loop and say in the notebook that this needs the loop
extra, which the docs extra already pulls in.
Sequence.plotSequence no longer exists in broadbean, the helper is now
broadbean.plotting.plotter. makeSEQXFileFromForgedSequence was renamed
to make_SEQX_from_forged_sequence when the driver moved from camelCase
to snake case; the signature is otherwise unchanged. Both calls raised
AttributeError.
Correcting the second name uncovered that the channel mapping does not
match the parameter type. The driver takes a Mapping[str | int, int] and
the key type of a Mapping is invariant, so a dict[str, int] is not one.
Annotate the notebook variable and say why.
@codecov

codecovBot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.09%. Comparing base (aaadb5e) to head (d84c94e).

Additional details and impacted files
@@ Coverage Diff @@## main #8442 +/- ##
=======================================
Coverage 71.09% 71.09% =======================================
Files 305 305 Lines 31934 31934 =======================================
Hits 22705 22705 Misses 9229 9229 

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Combine the five newsfragments added on this branch into a single
docs/changes/newsfragments/8442.improved with the correct PR number.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 04157c21-3895-4632-adaa-3cd95c9aaed0
Merged via the queue into microsoft:main with commit da8c0e8Aug 25, 2026
17 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jenshnielsen@astafan8