Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/time_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
nulinspiratie committed Nov 19, 2024
2 parents bffc646 + 0d6e3a3 commit 5403383
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
### Added
- Added time tagging to channels

### Fixed
- Change location of port feedforward and feedback filters in config


## [0.3.7]
### Added
Expand Down
8 changes: 6 additions & 2 deletions quam/components/ports/analog_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ 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"] = list(self.feedforward_filter)
port_properties.setdefault("filter", {})["feedforward"] = list(
self.feedforward_filter
)
if self.feedback_filter is not None:
port_properties["feedback_filter"] = list(self.feedback_filter)
port_properties.setdefault("filter", {})["feedback"] = list(
self.feedback_filter
)
if self.offset is not None:
port_properties["offset"] = self.offset
return port_properties
Expand Down
46 changes: 46 additions & 0 deletions tests/components/ports/test_lf_fem_analog_ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,52 @@ def test_lf_fem_analog_output_port():
}


def test_fem_analog_output_port_filter():
port = LFFEMAnalogOutputPort("con1", 1, 2)
port.feedforward_filter = None
port.feedback_filter = None

assert port.get_port_properties() == {
"delay": 0,
"shareable": False,
"output_mode": "direct",
"sampling_rate": 1e9,
"upsampling_mode": "mw",
}

port.feedforward_filter = [0.7, 0.2, 0.1]

assert port.get_port_properties() == {
"delay": 0,
"shareable": False,
"output_mode": "direct",
"sampling_rate": 1e9,
"upsampling_mode": "mw",
"filter": {"feedforward": [0.7, 0.2, 0.1]},
}

port.feedback_filter = [0.3, 0.4, 0.5]

assert port.get_port_properties() == {
"delay": 0,
"shareable": False,
"output_mode": "direct",
"sampling_rate": 1e9,
"upsampling_mode": "mw",
"filter": {"feedforward": [0.7, 0.2, 0.1], "feedback": [0.3, 0.4, 0.5]},
}

port.feedforward_filter = None
assert port.get_port_properties() == {
"delay": 0,
"shareable": False,
"output_mode": "direct",
"sampling_rate": 1e9,
"upsampling_mode": "mw",
"filter": {"feedback": [0.3, 0.4, 0.5]},
}


def test_lf_fem_analog_input_port():
with pytest.raises(TypeError):
LFFEMAnalogInputPort()
Expand Down

0 comments on commit 5403383

Please sign in to comment.