Skip to content

Commit

Permalink
Release version 1.1.1 PR #46
Browse files Browse the repository at this point in the history
Release version 1.1.1
  • Loading branch information
thomaslima authored Feb 21, 2023
2 parents 2f5b525 + e3e261c commit 9a645b2
Show file tree
Hide file tree
Showing 47 changed files with 1,147 additions and 208 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish package

on:
push:
branches: [master]
release:
types: [published, released]

jobs:
deploy:
name: "Publish to PyPI"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist
- name: Publish package to PyPI
if: github.event_name == 'release' && github.event.action == 'released'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python package

on: [push, pull_request]

jobs:
test_code:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 12
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install -r test-requirements.txt
- name: Install package and dependencies
run: |
pip install .
- name: Build package from source
run: |
python -m build
- name: Run tests
run: |
py.test --capture=sys --cov=lightlab --cov-config .coveragerc
- name: Run linting
run: |
py.test --pylint --flake8 --pylint-rcfile=pylintrc lightlab
continue-on-error: true
19 changes: 19 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# CHANGELOG

1.1.1:
- Bug fixes (including security fixes)
- SR830 lockin amplifier driver
- Create CITATION.cff
- Experimental BOSA driver (by Zhimu)
- CI deployment via github

1.1.0:
- Bug fixes in various instruments
- Included PRBS algorithms for the Anritsu PPG
- Improvements to MeasuredFunction
- Adding support for Keithley 2606B
- PRBS functionality in one_dim

1.0.7:
- Bugfixes in PPG3202, DPO4032, and HP_8152A_PM
- Housekeeping in test environments
- Making DSA8300 work with Prologix driver

1.0.6:
- Major bug in Prologix driver
- Minor improvement to APEX driver
Expand Down
18 changes: 18 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# YAML 1.2
---
abstract: "A python library for remote laboratory control."
authors:
-
family-names: Tait
given-names: Alex
-
family-names: "Ferreira de Lima"
given-names: Thomas
cff-version: "1.1.0"
date-released: 2019-06-28
license: MIT
message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/lightwave-lab/lightlab"
title: Lightlab
version: "1.0.7"
...
9 changes: 7 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Lightlab
========

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


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

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

Auxiliary hosts: Mac OS, Linux, Windows

Acknowledgements
----------------

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.
11 changes: 0 additions & 11 deletions dev-requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions docs/_static/installation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pyvisa

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

>>> import visa
>>> rm = visa.ResourceManager()
>>> import pyvisa
>>> rm = pyvisa.ResourceManager()
>>> print(rm.list_resources())
('GPIB0::20::INSTR', 'GPIB1::24::INSTR', 'ASRL1::INSTR', 'ASRL2::INSTR', 'ASRL3::INSTR', 'ASRL4::INSTR')

Expand Down
11 changes: 9 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ pyvisa

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

>>> import visa
>>> rm = visa.ResourceManager()
>>> import pyvisa
>>> rm = pyvisa.ResourceManager()
>>> print(rm.list_resources())
('GPIB0::20::INSTR', 'GPIB1::24::INSTR', 'ASRL1::INSTR', 'ASRL2::INSTR', 'ASRL3::INSTR', 'ASRL4::INSTR')

Expand Down Expand Up @@ -95,6 +95,13 @@ API

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.

Citing
------

.. image:: https://zenodo.org/badge/131508614.svg
:target: https://zenodo.org/badge/latestdoi/131508614

Then you can download as BibTeX.

* :ref:`genindex`
* :ref:`modindex`
Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 12 additions & 10 deletions lightlab/equipment/abstract_drivers/configurable.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from lightlab import visalogger as logger
from pyvisa import VisaIOError
from contextlib import contextmanager
import dpath.util
import dpath
import json
from numpy import floor
from pathlib import Path
Expand Down Expand Up @@ -55,7 +55,7 @@ def get(self, cStr, asCmd=True):
asCmd (bool): if true, returns a tuple representing a command. Otherwise returns just the value
'''
try:
val = dpath.util.get(self.dico, cStr, separator=self.separator)
val = dpath.get(self.dico, cStr, separator=self.separator)
except KeyError:
raise KeyError(cStr + ' is not present in this TekConfig instance')
if type(val) is dict and '&' in val.keys():
Expand All @@ -69,7 +69,7 @@ def set(self, cStr, val):
''' Takes the value only, not a dictionary '''
# First check that it does not exist as a subdir
try:
ex = dpath.util.get(self.dico, cStr, separator=self.separator)
ex = dpath.get(self.dico, cStr, separator=self.separator)
except KeyError:
# doesn't exist, we are good to go
pass
Expand All @@ -79,20 +79,20 @@ def set(self, cStr, val):
cStr = cStr + self.separator + '&'

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

def getList(self, subgroup='', asCmd=True):
''' Deep crawler that goes in and generates a command for every leaf.
Expand All @@ -105,8 +105,10 @@ def getList(self, subgroup='', asCmd=True):
list: list of valid commands (cstr, val) on the subgroup subdirectory
'''
cList = []
children = dpath.util.search(self.dico, subgroup + '*',
yielded=True, separator=self.separator)
children = dpath.search(
self.dico, f'{subgroup}*', yielded=True, separator=self.separator
)

for cmd in children:
s, v = cmd
if type(v) is not dict:
Expand Down
8 changes: 7 additions & 1 deletion lightlab/equipment/lab_instruments/Agilent_N5222A_NA.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def __init__(self, name='The network analyzer', address=None, **kwargs):
self.traceNum = 1
self.auxTrigNum = 1
self.swpRange = None
self.measType = 'S21'

def startup(self):
self.measurementSetup('S21')
self.measurementSetup(self.measType)

def amplitude(self, amp=None):
''' Amplitude is in dBm
Expand Down Expand Up @@ -183,20 +184,25 @@ def measurementSetup(self, measType='S21', chanNum=None):
changed = True
self.setConfigParam('CALC{}:PAR:MNUM'.format(self.chanNum),
self.chanNum, forceHardware=changed)

retStr = self.query('CALC{}:PAR:CAT:EXT?'.format(chanNum)).strip('"')
# self.setConfigParam('CALC{}:PAR:SEL'.format(self.chanNum), self.chanNum, forceHardware=changed)
# wait for changes to take effect
# This could be improved by something like *OPC? corresponding to the end
# of the first sweep
time.sleep(self.getSwpDuration())
self.measType = measType

def spectrum(self):
# raise NotImplementedError('not working')
# self.setConfigParam('SENS:SWE:GRO:COUN', nGroups)

self.setConfigParam('SENS:SWE:MODE', 'HOLD')
self.write('SENS:SWE:MODE SING')
self.query('*OPC?')

self.setConfigParam('FORM', 'ASC')

self.open()
dbm = self.query_ascii_values('CALC{}:DATA? FDATA'.format(self.chanNum))
self.close()
Expand Down
Loading

0 comments on commit 9a645b2

Please sign in to comment.