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

Release version 1.1.1 #46

Merged
merged 50 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
d565b9c
Fixing bug when dividing a Waveform object by another.
thomaslima Jul 23, 2020
077dadc
modifying prologix GPIB driver to not wait for the MAV bit assertion …
thomaslima Jul 23, 2020
31bacde
adding _smu_write to keithley 2606
thomaslima Sep 16, 2020
408a60c
Merge branch 'dev-thomas' of lightwave-gitlab.princeton.edu:StealthCo…
thomaslima Sep 16, 2020
230b676
TODO need to add query_binary option visa object
thomaslima Nov 16, 2020
bb2e139
jsonpickle made some non-backwards compatible changes. forcing upgrad…
thomaslima Nov 16, 2020
182f994
pyvisa deprecated 'import visa'
thomaslima Nov 20, 2020
c681191
improving debug message if id_string is not there
thomaslima Nov 26, 2020
e528adc
SR830 lockin amplifier driver
simbilod Jul 9, 2021
25c711f
Create CITATION.cff
simbilod Sep 15, 2021
e9d1d8e
Update README.rst
simbilod Sep 16, 2021
2e0749b
BOSA driver (by Zhimu)
simbilod Jan 12, 2022
e4f412b
Adding Aragon BOSA driver (tested with GPIB only)
thomaslima Jan 12, 2022
2e97a3f
Merge pull request #1 from lightwave-lab/development
ZhimuG Mar 10, 2022
2d55b43
Updated configurable.py to fix an error when using Keithley 2400
ZhimuG Mar 11, 2022
ac044fd
fix to Waveform function
thomaslima Apr 7, 2022
282044e
Revert "BOSA driver (by Zhimu)"
thomaslima Apr 7, 2022
a553104
Merge branch 'dev-thomas' into development
thomaslima Apr 7, 2022
43fedb8
Bump pygments from 2.4.2 to 2.7.4
dependabot[bot] Apr 7, 2022
cceb417
Merge branch 'development' into development
simbilod Apr 20, 2022
a1b11b8
Merge pull request #28 from lightwave-lab/dependabot/pip/pygments-2.7.4
thomaslima Apr 24, 2022
5ad6f31
Bump py from 1.8.0 to 1.10.0
dependabot[bot] Apr 24, 2022
0048521
Merge pull request #29 from lightwave-lab/dependabot/pip/py-1.10.0
thomaslima Apr 24, 2022
4a91208
Bump ipython from 7.5.0 to 7.16.3
dependabot[bot] Apr 24, 2022
a58b600
Merge pull request #31 from lightwave-lab/dependabot/pip/ipython-7.16.3
thomaslima Apr 24, 2022
c612bd4
Bump numpy from 1.16.4 to 1.21.0
dependabot[bot] Apr 24, 2022
65c8067
Merge pull request #34 from lightwave-lab/dependabot/pip/numpy-1.21.0
thomaslima Apr 24, 2022
dd69fd3
'Refactored by Sourcery'
Apr 28, 2022
2b5f593
clean code
joamatab Apr 28, 2022
7e6eb95
added Lakeshore driver draft
simbilod May 4, 2022
9c5534b
Bump numpy from 1.21.0 to 1.22.0
dependabot[bot] Jun 22, 2022
059dad1
fixed pcolormesh shading errors in lightcal tests
hughmor Jul 27, 2022
f2882fd
Merge pull request #38 from hughmor/dev-hughmor
simbilod Jul 29, 2022
20d9e01
Merge pull request #33 from ZhimuG/development
simbilod Aug 12, 2022
80e1ff5
fix PNA defualting to S21 bug
simbilod Aug 16, 2022
7c8d256
Merge pull request #41 from simbilod/pna_measType_fix
simbilod Aug 16, 2022
86563dd
Merge pull request #37 from lightwave-lab/dependabot/pip/numpy-1.22.0
simbilod Aug 16, 2022
2ca1d31
Merge branch 'development' into development
simbilod Aug 16, 2022
1096763
Merge pull request #36 from joamatab/development
simbilod Aug 16, 2022
ad5af5b
moving to pyproject.toml
thomaslima Feb 21, 2023
5307cbd
passing tests
thomaslima Feb 21, 2023
1b82cab
linting is unreliable
thomaslima Feb 21, 2023
eb54cc2
testing with github actions
thomaslima Feb 21, 2023
2a9b21f
Revert sourcery AI reformatting (broke code)
thomaslima Feb 21, 2023
0c70a70
check for root does not work in windows
thomaslima Feb 21, 2023
8c7692e
ignoring user admin status
thomaslima Feb 21, 2023
e24f246
disabling travis and gitlab-ci
thomaslima Feb 21, 2023
956fdb5
Merge pull request #45 from lightwave-lab/ci
thomaslima Feb 21, 2023
0bdf611
created DOI and inserted badge (#11)
atait Feb 21, 2023
e3e261c
Preparing version 1.1.1 for release
thomaslima Feb 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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