Skip to content

Commit 9a645b2

Browse files
authored
Release version 1.1.1 PR #46
Release version 1.1.1
2 parents 2f5b525 + e3e261c commit 9a645b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1147
-208
lines changed

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish package
2+
3+
on:
4+
push:
5+
branches: [master]
6+
release:
7+
types: [published, released]
8+
9+
jobs:
10+
deploy:
11+
name: "Publish to PyPI"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install build
21+
- name: Build a binary wheel and a source tarball
22+
run: |
23+
python -m build --sdist
24+
- name: Publish package to PyPI
25+
if: github.event_name == 'release' && github.event.action == 'released'
26+
uses: pypa/gh-action-pypi-publish@release/v1
27+
with:
28+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Python package
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test_code:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
max-parallel: 12
11+
matrix:
12+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build
24+
pip install -r test-requirements.txt
25+
- name: Install package and dependencies
26+
run: |
27+
pip install .
28+
- name: Build package from source
29+
run: |
30+
python -m build
31+
- name: Run tests
32+
run: |
33+
py.test --capture=sys --cov=lightlab --cov-config .coveragerc
34+
- name: Run linting
35+
run: |
36+
py.test --pylint --flake8 --pylint-rcfile=pylintrc lightlab
37+
continue-on-error: true

CHANGELOG

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# CHANGELOG
22

3+
1.1.1:
4+
- Bug fixes (including security fixes)
5+
- SR830 lockin amplifier driver
6+
- Create CITATION.cff
7+
- Experimental BOSA driver (by Zhimu)
8+
- CI deployment via github
9+
10+
1.1.0:
11+
- Bug fixes in various instruments
12+
- Included PRBS algorithms for the Anritsu PPG
13+
- Improvements to MeasuredFunction
14+
- Adding support for Keithley 2606B
15+
- PRBS functionality in one_dim
16+
17+
1.0.7:
18+
- Bugfixes in PPG3202, DPO4032, and HP_8152A_PM
19+
- Housekeeping in test environments
20+
- Making DSA8300 work with Prologix driver
21+
322
1.0.6:
423
- Major bug in Prologix driver
524
- Minor improvement to APEX driver

CITATION.cff

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# YAML 1.2
2+
---
3+
abstract: "A python library for remote laboratory control."
4+
authors:
5+
-
6+
family-names: Tait
7+
given-names: Alex
8+
-
9+
family-names: "Ferreira de Lima"
10+
given-names: Thomas
11+
cff-version: "1.1.0"
12+
date-released: 2019-06-28
13+
license: MIT
14+
message: "If you use this software, please cite it using these metadata."
15+
repository-code: "https://github.com/lightwave-lab/lightlab"
16+
title: Lightlab
17+
version: "1.0.7"
18+
...

README.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Lightlab
22
========
33

4-
.. image:: https://travis-ci.org/lightwave-lab/lightlab.svg?branch=development
5-
:target: https://travis-ci.org/lightwave-lab/lightlab
4+
.. image:: https://zenodo.org/badge/131508614.svg
5+
:target: https://zenodo.org/badge/latestdoi/131508614
6+
67

78
A python library for remote laboratory control. Laboratory remoting facilitates experimental research:
89

@@ -60,3 +61,7 @@ Server: Mac OS and Linux running ≥python3.6; not tested on Windows (to do).
6061

6162
Auxiliary hosts: Mac OS, Linux, Windows
6263

64+
Acknowledgements
65+
----------------
66+
67+
This material is based in part upon work supported by the National Science Foundation under Grant Number E2CDA-1740262. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

dev-requirements.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/_static/installation/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pyvisa
2929

3030
Proceed with installing lightlab once you have something that looks like the following output::
3131

32-
>>> import visa
33-
>>> rm = visa.ResourceManager()
32+
>>> import pyvisa
33+
>>> rm = pyvisa.ResourceManager()
3434
>>> print(rm.list_resources())
3535
('GPIB0::20::INSTR', 'GPIB1::24::INSTR', 'ASRL1::INSTR', 'ASRL2::INSTR', 'ASRL3::INSTR', 'ASRL4::INSTR')
3636

docs/index.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pyvisa
4848

4949
Proceed with enjoying lightlab once you have the following output::
5050

51-
>>> import visa
52-
>>> rm = visa.ResourceManager()
51+
>>> import pyvisa
52+
>>> rm = pyvisa.ResourceManager()
5353
>>> print(rm.list_resources())
5454
('GPIB0::20::INSTR', 'GPIB1::24::INSTR', 'ASRL1::INSTR', 'ASRL2::INSTR', 'ASRL3::INSTR', 'ASRL4::INSTR')
5555

@@ -95,6 +95,13 @@ API
9595

9696
This documentation contains ipython notebooks. It is possible to open them with a jupyter kernel and run them interactively to play with knobs and see more plotting features.
9797

98+
Citing
99+
------
100+
101+
.. image:: https://zenodo.org/badge/131508614.svg
102+
:target: https://zenodo.org/badge/latestdoi/131508614
103+
104+
Then you can download as BibTeX.
98105

99106
* :ref:`genindex`
100107
* :ref:`modindex`
File renamed without changes.
File renamed without changes.

lightlab/equipment/abstract_drivers/configurable.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from lightlab import visalogger as logger
22
from pyvisa import VisaIOError
33
from contextlib import contextmanager
4-
import dpath.util
4+
import dpath
55
import json
66
from numpy import floor
77
from pathlib import Path
@@ -55,7 +55,7 @@ def get(self, cStr, asCmd=True):
5555
asCmd (bool): if true, returns a tuple representing a command. Otherwise returns just the value
5656
'''
5757
try:
58-
val = dpath.util.get(self.dico, cStr, separator=self.separator)
58+
val = dpath.get(self.dico, cStr, separator=self.separator)
5959
except KeyError:
6060
raise KeyError(cStr + ' is not present in this TekConfig instance')
6161
if type(val) is dict and '&' in val.keys():
@@ -69,7 +69,7 @@ def set(self, cStr, val):
6969
''' Takes the value only, not a dictionary '''
7070
# First check that it does not exist as a subdir
7171
try:
72-
ex = dpath.util.get(self.dico, cStr, separator=self.separator)
72+
ex = dpath.get(self.dico, cStr, separator=self.separator)
7373
except KeyError:
7474
# doesn't exist, we are good to go
7575
pass
@@ -79,20 +79,20 @@ def set(self, cStr, val):
7979
cStr = cStr + self.separator + '&'
8080

8181
cmd = (cStr, val)
82-
success = dpath.util.set(self.dico, *cmd, separator=self.separator)
82+
success = dpath.set(self.dico, *cmd, separator=self.separator)
8383
if success != 1: # it doesn't exist yet
8484
try:
85-
dpath.util.new(self.dico, *cmd, separator=self.separator)
86-
except ValueError:
85+
dpath.new(self.dico, *cmd, separator=self.separator)
86+
except (ValueError, dpath.exceptions.PathNotFound):
8787
# We probably have an integer leaf where we would also like to have a directory
8888
parent = self.separator.join(cmd[0].split(self.separator)[:-1])
8989
try:
9090
oldV = self.get(parent, asCmd=False)
9191
except KeyError:
9292
print('dpath did not take ' + str(cmd))
9393
raise
94-
dpath.util.set(self.dico, parent, {'&': oldV}, separator=self.separator)
95-
dpath.util.new(self.dico, *cmd, separator=self.separator)
94+
dpath.set(self.dico, parent, {'&': oldV}, separator=self.separator)
95+
dpath.new(self.dico, *cmd, separator=self.separator)
9696

9797
def getList(self, subgroup='', asCmd=True):
9898
''' Deep crawler that goes in and generates a command for every leaf.
@@ -105,8 +105,10 @@ def getList(self, subgroup='', asCmd=True):
105105
list: list of valid commands (cstr, val) on the subgroup subdirectory
106106
'''
107107
cList = []
108-
children = dpath.util.search(self.dico, subgroup + '*',
109-
yielded=True, separator=self.separator)
108+
children = dpath.search(
109+
self.dico, f'{subgroup}*', yielded=True, separator=self.separator
110+
)
111+
110112
for cmd in children:
111113
s, v = cmd
112114
if type(v) is not dict:

lightlab/equipment/lab_instruments/Agilent_N5222A_NA.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ def __init__(self, name='The network analyzer', address=None, **kwargs):
3636
self.traceNum = 1
3737
self.auxTrigNum = 1
3838
self.swpRange = None
39+
self.measType = 'S21'
3940

4041
def startup(self):
41-
self.measurementSetup('S21')
42+
self.measurementSetup(self.measType)
4243

4344
def amplitude(self, amp=None):
4445
''' Amplitude is in dBm
@@ -183,20 +184,25 @@ def measurementSetup(self, measType='S21', chanNum=None):
183184
changed = True
184185
self.setConfigParam('CALC{}:PAR:MNUM'.format(self.chanNum),
185186
self.chanNum, forceHardware=changed)
187+
188+
retStr = self.query('CALC{}:PAR:CAT:EXT?'.format(chanNum)).strip('"')
186189
# self.setConfigParam('CALC{}:PAR:SEL'.format(self.chanNum), self.chanNum, forceHardware=changed)
187190
# wait for changes to take effect
188191
# This could be improved by something like *OPC? corresponding to the end
189192
# of the first sweep
190193
time.sleep(self.getSwpDuration())
194+
self.measType = measType
191195

192196
def spectrum(self):
193197
# raise NotImplementedError('not working')
194198
# self.setConfigParam('SENS:SWE:GRO:COUN', nGroups)
199+
195200
self.setConfigParam('SENS:SWE:MODE', 'HOLD')
196201
self.write('SENS:SWE:MODE SING')
197202
self.query('*OPC?')
198203

199204
self.setConfigParam('FORM', 'ASC')
205+
200206
self.open()
201207
dbm = self.query_ascii_values('CALC{}:DATA? FDATA'.format(self.chanNum))
202208
self.close()

0 commit comments

Comments
 (0)