microsoft / microsoft/Qcodes

What to do with channel instances after instrument is closed

Open
#1,356 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What happens when an instrument is closed but there are still instances of its `InstrumentChannel` channels lying around?

I suggest that their methods should be protected against this in order to help in debugging possible weird scenarios.

For example, for the SR860:
```python
lockin = SR860("lockin", "GPIB0::4::INSTR")
data_channel = lockin.data_channel_3
lockin.close()
data_channel.<...>(...) # <-- what will this do? raise a cryptic error?
```

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

Begin at InstrumentChannel and the instrument close() path, reproducing with SR860, data_channel_3, and lockin.close(). Determine the current behavior and agree on what channel methods should do after closure; then locate or add the relevant test coverage. Done is a documented, intentional outcome for calls on retained channels, with tests covering it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.