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

Cleanup example imports #201

Merged
merged 5 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 27 additions & 6 deletions docs/examples/Andor_DU401.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/examples/Attocube_ANC300.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"metadata": {},
"outputs": [],
"source": [
"from qcodes.instrument_drivers.attocube.ANC300 import ANC300"
"from qcodes_contrib_drivers.drivers.Attocube.ANC300 import ANC300"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/Aviosys_IP_Power_9258S.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"outputs": [],
"source": [
"from qcodes.instrument_drivers.Aviosys.IP_Power_9258S import Aviosys_IP_Power_9258S"
"from qcodes_contrib_drivers.drivers.Aviosys.IP_Power_9258S import Aviosys_IP_Power_9258S"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/Lakeshore_311.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"outputs": [],
"source": [
"from qcodes.instrument_drivers.Lakeshore.Model_331 import Model_331"
"from qcodes_contrib_drivers.drivers.Lakeshore.Model_331 import Model_331"
]
},
{
Expand Down
15 changes: 7 additions & 8 deletions docs/examples/QDevil/QDAC1/QCodes example with QDevil_QDAC.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"\n",
"import numpy as np\n",
"\n",
"import qcodes as qc\n",
"import qcodes.instrument_drivers.QDevil.QDevil_QDAC as QDac\n",
"from qcodes.instrument_drivers.QDevil.QDevil_QDAC import Mode"
"from qcodes.dataset import new_experiment\n",
"from qcodes.station import Station\n",
"from qcodes_contrib_drivers.drivers.QDevil.QDAC1 import QDac, Mode"
]
},
{
Expand All @@ -45,7 +45,7 @@
"# as this takes some 0.2-0.5 secs per channel due to the sensor settling time. \n",
"# You can force reading the current sensors at startup by specifiying \"update_currents=True\" in the call.\n",
"\n",
"qdac = QDac.QDac(name='qdac', address='ASRL2::INSTR', update_currents=False)\n",
"qdac = QDac(name='qdac', address='ASRL2::INSTR', update_currents=False)\n",
"print(\"Number of channels: \",qdac.num_chans)"
]
},
Expand Down Expand Up @@ -297,8 +297,8 @@
"\n",
"from qcodes.dataset import Measurement, plot_by_id\n",
"\n",
"STATION = qc.station.Station(qdac)\n",
"qc.new_experiment(\"QDAC\", \"TestIV\"+ctime())\n",
"STATION = Station(qdac)\n",
"new_experiment(\"QDAC\", \"TestIV\"+ctime())\n",
"meas = Measurement()\n",
"meas.register_parameter(qdac.ch01.v) # register the independent parameter\n",
"meas.register_parameter(qdac.ch01.i, setpoints=(qdac.ch01.v,)) # now register the dependent one\n",
Expand All @@ -312,8 +312,7 @@
" (qdac.ch01.i, get_i))\n",
" print(set_v, get_i)\n",
" dataset = datasaver.dataset\n",
"myplot = plot_by_id(dataset.run_id)\n",
"qc.dataset.plotting.plt.show() # Sometimes it is necessasry to out-comment this line in Jupyter...."
"myplot = plot_by_id(dataset.run_id)"
]
},
{
Expand Down
13 changes: 7 additions & 6 deletions docs/examples/QDevil/QDAC2/AWG.ipynb

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions docs/examples/QDevil/QDAC2/Chaining.ipynb

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions docs/examples/QDevil/QDAC2/DC_Constant.ipynb

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions docs/examples/QDevil/QDAC2/List.ipynb

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions docs/examples/QDevil/QDAC2/MultiGenerator.ipynb

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions docs/examples/QDevil/QDAC2/PyvisaAwg.ipynb

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions docs/examples/QDevil/QDAC2/Scan.ipynb

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions docs/examples/QDevil/QDAC2/Sine.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/examples/QDevil/QDAC2/Square.ipynb

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions docs/examples/QDevil/QDAC2/Sweep.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/examples/QDevil/QDAC2/SyncMultipleQDACs.ipynb

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/examples/QDevil/QDAC2/Triangle.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/examples/QDevil/QDAC2/VirtualGates.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/examples/Rohde_Schwarz_SMW200A.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"metadata": {},
"outputs": [],
"source": [
"from qcodes.instrument_drivers.rohde_schwarz.SMW200A import RohdeSchwarz_SMW200A as smw200a"
"from qcodes_contrib_drivers.drivers.RohdeSchwarz.SMW200A import RohdeSchwarz_SMW200A as smw200a"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/Shamrock_SR750.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"outputs": [],
"source": [
"from qcodes.instrument_drivers.Shamrock.SR750 import Shamrock_SR750"
"from qcodes_contrib_drivers.drivers.Shamrock.SR750 import Shamrock_SR750"
]
},
{
Expand Down
13 changes: 9 additions & 4 deletions docs/examples/Thorlabs_MFF10x.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
},
"outputs": [],
"source": [
"from qcodes.instrument_drivers.Thorlabs.APT import Thorlabs_APT\n",
"from qcodes.instrument_drivers.Thorlabs.MFF10x import Thorlabs_MFF10x"
"from qcodes_contrib_drivers.drivers.Thorlabs.APT import Thorlabs_APT\n",
"from qcodes_contrib_drivers.drivers.Thorlabs.MFF10x import Thorlabs_MFF10x"
]
},
{
Expand Down Expand Up @@ -172,7 +172,7 @@
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3",
"display_name": "qcodespip311",
"language": "python",
"name": "python3"
},
Expand All @@ -186,7 +186,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.11.0 | packaged by conda-forge | (main, Jan 16 2023, 14:12:30) [MSC v.1916 64 bit (AMD64)]"
},
"nbsphinx": {
"execute": "never"
Expand Down Expand Up @@ -232,6 +232,11 @@
"_Feature"
],
"window_display": false
},
"vscode": {
"interpreter": {
"hash": "7ac3e91929df5618782934af11c3fa566d637713ed5d04bf73eff1f535fb8e06"
}
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/Thorlabs_PRM1Z8.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
},
"outputs": [],
"source": [
"from qcodes.instrument_drivers.Thorlabs.APT import Thorlabs_APT\n",
"from qcodes.instrument_drivers.Thorlabs.PRM1Z8 import Thorlabs_PRM1Z8"
"from qcodes_contrib_drivers.drivers.Thorlabs.APT import Thorlabs_APT\n",
"from qcodes_contrib_drivers.drivers.Thorlabs.PRM1Z8 import Thorlabs_PRM1Z8"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = [
"setuptools >= 61.2",
"wheel >= 0.29.0",
"versioningit >= 1.1.0"
"versioningit >= 2.0.1"
]
build-backend = 'setuptools.build_meta'

Expand All @@ -11,7 +11,7 @@ name = "qcodes_contrib_drivers"
description = "User contributed drivers for QCoDeS"
classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "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.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering",]
requires-python = ">=3.8"
dependencies = [ "qcodes>=0.36.1", "versioningit>=1.1.0", "packaging"]
dependencies = [ "qcodes>=0.37.0", "versioningit>=2.0.1", "packaging"]
dynamic = [ "version",]

[[project.maintainers]]
Expand Down
18 changes: 9 additions & 9 deletions qcodes_contrib_drivers/drivers/Attocube/ANC300.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import pyvisa

# real mode:
from qcodes import VisaInstrument
from qcodes.instrument import VisaInstrument
# simulation mode:
#from qcodes.instrument_drivers.attocube.ANC300sim import MockVisa
#from qcodes_contrib_drivers.drivers.Attocube.ANC300sim import MockVisa

## do not forget to change the main class accordingly:
## real -> class ANC300(VisaInstrument):
## simul -> class ANC300(MockVisa):

from qcodes.instrument.channel import InstrumentChannel, ChannelList
from qcodes.instrument import InstrumentChannel, ChannelList
from qcodes import validators as vals


Expand All @@ -38,7 +38,7 @@ class Anc300Axis(InstrumentChannel):

def __init__(self, parent: 'ANC300', name: str, axis: int, sn: str) -> None:
"""Creates a new Anc300Axis class instance.

The Attocube ANC300 piezo controller has up to 7 axis. Each of them are controlled
by the same class.

Expand Down Expand Up @@ -317,10 +317,10 @@ class Anc300TriggerOut(InstrumentChannel):

def __init__(self, parent: 'ANC300', name: str, num: int) -> None:
"""The Attocube ANC300 piezo controller has three trigger outputs.

This function cannot be tested because this function belongs to a specific controller
feature code. This code was not available during the tests.

Args:
parent: the internal QCoDeS name of the instrument this output belongs to
name: the internal QCoDeS name of the output itself
Expand All @@ -345,7 +345,7 @@ class ANC300(VisaInstrument):
#class ANC300(MockVisa):
"""
This is the qcodes driver for the Attocube ANC300.

Be careful to correct the parameters if not useing the USB port.

Status:
Expand Down Expand Up @@ -402,7 +402,7 @@ def __init__(self, name, address, **kwargs):

def write_raw(self, cmd: str) -> None:
"""Write cmd and wait until the 'OK' or 'ERROR' comes back from the device.

Args:
cmd: Command to write to controller.

Expand Down Expand Up @@ -430,7 +430,7 @@ def write_raw(self, cmd: str) -> None:

def ask_raw(self, cmd: str) -> str:
"""Query instrument with cmd and return response.

Args:
cmd: Command to write to controller.

Expand Down
8 changes: 4 additions & 4 deletions qcodes_contrib_drivers/drivers/Attocube/ANC300sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""

import pyvisa
from qcodes.instrument.visa import VisaInstrument
from qcodes.instrument import VisaInstrument

# if set to True, every communication line is printed
_USE_DEBUG = True
Expand All @@ -31,7 +31,7 @@ class MockVisaHandle:
"""
Simulate the API needed for the communication.
"""

# List of possible commands asked the instrument to give a realistic answer.
cmddef = {'ver': ['attocube ANC300 controller version 1.1.0-1304 2013-10-17 08:16',
'ANC150 compatibillity console'],
Expand Down Expand Up @@ -107,7 +107,7 @@ class MockVisaHandle:
'gettd 5': ['Wrong axis type','ERROR'],
'gettd 6': ['Wrong axis type','ERROR'],
'gettd 7': ['Wrong axis type','ERROR'],

'getc 1': ['cap = 5 nF'], # TODO
'getc 2': ['cap = 5 nF'], # TODO
'getc 3': ['Wrong axis type','ERROR'],
Expand All @@ -123,7 +123,7 @@ class MockVisaHandle:
# There is no simulation for the correct movement

}

def __init__(self):
if _USE_DEBUG:
print("DBG-Mock: init")
Expand Down
5 changes: 3 additions & 2 deletions qcodes_contrib_drivers/drivers/Oxford/kelvinox.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

from time import sleep
import pyvisa
import pyvisa.constants
import logging
import numpy
from qcodes import VisaInstrument
from qcodes.instrument import VisaInstrument
from qcodes import validators as vals
from functools import partial

Expand All @@ -27,7 +28,7 @@ class OxfordInstruments_Kelvinox_IGH(VisaInstrument):

Usage:
Initialize with
fridge = qcodes.instrument_drivers.oxford.kelvinox.OxfordInstruments_Kelvinox_IGH(name='fridge', address='ASRL4::INSTR')
fridge = qcodes_contrib_drivers.drivers.oxford.kelvinox.OxfordInstruments_Kelvinox_IGH(name='fridge', address='ASRL4::INSTR')

Note: Since the ISOBUS allows for several instruments to be managed in parallel, the command
which is sent to the device starts with '@n', where n is the ISOBUS instrument number.
Expand Down