Skip to content

Commit

Permalink
channel tuple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nulinspiratie committed Jul 1, 2024
1 parent 0484896 commit 823a788
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
36 changes: 18 additions & 18 deletions quam/components/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def generate_element_config(self) -> Dict[str, int]:
Contains "port", and optionally "delay", "buffer" if specified
"""
if isinstance(self.opx_output, DigitalOutputPort):
opx_output = self.opx_output.port
opx_output = self.opx_output.port_tuple
else:
opx_output = self.opx_output
opx_output = tuple(self.opx_output)

digital_cfg: Dict[str, Any] = {"port": tuple(opx_output)}
digital_cfg: Dict[str, Any] = {"port": opx_output}
if self.delay is not None:
digital_cfg["delay"] = self.delay
if self.buffer is not None:
Expand Down Expand Up @@ -520,22 +520,22 @@ def apply_to_config(self, config: dict):
opx_port = self.opx_output
elif len(self.opx_output) == 2:
opx_port = OPXPlusAnalogOutputPort(
port=self.opx_output,
*self.opx_output,
offset=self.opx_output_offset,
feedforward_filter=list(self.filter_fir_taps),
feedback_filter=list(self.filter_iir_taps),
feedforward_filter=self.filter_fir_taps,
feedback_filter=self.filter_iir_taps,
)
opx_port.apply_to_config(config)
else:
opx_port = LFFEMAnalogOutputPort(
port=self.opx_output,
*self.opx_output,
offset=self.opx_output_offset,
feedforward_filter=list(self.filter_fir_taps),
feedback_filter=list(self.filter_iir_taps),
feedforward_filter=self.filter_fir_taps,
feedback_filter=self.filter_iir_taps,
)
opx_port.apply_to_config(config)

element_config["singleInput"] = {"port": tuple(opx_port.port)}
element_config["singleInput"] = {"port": opx_port.port_tuple}


@quam_dataclass
Expand Down Expand Up @@ -582,16 +582,16 @@ def apply_to_config(self, config: dict):
opx_port = self.opx_input
elif len(self.opx_input) == 2:
opx_port = OPXPlusAnalogInputPort(
port=self.opx_input, offset=self.opx_input_offset
*self.opx_input, offset=self.opx_input_offset
)
opx_port.apply_to_config(config)
else:
opx_port = LFFEMAnalogInputPort(
port=self.opx_input, offset=self.opx_input_offset
*self.opx_input, offset=self.opx_input_offset
)
opx_port.apply_to_config(config)

element_config["outputs"] = {"out1": tuple(opx_port.port)}
element_config["outputs"] = {"out1": opx_port.port_tuple}

def measure(
self,
Expand Down Expand Up @@ -1100,16 +1100,16 @@ def apply_to_config(self, config: dict):
opx_port = opx_input
elif len(opx_input) == 2:
opx_port = OPXPlusAnalogInputPort(
port=opx_input, offset=offset, gain_db=self.input_gain
*opx_input, offset=offset, gain_db=self.input_gain
)
opx_port.apply_to_config(config)
else:
opx_port = LFFEMAnalogInputPort(
port=opx_input, offset=offset, gain_db=self.input_gain
*opx_input, offset=offset, gain_db=self.input_gain
)
opx_port.apply_to_config(config)
if not isinstance(self.frequency_converter_down, OctaveDownConverter):
element_cfg["outputs"][f"out{k}"] = tuple(opx_port.port)
element_cfg["outputs"][f"out{k}"] = opx_port.port_tuple

def measure(
self,
Expand Down Expand Up @@ -1496,7 +1496,7 @@ def apply_to_config(self, config: Dict) -> None:
super().apply_to_config(config)

element_cfg = config["elements"][self.name]
element_cfg["MWInput"] = tuple(self.opx_output.port)
element_cfg["MWInput"] = self.opx_output.port_tuple
element_cfg["upconverter"] = self.upconverter


Expand All @@ -1508,7 +1508,7 @@ def apply_to_config(self, config: Dict) -> None:
super().apply_to_config(config)

element_cfg = config["elements"][self.name]
element_cfg["MWOutput"] = tuple(self.opx_input.port)
element_cfg["MWOutput"] = self.opx_input.port_tuple


@quam_dataclass
Expand Down
4 changes: 2 additions & 2 deletions quam/components/ports/analog_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def get_port_properties(self):
if self.crosstalk is not None:
port_properties["crosstalk"] = self.crosstalk
if self.feedforward_filter is not None:
port_properties["feedforward_filter"] = self.feedforward_filter
port_properties["feedforward_filter"] = list(self.feedforward_filter)
if self.feedback_filter is not None:
port_properties["feedback_filter"] = self.feedback_filter
port_properties["feedback_filter"] = list(self.feedback_filter)
if self.offset is not None:
port_properties["offset"] = self.offset
return port_properties
Expand Down

0 comments on commit 823a788

Please sign in to comment.