Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsecher committed Oct 17, 2022
2 parents 526ca91 + 70567ba commit 00a6947
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 44 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10"]
exclude:
- os: windows-latest
python-version: 3.8
python-version: "3.9"
- os: windows-latest
python-version: 3.9
python-version: "3.10"
env:
DISPLAY: ':99.0'
OS: ${{ matrix.os }}
UPLOAD_TO_GHPAGES: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v3.0.2
- uses: actions/checkout@v3.1.0
with:
fetch-depth: '0'
# if we upload to ghpages we need the full
# history to generate correct version info
if: ${{ fromJSON(env.UPLOAD_TO_GHPAGES) }}
- uses: actions/checkout@v3.0.2
- uses: actions/checkout@v3.1.0
if: ${{ !fromJSON(env.UPLOAD_TO_GHPAGES) }}
- name: setup ubuntu-latest xvfb
uses: ./.github/actions/setup-ubuntu-latest-xvfb
Expand All @@ -47,14 +47,14 @@ jobs:
args: install pandoc
if: runner.os == 'Windows'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.2.0
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.python-version }}
- name: prepare pip cache
id: prepare-cache-pip
uses: ./.github/actions/prepare-cache-pip
- name: pip cache
uses: actions/[email protected].8
uses: actions/[email protected].11
with:
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/setup.cfg') }}
Expand All @@ -80,7 +80,7 @@ jobs:
name: docs_${{ matrix.python-version }}_${{ matrix.os }}
path: ${{ github.workspace }}/docs/_build/html
- name: Deploy to gh pages
uses: JamesIves/[email protected].0
uses: JamesIves/[email protected].1
with:
branch: gh-pages
folder: ${{ github.workspace }}/docs/_build/html
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,33 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10"]
exclude:
- os: windows-latest
python-version: 3.8
python-version: "3.9"
- os: windows-latest
python-version: 3.9
python-version: "3.10"
env:
DISPLAY: ':99.0'
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3.0.2
- uses: actions/checkout@v3.1.0
with:
submodules: true
- name: setup ubuntu-latest xvfb
uses: ./.github/actions/setup-ubuntu-latest-xvfb
if: runner.os == 'Linux'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.2.0
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.python-version }}
- name: prepare pip cache
id: prepare-cache-pip
uses: ./.github/actions/prepare-cache-pip
- name: pip cache
uses: actions/[email protected].8
uses: actions/[email protected].11
with:
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/setup.cfg') }}
Expand All @@ -55,12 +55,11 @@ jobs:
pip install .[test] -c requirements.txt
- name: Run Mypy
run: mypy qcodes_contrib_drivers
if: matrix.python-version != '3.7'
- name: Run tests
run: |
pytest --cov=qcodes_contrib_drivers --cov-report xml --cov-config=setup.cfg qcodes_contrib_drivers
- name: Upload coverage to Codecov
uses: codecov/[email protected].0
uses: codecov/[email protected].1
with:
file: ./coverage.xml
env_vars: OS,PYTHON
6 changes: 3 additions & 3 deletions .github/workflows/upload_to_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3.0.2
- uses: actions/checkout@v3.1.0
- name: Set up Python
uses: actions/setup-python@v4.2.0
uses: actions/setup-python@v4.3.0
with:
python-version: '3.7'
python-version: '3.10'
- name: Install build deps
run: pip install --upgrade pip setuptools wheel build
- name: Build
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module = [
"py_header.*",
"pyspcm",
"spirack",
"zhinst.*"
"zhinst.*",
"ruamel.*"
]
ignore_missing_imports = true

Expand Down
7 changes: 6 additions & 1 deletion qcodes_contrib_drivers/drivers/SignalCore/SignalCore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ctypes
import ctypes.wintypes
import os
import sys
from typing import Dict, Optional
Expand Down Expand Up @@ -203,7 +204,11 @@ def __init__(self, name: str,
self.connect_message()

def _open(self) -> None:
self._handle = ctypes.wintypes.HANDLE()
if sys.platform == "win32":
self._handle = ctypes.wintypes.HANDLE()
else:
raise EnvironmentError(f"{self.__class__.__name__} is supported only on Windows platform")

self._dll.sc5520a_uhfsOpenDevice(COMMINTERFACE, self.buffer_pointer_array[0], ctypes.c_uint8(1), ctypes.byref(self._handle))

def _close(self) -> None:
Expand Down
42 changes: 23 additions & 19 deletions qcodes_contrib_drivers/drivers/Tektronix/AFG3000.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class AFG3000(VisaInstrument):
"""Qcodes driver for Tektronix AFG3000 series arbitrary function generator.
Not all instrument functionality is included here.
"""

Expand Down Expand Up @@ -51,14 +51,14 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_parser=str,
set_cmd=f'OUTPut{src}:POLarity {{}}',
vals=vals.Enum('NORMal', 'NORM', 'INVerted', 'INV')
)
)
self.add_parameter(
name=f'state_output{src}',
label=f'Output {src} state',
get_cmd=f'OUTPut{src}:STATe?',
set_cmd=f'OUTPut{src}:STATe {{}}',
val_mapping=on_off_map
)
)

# Amplitude modulation
self.add_parameter(
Expand All @@ -68,7 +68,9 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_cmd=f'SOURce{src}:AM:DEPTh?',
get_parser=float,
set_cmd=f'SOURce{src}:AM:DEPTh {{}}PCT',
vals=vals.PermissiveMultiples(divisor=0.1) # TODO min_value=0, max_value=120
vals=vals.MultiType(vals.Numbers(min_value=0, max_value=120),
vals.PermissiveMultiples(divisor=0.1),
combiner='AND')
)

# Frequency modulation
Expand Down Expand Up @@ -113,8 +115,10 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_cmd=f'SOURce{src}:{mod_type}:INTernal:FREQuency?',
get_parser=float,
set_cmd=f'SOURce{src}:{mod_type}:INTernal:FREQuency {{}}Hz',
vals=vals.PermissiveMultiples(divisor=1e-3) # TODO min_value=2e-3, max_value=5e4
)
vals=vals.MultiType(vals.Numbers(min_value=2e-3, max_value=5e4),
vals.PermissiveMultiples(divisor=1e-3),
combiner='AND')
)
self.add_parameter(
name=f'{mod_type.lower()}_internal_function{src}',
label=f'Source {src} {mod_type} interal function',
Expand All @@ -131,7 +135,7 @@ def __init__(self, name: str, address: str, **kwargs: Any):
'USER', 'USER1', 'USER2', 'USER3', 'USER4',
'EMEMory', 'EMEM',
'EFILe', 'EFIL')
)
)
self.add_parameter(
name=f'{mod_type.lower()}_internal_efile{src}',
label=f'Source {src} {mod_type} interal EFile',
Expand Down Expand Up @@ -210,9 +214,9 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_parser=str,
set_cmd=f'SOURce{src}:COMBine:FEED {{}}',
vals=vals.Enum(combine_enum)
)
)

# Frequency controls
# Frequency controls
self.add_parameter(
name=f'center_freq{src}',
label=f'Source {src} center frequency',
Expand All @@ -228,7 +232,7 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_cmd=f'SOURce{src}:FREQuency:CONCurrent?',
set_cmd=f'SOURce{src}:FREQuency:CONCurrent {{}}',
val_mapping=on_off_map
)
)
self.add_parameter(
name=f'freq_cw{src}',
label=f'Source {src} continuous frequency',
Expand Down Expand Up @@ -283,7 +287,7 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_parser=float,
set_cmd=f'SOURce{src}:FSKey:FREQuency {{}}Hz',
vals=vals.Numbers()
)
)
self.add_parameter(
name=f'fsk_internal_rate{src}',
label=f'Source {src} FSK internal rate',
Expand Down Expand Up @@ -343,7 +347,7 @@ def __init__(self, name: str, address: str, **kwargs: Any):
'USER', 'USER1', 'USER2', 'USER3', 'USER4',
'EMEMory', 'EMEM',
'EFILe', 'EFIL',
'USER', 'USER1',
'USER', 'USER1',
'USER2', 'USER3', 'USER4',
'EMEMory', 'EMEM',
'EFILe', 'EFIL')
Expand All @@ -369,7 +373,7 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_parser=float,
set_cmd=f'SOURce{src}:PULSe:DCYCle {{}}PCT',
vals=vals.Numbers(1e-3, 99.999)
)
)
self.add_parameter(
name=f'pulse_delay{src}',
label=f'Source {src} pulse delay',
Expand Down Expand Up @@ -433,7 +437,7 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_parser=float,
set_cmd=f'SOURce{src}:SWEep:HTIMe {{}}s',
vals=vals.Numbers()
)
)
self.add_parameter(
name=f'sweep_mode{src}',
label=f'Source {src} sweep mode',
Expand All @@ -450,7 +454,7 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_parser=float,
set_cmd=f'SOURce{src}:SWEep:RTIMe {{}}s',
vals=vals.Numbers()
)
)
self.add_parameter(
name=f'sweep_spacing{src}',
label=f'Source {src} sweep spacing',
Expand All @@ -469,14 +473,14 @@ def __init__(self, name: str, address: str, **kwargs: Any):
vals=vals.Numbers(1e-3, 300)
)

# Voltage parameters
# Voltage parameters
self.add_parameter(
name=f'voltage_concurrent{src}',
label=f'Source {src} concurrent voltage',
get_cmd=f'SOURce{src}:VOLTage:CONCurrent:STATe?',
set_cmd=f'SOURce{src}:VOLTage:CONCurrent:STATe {{}}',
val_mapping=on_off_map
)
)
self.add_parameter(
name=f'voltage_high{src}',
label=f'Source {src} high voltage level',
Expand All @@ -485,7 +489,7 @@ def __init__(self, name: str, address: str, **kwargs: Any):
get_parser=float,
set_cmd=f'SOURce{src}:VOLTage:LEVel:IMMediate:HIGH {{}}V',
vals=vals.Numbers()
)
)
self.add_parameter(
name=f'voltage_low{src}',
label=f'Source {src} low voltage level',
Expand Down Expand Up @@ -691,4 +695,4 @@ def upload_waveform(self, waveform: Sequence[float], memory: int):

class AFG3252(AFG3000):
pass

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mypy==0.971
mypy==0.982
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ classifiers =
License :: OSI Approved :: MIT License
License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand All @@ -29,9 +28,9 @@ project_urls =
[options]
zip_safe = False
packages = find:
python_requires = >=3.7
python_requires = >=3.8
install_requires =
qcodes>=0.29.0
qcodes>=0.33.0
versioningit>=1.1.0

[options.extras_require]
Expand Down

0 comments on commit 00a6947

Please sign in to comment.