Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheriting from ZNB to support other R&S VNAs #6518

Open
abargerbos opened this issue Oct 11, 2024 · 1 comment
Open

Inheriting from ZNB to support other R&S VNAs #6518

abargerbos opened this issue Oct 11, 2024 · 1 comment

Comments

@abargerbos
Copy link

abargerbos commented Oct 11, 2024

Hello! In

, 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.

@jenshnielsen
Copy link
Collaborator

@abargerbos That sounds file, please feel free to make the changes and submit a pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants