Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Trecia Agoylo <[email protected]>
  • Loading branch information
tagoylo committed Jul 29, 2024
1 parent a457968 commit 15884f6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
15 changes: 9 additions & 6 deletions adi/ad937x.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ def tx_rf_bandwidth(self):
def rx_enable_dec8(self):
"""rx_enable_dec8: Enable x8 decimation filter in RX path"""
val = self._get_iio_attr_str(
"voltage0_i", "sampling_frequency", False, self._rxadc
)
"voltage0_i", "sampling_frequency", False, self._rxadc
)
avail = None
try:
avail = self._get_iio_attr_str(
"voltage0_i", "sampling_frequency_available", False, self._rxadc
"voltage0_i", "sampling_frequency_available", False, self._rxadc
)
avail = avail.strip().split(" ")
return val == avail[1]
Expand All @@ -191,7 +191,9 @@ def rx_enable_dec8(self, value):
)
avail = sorted(avail.strip().split(" "))
val = int(avail[1] if value else avail[0])
self._set_iio_attr("voltage0_i", "sampling_frequency", False, val, self._rxadc)
self._set_iio_attr(
"voltage0_i", "sampling_frequency", False, val, self._rxadc
)
except KeyError:
print("x8 decimation filter is not supported.")

Expand All @@ -200,11 +202,11 @@ def tx_enable_int8(self):
"""tx_enable_int8: Enable x8 interpolation filter in TX path"""
val = self._get_iio_attr_str(
"voltage0", "sampling_frequency", True, self._txdac
)
)
avail = None
try:
avail = self._get_iio_attr_str(
"voltage0", "sampling_frequency_available", True, self._txdac
"voltage0", "sampling_frequency_available", True, self._txdac
)
avail = avail.strip().split(" ")
return val == avail[1]
Expand All @@ -222,6 +224,7 @@ def tx_enable_int8(self, value):
self._set_iio_attr("voltage0", "sampling_frequency", True, val, self._txdac)
except KeyError:
print("x8 decimation filter is not supported.")

@property
def rx_sample_rate(self):
"""rx_sample_rate: Sample rate RX path in samples per second
Expand Down
3 changes: 2 additions & 1 deletion examples/ad9371.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#
# SPDX short identifier: ADIBSD

import time
import sys
import time

import adi
import matplotlib.pyplot as plt
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion examples/ad9371_dec8.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# SPDX short identifier: ADIBSD

import time
import sys
import time

import adi
import matplotlib.pyplot as plt
Expand Down
4 changes: 1 addition & 3 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ def pytest_runtest_setup(item):
"Testing requiring observation disabled. Use --obs-enable flag to enable"
)
if obs and "no_obs_required" in marks:
pytest.skip(
"Testing requiring observation enabled. Skipping this test"
)
pytest.skip("Testing requiring observation enabled. Skipping this test")

# Handle CMOS and LVDS tests
cmos = item.config.getoption("--cmos")
Expand Down
6 changes: 3 additions & 3 deletions test/test_ad9371.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
obs_gain_control_mode="manual",
obs_hardwaregain=20,
obs_temp_comp_gain=0,
)
),
)


Expand Down Expand Up @@ -513,7 +513,7 @@ def test_ad9371_dds_gain_check_vary_power(
(1, params["change_rf_gain_0dB_manual"], 0.25, 24, 26.5),
(0, params["change_temp_gain_up"], 0.25, 24, 26.5),
(1, params["change_temp_gain_up"], 0.25, 14, 16.5),
]
],
)
def test_ad9371_dds_gain_check_vary_power_with_10dB_splitter(
test_gain_check,
Expand Down Expand Up @@ -590,7 +590,7 @@ def test_ad9371_sfdr_with_10dB_splitter(
"channel, param_set, sfdr_min",
[
(0, params_obs["obs_orx1_change_attenuation_10dB"], 30),
(0, params_obs["snf_orx1_change_attenuation_10dB"], 30)
(0, params_obs["snf_orx1_change_attenuation_10dB"], 30),
],
)
@pytest.mark.parametrize("use_obs", [True])
Expand Down

0 comments on commit 15884f6

Please sign in to comment.