microsoft / microsoft/Qcodes

Instrument.close()

Open
#277 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

The Instrument.close() removes the .name field from the Instrument. This gives problems when printing the instrument. The removal happens in strip_attrs.

I am not sure why all attributes are stripped, but maybe we could make an exception for the .name (and other variables) such that the .__repr__ and other basic functions still work.

Steps to reproduce
  1. Create an instrument
  2. Call instrument.close()
  3. Type print(instrument)
Expected behaviour

The name of the instrument should be printed, perhaps in combination with a notifier that the instrument is closed

Actual behaviour

An error is generated

@alexcjohnson @giulioungaretti

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Instrument.close() and the strip_attrs path mentioned in the issue, then reproduce the failure by creating an instrument, closing it, and printing it. Confirm what state remains available after close and make the completed behavior preserve a printable name or otherwise avoid the error, with the reproduction steps serving as the check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.