Skip to content

Migrate off deprecated qcodes.instrument.base module #131

@marcosfrenkel

Description

@marcosfrenkel

Context

Every test run surfaces this warning:

```
src/instrumentserver/blueprints.py:68: QCoDeSDeprecationWarning: The `qcodes.instrument.base` module is deprecated. Please consult the api documentation at https://microsoft.github.io/Qcodes/api/index.html for alternatives.
from qcodes.instrument.base import InstrumentBase
```

qcodes 0.55.0 has removed `InstrumentBase` from the deprecated submodule path. The canonical public import is:

```python
from qcodes.instrument import InstrumentBase
```

(The actual implementation now lives at `qcodes.instrument.instrument_base`, but consumers should use the package-level re-export, not the underscored module.)

Sites

```
src/instrumentserver/blueprints.py:68
src/instrumentserver/client/proxy.py:21
src/instrumentserver/params.py:9
src/instrumentserver/serialize.py:76
```

All four use the same `from qcodes.instrument.base import InstrumentBase` pattern.

Fix

Replace each occurrence:

```python

  • from qcodes.instrument.base import InstrumentBase
  • from qcodes.instrument import InstrumentBase
    ```

Verification

  • `uv run pytest` no longer emits `QCoDeSDeprecationWarning` for these modules.
  • `uv run mypy` and `uv run ruff check src/` remain green.
  • Functional behaviour unchanged (`InstrumentBase` is the same class; only the import path differs).

Notes

While here, it's worth a quick audit of other deprecated qcodes paths surfaced by the same release. Likely candidates to check:

  • `qcodes.instrument.parameter` — many parameter types now re-exported from `qcodes.parameters`.
  • `qcodes.instrument.channel` — same story for `InstrumentChannel` / `ChannelList` (current code already imports `InstrumentChannel` from the top-level `qcodes`, which is fine).

Out of scope for this issue if no warnings fire from those paths in CI; in scope if they do.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions