Skip to content

Merge pull request #452 from SaikiranGudla/master #16

Merge pull request #452 from SaikiranGudla/master

Merge pull request #452 from SaikiranGudla/master #16

GitHub Actions / Unit Test Results failed Dec 10, 2024 in 0s

5 fail, 1 006 skipped, 245 pass in 4m 16s

1 256 tests      245 ✔️  4m 16s ⏱️
       1 suites  1 006 💤
       1 files           5

Results for commit 505bcbf.

Annotations

Check warning on line 0 in test.rf.test_spec_est

See this annotation in the file changed.

@github-actions github-actions / Unit Test Results

test_spec_est_t1 (test.rf.test_spec_est) failed

results.xml
Raw output
def test_spec_est_t1():
        fs = 64
        length = 600  # seconds
        N = fs * length
        t = linspace(0, length, num=N, endpoint=False)
    
        # Generate a sinusoid at frequency f
        f = 10  # Hz
        a = cos(2 * pi * f * t) * 2 ** 15
    
>       amp, freqs = spec_est(a, fs, ref=2 ** 15, plot=False)

test/rf/test_spec_est.py:17: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = array([ 32768.        ,  18204.92539559, -12539.77071174, ...,
       -32138.37206828, -12539.7707117 ,  18204.92539557], shape=(38400,))
fs = 64, ref = 32768, plot = False

    def spec_est(x, fs, ref=2 ** 15, plot=False):
    
        N = len(x)
    
        # Apply window
>       window = signal.kaiser(N, beta=38)
E       AttributeError: module 'scipy.signal' has no attribute 'kaiser'

test/rf/spec.py:26: AttributeError

Check warning on line 0 in test.rf.test_spec_est

See this annotation in the file changed.

@github-actions github-actions / Unit Test Results

test_spec_est_t2 (test.rf.test_spec_est) failed

results.xml
Raw output
def test_spec_est_t2():
        fs = 64
        length = 600  # seconds
        N = fs * length
        t = linspace(0, length, num=N, endpoint=False)
    
        # Generate a sinusoid at frequency f
        f = 10  # Hz
        a = exp(1j * 2 * pi * f * t) * 2 ** 15
    
>       amp, freqs = spec_est(a, fs, ref=2 ** 15, plot=False)

test/rf/test_spec_est.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = array([ 32768.            +0.j        ,  18204.92539559+27245.59625593j,
       -12539.77071174+30273.68452133j, ...,
...138.37206828 -6392.71967168j, -12539.7707117 -30273.68452134j,
        18204.92539557-27245.59625594j], shape=(38400,))
fs = 64, ref = 32768, plot = False

    def spec_est(x, fs, ref=2 ** 15, plot=False):
    
        N = len(x)
    
        # Apply window
>       window = signal.kaiser(N, beta=38)
E       AttributeError: module 'scipy.signal' has no attribute 'kaiser'

test/rf/spec.py:26: AttributeError

Check warning on line 0 in test.rf.test_spec_est

See this annotation in the file changed.

@github-actions github-actions / Unit Test Results

test_spec_est_t3 (test.rf.test_spec_est) failed

results.xml
Raw output
def test_spec_est_t3():
        fs = 64
        length = 600  # seconds
        N = fs * length
        t = linspace(0, length, num=N, endpoint=False)
    
        # Generate a sinusoid at frequency f
        f = 0  # Hz
        a = cos(2 * pi * f * t) * 2 ** 15
        # a = exp(1j * 2 * pi * f * t) * 2 ** 15
    
>       amp, freqs = spec_est(a, fs, ref=2 ** 15, plot=False)

test/rf/test_spec_est.py:48: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = array([32768., 32768., 32768., ..., 32768., 32768., 32768.],
      shape=(38400,))
fs = 64, ref = 32768, plot = False

    def spec_est(x, fs, ref=2 ** 15, plot=False):
    
        N = len(x)
    
        # Apply window
>       window = signal.kaiser(N, beta=38)
E       AttributeError: module 'scipy.signal' has no attribute 'kaiser'

test/rf/spec.py:26: AttributeError

Check warning on line 0 in test.rf.test_spec_est

See this annotation in the file changed.

@github-actions github-actions / Unit Test Results

test_spec_est_t4 (test.rf.test_spec_est) failed

results.xml
Raw output
def test_spec_est_t4():
        fs = 64
        length = 600  # seconds
        N = fs * length
        t = linspace(0, length, num=N, endpoint=False)
    
        # Generate a sinusoid at frequency f
        f = 0  # Hz
        # a = cos(2 * pi * f * t) * 2 ** 15
        a = exp(1j * 2 * pi * f * t) * 2 ** 15
    
>       amp, freqs = spec_est(a, fs, ref=2 ** 15, plot=False)

test/rf/test_spec_est.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = array([32768.+0.j, 32768.+0.j, 32768.+0.j, ..., 32768.+0.j, 32768.+0.j,
       32768.+0.j], shape=(38400,))
fs = 64, ref = 32768, plot = False

    def spec_est(x, fs, ref=2 ** 15, plot=False):
    
        N = len(x)
    
        # Apply window
>       window = signal.kaiser(N, beta=38)
E       AttributeError: module 'scipy.signal' has no attribute 'kaiser'

test/rf/spec.py:26: AttributeError

Check warning on line 0 in test.test_adxl355

See this annotation in the file changed.

@github-actions github-actions / Unit Test Results

test_adxl355_rx_data[2-adi.adxl355] (test.test_adxl355) failed

results.xml
Raw output
uri = 'ip:10.1.0.79', classname = 'adi.adxl355', channel = 2, use_rx2 = False
buffer_size = 32, annotated = False

    def dma_rx(
        uri, classname, channel, use_rx2=False, buffer_size=2 ** 15, annotated=False
    ):
        """dma_rx: Construct RX buffers and verify data is non-zero when pulled.
        Collected buffer is of size 2**15 and 10 buffers are checked
    
        parameters:
            uri: type=string
                URI of IIO context of target board/system
            classname: type=string
                Name of pyadi interface class which contain attribute
            channel: type=list
                List of integers or list of list of integers of channels to
                enable through rx_enabled_channels
            use_rx2: type=bool
                If True, use rx2() instead of rx()
            buffer_size: type=int
                Size of RX buffer in samples. Defaults to 2**15
            annotated: type=bool
                If True, annotated output is provided (dict)
        """
        sdr = eval(classname + "(uri='" + uri + "')")
        N = buffer_size
    
        if use_rx2:
            sdr.rx2_enabled_channels = channel if isinstance(channel, list) else [channel]
            sdr.rx2_buffer_size = N * len(sdr.rx2_enabled_channels)
        else:
            sdr.rx_enabled_channels = channel if isinstance(channel, list) else [channel]
            sdr.rx_buffer_size = N * len(sdr.rx_enabled_channels)
    
        sdr.rx_annotated = annotated
        try:
            for _ in range(10):
>               data = sdr.rx2() if use_rx2 else sdr.rx()

test/dma_tests.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
adi/rx_tx.py:290: in rx
    data = self.__rx_unbuffered_data()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <adi.adxl355.adxl355 object at 0x7f35587fd6f0>

    def __rx_unbuffered_data(self):
        x = []
        t = (
            self._rx_data_si_type
            if self._rx_output_type == "SI"
            else self._rx_data_type
        )
        for _ in range(len(self.rx_enabled_channels)):
            x.append(np.zeros(self.rx_buffer_size, dtype=t))
    
        # Get scalers first
        if self._rx_output_type == "SI":
            rx_scale = self.__get_rx_channel_scales()
            rx_offset = self.__get_rx_channel_offsets()
    
        for samp in range(self.rx_buffer_size):
            for i, m in enumerate(self.rx_enabled_channels):
                s = self._get_iio_attr(
                    self._rx_channel_names[m], "raw", False, self._rxadc
                )
                if self._rx_output_type == "SI":
                    x[i][samp] = rx_scale[i] * s + rx_offset[i]
                else:
>                   x[i][samp] = s
E                   OverflowError: Python integer 257934 out of bounds for int16

adi/rx_tx.py:222: OverflowError

The above exception was the direct cause of the following exception:

test_dma_rx = <function dma_rx at 0x7f355cb297e0>, iio_uri = 'ip:10.1.0.79'
classname = 'adi.adxl355', channel = 2

    @pytest.mark.iio_hardware(hardware)
    @pytest.mark.parametrize("classname", [(classname)])
    @pytest.mark.parametrize("channel", [0, 1, 2])
    def test_adxl355_rx_data(test_dma_rx, iio_uri, classname, channel):
>       test_dma_rx(iio_uri, classname, channel, buffer_size=2 ** 5)

test/test_adxl355.py:11: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

uri = 'ip:10.1.0.79', classname = 'adi.adxl355', channel = 2, use_rx2 = False
buffer_size = 32, annotated = False

    def dma_rx(
        uri, classname, channel, use_rx2=False, buffer_size=2 ** 15, annotated=False
    ):
        """dma_rx: Construct RX buffers and verify data is non-zero when pulled.
        Collected buffer is of size 2**15 and 10 buffers are checked
    
        parameters:
            uri: type=string
                URI of IIO context of target board/system
            classname: type=string
                Name of pyadi interface class which contain attribute
            channel: type=list
                List of integers or list of list of integers of channels to
                enable through rx_enabled_channels
            use_rx2: type=bool
                If True, use rx2() instead of rx()
            buffer_size: type=int
                Size of RX buffer in samples. Defaults to 2**15
            annotated: type=bool
                If True, annotated output is provided (dict)
        """
        sdr = eval(classname + "(uri='" + uri + "')")
        N = buffer_size
    
        if use_rx2:
            sdr.rx2_enabled_channels = channel if isinstance(channel, list) else [channel]
            sdr.rx2_buffer_size = N * len(sdr.rx2_enabled_channels)
        else:
            sdr.rx_enabled_channels = channel if isinstance(channel, list) else [channel]
            sdr.rx_buffer_size = N * len(sdr.rx_enabled_channels)
    
        sdr.rx_annotated = annotated
        try:
            for _ in range(10):
                data = sdr.rx2() if use_rx2 else sdr.rx()
                if annotated:
                    print(data)
                    assert list(data.keys()) == [
                        sdr._rx_channel_names[ec] for ec in sdr.rx_enabled_channels
                    ]
                    for ci in sdr.rx_enabled_channels:
                        assert np.max(np.abs(data[sdr._rx_channel_names[ci]])) > 0
                else:
                    if isinstance(data, list):
                        for chan in data:
                            assert np.max(np.abs(chan)) > 0, "Buffer all zeros"
                    else:
                        assert np.max(np.abs(data)) > 0, "Buffer all zeros"
        except Exception as e:
            del sdr
>           raise Exception(e) from e
E           Exception: Python integer 257934 out of bounds for int16

test/dma_tests.py:69: Exception