diff --git a/.github/workflows/run_test.yaml b/.github/workflows/run_test.yaml index 1a51154..75f5b6c 100644 --- a/.github/workflows/run_test.yaml +++ b/.github/workflows/run_test.yaml @@ -7,8 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8"] - + python-version: [3.8, 3.11] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/setup.py b/setup.py index 46731cf..001cba0 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ 'IPython', 'future', 'numpy', - 'katcp==0.9.3', + 'katcp>=0.9.3', 'katversion', 'odict', 'setuptools', diff --git a/src/casperfpga.py b/src/casperfpga.py index 529d27d..5d7e198 100644 --- a/src/casperfpga.py +++ b/src/casperfpga.py @@ -4,7 +4,11 @@ import socket from time import strptime import string -from collections.abc import Callable +try: + from collections import Callable +except(ImportError): + # starting in Python 3.10, Callable is in abc + from collections.abc import Callable from . import register from . import sbram diff --git a/src/snapadc.py b/src/snapadc.py index 6bc0f1f..2ad3f63 100644 --- a/src/snapadc.py +++ b/src/snapadc.py @@ -982,8 +982,9 @@ def isFrameClockAligned(self): logger.error('Frame clock NOT aligned.\n{0}'.format(str(errs))) return False - def rampTest(self, nchecks=300, retry=False): - chips = self.adcList + def rampTest(self, chips=None, nchecks=300, retry=False): + if chips is None: + chips = self.adcList self.logger.debug('Ramp test on ADCs: %s' % str(chips)) failed_chips = {} self.setDemux(numChannel=1) @@ -992,7 +993,7 @@ def rampTest(self, nchecks=300, retry=False): self.adc.test("en_ramp") for cnt in range(nchecks): self.snapshot() - for chip,d in self.readRAM(signed=False).items(): + for chip,d in self.readRAM(chips, signed=False).items(): ans = (predicted + d[0,0]) % 256 failed_lanes = np.sum(d != ans, axis=0) if np.any(failed_lanes) > 0: @@ -1040,7 +1041,7 @@ def isLaneBonded(self, bondAllAdcs=False): def from_device_info(cls, parent, device_name, device_info, initialize=False, **kwargs): """ Process device info and the memory map to get all the necessary info - and return a SKARAB ADC instance. + and return a ADC instance. :param parent: The parent device, normally a casperfpga instance :param device_name: :param device_info: @@ -1049,4 +1050,8 @@ def from_device_info(cls, parent, device_name, device_info, initialize=False, ** :param kwargs: :return: """ - return cls(parent, device_name, device_info, initialize, **kwargs) + host = parent + #return cls(parent, device_name, device_info, initialize, **kwargs) + # XXX should device_info be passed as kwargs to cls? Would require renaming + # some parameters, so am not for now. + return cls(host)