Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up adc.py #304

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Clean up adc.py #304

wants to merge 2 commits into from

Conversation

DanielSank
Copy link
Member

  • Line lengths
  • Dangling white space
  • Remove copypasta from ADC interface spec sheet

@jwenner
Copy link
Contributor

jwenner commented Jan 20, 2016

FYI, there's an fpga test which this breaks:

  test_fpga_server.top_level_collect 
('fpgalib/test/test_fpga_server.py', None, 'fpgalib/test/test_fpga_server.py')
.venv/local/lib/python2.7/site-packages/_pytest/python.py:610: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
.venv/local/lib/python2.7/site-packages/py/_path/local.py:650: in pyimport
    __import__(modname)
.venv/local/lib/python2.7/site-packages/_pytest/assertion/rewrite.py:171: in load_module
    py.builtin.exec_(co, mod.__dict__)
servers/fpgalib/test/test_fpga_server.py:28: in <module>
    import ghz_fpga_server
servers/ghz_fpga_server.py:212: in <module>
    import fpgalib.adc as adc
E     File "/opt/TeamCity/buildAgent/work/872fe26a728e05ba/servers/fpgalib/adc.py", line 60
E       self.boardGroup = group
E          ^
E   SyntaxError: invalid syntax

def buildRunner(self, reps, info):
"""Get a runner for this board"""
runMode = info['runMode']
startDelay = info['startDelay']
filter = (info['filterFunc'], info['filterStretchLen'], info['filterStretchAt'])
channels = dict((i, info[i]) for i in range(self.DEMOD_CHANNELS) \
if i in info)
channels = dict((i, info[i])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 2.7 has dict comprehensions so you could do

channels = {i: info[i]
            for i in range(self.DEMOD_CHANNELS) if i in info}

@maffoo
Copy link
Contributor

maffoo commented Jan 26, 2016

A few small comments, and need to fix syntax error; otherwise LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants