From 88d520d519968913b528ebe4c8a4fc8d77e972c7 Mon Sep 17 00:00:00 2001 From: Serwan Asaad Date: Thu, 19 Sep 2024 06:39:35 -0400 Subject: [PATCH] Fix: Remove upsampling mode for LFFEMAnalogOutputPort when sampling_rate != 1e9 --- quam/components/ports/analog_outputs.py | 3 ++- tests/components/ports/test_lf_fem_analog_ports.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/quam/components/ports/analog_outputs.py b/quam/components/ports/analog_outputs.py index 4d1954ee..1365581f 100644 --- a/quam/components/ports/analog_outputs.py +++ b/quam/components/ports/analog_outputs.py @@ -56,7 +56,8 @@ class LFFEMAnalogOutputPort(LFAnalogOutputPort, FEMPort): def get_port_properties(self) -> Dict[str, Any]: port_properties = super().get_port_properties() port_properties["sampling_rate"] = self.sampling_rate - port_properties["upsampling_mode"] = self.upsampling_mode + if self.sampling_rate == 1e9: + port_properties["upsampling_mode"] = self.upsampling_mode port_properties["output_mode"] = self.output_mode return port_properties diff --git a/tests/components/ports/test_lf_fem_analog_ports.py b/tests/components/ports/test_lf_fem_analog_ports.py index 8d9cbfad..b76a07b8 100644 --- a/tests/components/ports/test_lf_fem_analog_ports.py +++ b/tests/components/ports/test_lf_fem_analog_ports.py @@ -72,6 +72,16 @@ def test_lf_fem_analog_output_port(): "offset": 0.1, } + port.sampling_rate = 2e9 + + assert port.get_port_properties() == { + "delay": 0, + "shareable": False, + "output_mode": "direct", + "sampling_rate": 2e9, + "offset": 0.1, + } + def test_lf_fem_analog_input_port(): with pytest.raises(TypeError):