From 15884f662f4e087283cef2912fe030583382c5e2 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Mon, 29 Jul 2024 09:02:16 +0800 Subject: [PATCH] fix lint Signed-off-by: Trecia Agoylo --- adi/ad937x.py | 15 +++++++++------ examples/ad9371.py | 3 ++- examples/ad9371_dec8.py | 2 +- test/common.py | 4 +--- test/test_ad9371.py | 6 +++--- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/adi/ad937x.py b/adi/ad937x.py index 980260929..4dfa425a6 100644 --- a/adi/ad937x.py +++ b/adi/ad937x.py @@ -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] @@ -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.") @@ -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] @@ -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 diff --git a/examples/ad9371.py b/examples/ad9371.py index 84a95db3e..0071c0f4e 100644 --- a/examples/ad9371.py +++ b/examples/ad9371.py @@ -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 diff --git a/examples/ad9371_dec8.py b/examples/ad9371_dec8.py index 10ee9a0a9..9acc6636a 100644 --- a/examples/ad9371_dec8.py +++ b/examples/ad9371_dec8.py @@ -2,8 +2,8 @@ # # SPDX short identifier: ADIBSD -import time import sys +import time import adi import matplotlib.pyplot as plt diff --git a/test/common.py b/test/common.py index 7ab136852..f10903c2d 100644 --- a/test/common.py +++ b/test/common.py @@ -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") diff --git a/test/test_ad9371.py b/test/test_ad9371.py index e76cb57f8..b780d2c5f 100644 --- a/test/test_ad9371.py +++ b/test/test_ad9371.py @@ -243,7 +243,7 @@ obs_gain_control_mode="manual", obs_hardwaregain=20, obs_temp_comp_gain=0, - ) + ), ) @@ -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, @@ -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])