microsoft / microsoft/Qcodes

Inheriting from ZNB to support other R&S VNAs

Open
#6,518 1 comment 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

Hello! In https://github.com/microsoft/Qcodes/blob/d4e1e15de07c4d3a4cd94445dd614637d96aec31/src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py#L1057, would it be possible to move
```
m_frequency = {
"ZNB4": (9e3, 4.5e9),
"ZNB8": (9e3, 8.5e9),
"ZNB20": (100e3, 20e9),
"ZNB40": (10e6, 40e9),
}

```
outside of the init so that it becomes a class attribute that we can override, and then in the init just do
```
if model not in self.m_frequency.keys():
raise RuntimeError(f"Unsupported ZNB model {model}")
```

The same question would hold for
```
self._model_min_source_power = {
"ZNB4": -80,
"ZNB8": -80,
"ZNB20": -60,
"ZNB40": -60,
}
```
in https://github.com/microsoft/Qcodes/blob/d4e1e15de07c4d3a4cd94445dd614637d96aec31/src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py#L440C1-L445C10

If this were the case, we could inherit from these classes and add support (in our local codebase, not asking you to support them explicitly!) for other R&S VNA's, such as the ZNL and the ZNLE. These VNA's follow the exact same programming as the ZNB but have different ranges for their frequencies and powers, for which right now we have to copy & paste most of the ZNB driver and adjust these few lines.

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

Open src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py at the referenced frequency-range and minimum-source-power sections, then inspect ZNB initialization and model validation. Done means the model-specific values are overridable at class level, unsupported models still raise the stated RuntimeError, and subclasses can provide ranges and powers for other Rohde & Schwarz VNAs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.