Skip to content

Commit 6ee0e57

Browse files
authored
Merge pull request #67 from casper-astro/py311
Updates to make py311 compatible, and a couple of snapadc tweaks.
2 parents 0b07705 + a641376 commit 6ee0e57

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

.github/workflows/run_test.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: ["3.8"]
11-
10+
python-version: [3.8, 3.11]
1211
steps:
1312
- uses: actions/checkout@v3
1413
- name: Set up Python ${{ matrix.python-version }}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
'IPython',
5555
'future',
5656
'numpy',
57-
'katcp==0.9.3',
57+
'katcp>=0.9.3',
5858
'katversion',
5959
'odict',
6060
'setuptools',

src/casperfpga.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
import socket
55
from time import strptime
66
import string
7-
from collections.abc import Callable
7+
try:
8+
from collections import Callable
9+
except(ImportError):
10+
# starting in Python 3.10, Callable is in abc
11+
from collections.abc import Callable
812

913
from . import register
1014
from . import sbram

src/snapadc.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,9 @@ def isFrameClockAligned(self):
982982
logger.error('Frame clock NOT aligned.\n{0}'.format(str(errs)))
983983
return False
984984

985-
def rampTest(self, nchecks=300, retry=False):
986-
chips = self.adcList
985+
def rampTest(self, chips=None, nchecks=300, retry=False):
986+
if chips is None:
987+
chips = self.adcList
987988
self.logger.debug('Ramp test on ADCs: %s' % str(chips))
988989
failed_chips = {}
989990
self.setDemux(numChannel=1)
@@ -992,7 +993,7 @@ def rampTest(self, nchecks=300, retry=False):
992993
self.adc.test("en_ramp")
993994
for cnt in range(nchecks):
994995
self.snapshot()
995-
for chip,d in self.readRAM(signed=False).items():
996+
for chip,d in self.readRAM(chips, signed=False).items():
996997
ans = (predicted + d[0,0]) % 256
997998
failed_lanes = np.sum(d != ans, axis=0)
998999
if np.any(failed_lanes) > 0:
@@ -1040,7 +1041,7 @@ def isLaneBonded(self, bondAllAdcs=False):
10401041
def from_device_info(cls, parent, device_name, device_info, initialize=False, **kwargs):
10411042
"""
10421043
Process device info and the memory map to get all the necessary info
1043-
and return a SKARAB ADC instance.
1044+
and return a ADC instance.
10441045
:param parent: The parent device, normally a casperfpga instance
10451046
:param device_name:
10461047
:param device_info:
@@ -1049,4 +1050,8 @@ def from_device_info(cls, parent, device_name, device_info, initialize=False, **
10491050
:param kwargs:
10501051
:return:
10511052
"""
1052-
return cls(parent, device_name, device_info, initialize, **kwargs)
1053+
host = parent
1054+
#return cls(parent, device_name, device_info, initialize, **kwargs)
1055+
# XXX should device_info be passed as kwargs to cls? Would require renaming
1056+
# some parameters, so am not for now.
1057+
return cls(host)

0 commit comments

Comments
 (0)