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

Infinite scans #243

Open
wants to merge 32 commits into
base: version1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c5b61bc
fix(general): drange needed to return an np.ndarray for nondivisible …
ammounce Nov 11, 2024
bf42a9b
fix(general): first_string needed a typeerror for thigns that don't f…
ammounce Nov 11, 2024
4a8f6f3
fix(general): is_numeric_type behaved incorrectly for boolean
ammounce Nov 11, 2024
4e7def6
refactor(measurement): removed task specific experiment objects
ammounce Nov 11, 2024
80fb3e7
test(general): rewrote tests to comply with pytest style and more spe…
ammounce Nov 11, 2024
e2edca2
fix(plotting): fixed live plot to correctly display scan indicies
ammounce Nov 11, 2024
1146d78
fix(drivers): fixed TestVoltage to go between -10 and 10
ammounce Nov 11, 2024
4352255
feature(measurement): delta product for unlimited scans
ammounce Nov 11, 2024
974b13b
chore(): added relevent __init__ changes
ammounce Nov 11, 2024
1c01774
chore(measurement): removed charge recorder, should be obsolete
ammounce Nov 11, 2024
ee5ef27
feature(measurement): initial measurement v1 and tests
ammounce Nov 11, 2024
8ffa203
chore(general): removed quadature sum, not used
ammounce Nov 11, 2024
184491b
chore(general): moved experiment specific general functions to measur…
ammounce Nov 11, 2024
179869e
chore(general): itemattribute is now a separate package
ammounce Nov 11, 2024
ee5036e
removed coding statement at the top of the file
ammounce Nov 11, 2024
95807c2
tests(): removed legacy tests
ammounce Nov 11, 2024
e1202bd
chore(drivers): fixed itemattribute syntax
ammounce Nov 11, 2024
2c0664c
fix(measurement): fixed imports for get_pyscan_version
ammounce Nov 12, 2024
df36954
test(): updated more tests to follow pytest syntax
ammounce Nov 12, 2024
672c838
chore(measurement): removed 'time' from runinfo to re implement later
ammounce Nov 12, 2024
11bad6b
chore(syntax): small documentation and syntax changes
ammounce Nov 12, 2024
81b0170
Merge branch 'version1' into infinite_scans
ammounce Nov 12, 2024
46c1674
test(): renamed test folders, removed scope, added new experiment tests
ammounce Nov 19, 2024
e6a3e59
chore(): reorganized runinfo, changed a few property names, removed d…
ammounce Nov 19, 2024
2dcfb6c
"chore(): changed logging to default False"
ammounce Nov 19, 2024
7af1eb9
chore(): Removed legacy sweep
ammounce Nov 19, 2024
556e4f9
fix(measurement): merged average and regular sweep, split metadata sa…
ammounce Nov 19, 2024
f2b8375
chore(): removed unnecessary comments and debug
ammounce Nov 19, 2024
8a38cd1
chore(): refactored continuous scan
ammounce Nov 19, 2024
6bc23f7
chore(): streamlined continuous scan, added tests for continuous expe…
ammounce Nov 21, 2024
7324f56
fix(): if json encoder doesn't find the right type, adds could not se…
ammounce Nov 21, 2024
bb3ccee
docs(): fixed flake8 errors
ammounce Nov 21, 2024
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
2 changes: 2 additions & 0 deletions pyscan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
from .drivers import *
from .plotting import *
from .drivers.testing import *

from itemattribute import ItemAttribute
1 change: 0 additions & 1 deletion pyscan/drivers/agilent/agilent33500.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from ..instrument_driver import InstrumentDriver
import re
from ...general.d_range import drange
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/agilent/agilent34410.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver


Expand Down
1 change: 0 additions & 1 deletion pyscan/drivers/agilent/agilent8267d.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from ..instrument_driver import InstrumentDriver


Expand Down
1 change: 0 additions & 1 deletion pyscan/drivers/agilent/agilent8275n.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from ..instrument_driver import InstrumentDriver


Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/agilent/agilentdso900series.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

import numpy as np
from math import ceil
from ..instrument_driver import InstrumentDriver
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/attocube/attocube_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from ..exceptions.external_package_excpetion import ExternalPackageException


Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/bluefors/blueforslog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from pathlib import Path
import pandas as pd

Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/heliotis/helios_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from ..exceptions.external_package_excpetion import ExternalPackageException


Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/heliotis/helios_sdk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute


def sense_tqp_to_frequency(SensTqp):
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/heliotis/helioscamera.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

import sys
import os
from time import sleep
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/hp/hp34401a.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver


Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/instrument_driver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from ..general.item_attribute import ItemAttribute
from .new_instrument import new_instrument

from itemattribute import ItemAttribute
from collections import OrderedDict
import numpy as np
import re
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/keithley/keithley2400.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from pyscan.drivers.instrument_driver import InstrumentDriver
import numpy as np
from time import sleep
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/keysight/keysight53230a.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver


Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/keysight/keysightm3302aawg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

import keysightSD1
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
import sys
sys.path.append(r'c:\Program Files (x86)\Keysight\SD1\Libraries\Python')

Expand Down
3 changes: 1 addition & 2 deletions pyscan/drivers/keysight/keysightm3302adaq.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from ...general.item_attribute import ItemAttribute

from itemattribute import ItemAttribute
import sys
sys.path.append(r'c:\Program Files (x86)\Keysight\SD1\Libraries\Python')

Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/keysight/keysite_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from ..exceptions.external_package_excpetion import ExternalPackageException


Expand Down
1 change: 0 additions & 1 deletion pyscan/drivers/new_instrument.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import pyvisa as visa
import pyscan as ps

Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/oceanoptics/oceanoptics_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from ..exceptions.external_package_excpetion import ExternalPackageException


Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/oceanoptics/oceanopticsqepro.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

import numpy as np
from seabreeze.spectrometers import Spectrometer
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute


class OceanOpticsQEPro(ItemAttribute):
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/oxford/oxfordigh.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver


Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/oxford/oxfordips120.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from datetime import datetime
from time import sleep, time

Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/picoquant/picoharp300.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

import ctypes
from ctypes import byref
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from time import sleep
from pathlib import Path
from time import strftime
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/picoquant/picoquant_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from ..exceptions.external_package_excpetion import ExternalPackageException


Expand Down
5 changes: 2 additions & 3 deletions pyscan/drivers/princeton_instruments/princetonpimax4.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-

from PrincetonInstruments.LightField.AddIns import Pulse
from PrincetonInstruments.LightField.AddIns import ExperimentSettings
from PrincetonInstruments.LightField.AddIns import CameraSettings
from PrincetonInstruments.LightField.Automation import Automation
from ...general.item_attribute import ItemAttribute

from itemattribute import ItemAttribute
import clr
import sys
import os
Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/princeton_instruments/pylonsdk.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from ...general.item_attribute import ItemAttribute

from itemattribute import ItemAttribute


class PylonSDK(ItemAttribute):
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/spin_core/spin_core_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
import ctypes
from . import spin_api_wrapper as pb

Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/spin_core/spin_core_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from ..exceptions.external_package_excpetion import ExternalPackageException


Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/stanford/stanford396.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver


Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/stanford/stanford400.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver


Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/stanford/stanford470.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver


Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/stanford/stanford620.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver
import struct
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/stanford/stanford830.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver
import numpy as np
from time import sleep
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/stanford/stanford900.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver
import re
import time
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/stanford/stanford928.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from .stanford900 import Stanford900
from math import floor

Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/swabian/pulselaser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver
from time import sleep
import serial
Expand Down
6 changes: 3 additions & 3 deletions pyscan/drivers/testing/auto_test_driver.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

import pytest
import math
from collections import OrderedDict
import typing
from pyscan.drivers.testing.test_instrument_driver import TestInstrumentDriver
from ...general.get_pyscan_version import get_pyscan_version
from ...measurement.get_pyscan_version import get_pyscan_version
import os
from datetime import datetime
import re
Expand Down Expand Up @@ -580,7 +580,7 @@ def check_doc_strings(test_instrument):
# write formatting test cases here.


def test_driver(device=TestInstrumentDriver(), skip_log=False, expected_attributes=None, expected_values=None,
def test_driver(device=TestInstrumentDriver(), skip_log=True, expected_attributes=None, expected_values=None,
verbose=True):
if expected_attributes is not None:
check_has_attributes(device, expected_attributes)
Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/testing/test_voltage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from pyscan.drivers import InstrumentDriver


Expand Down Expand Up @@ -67,7 +67,7 @@ def initialize_properties(self):
'name': 'voltage',
'write_string': 'VOLT {}',
'query_string': 'VOLT?',
'range': [0, 10],
'range': [-10, 10],
'return_type': float
})

Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/thorlabs/thorlabs_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from ..exceptions.external_package_excpetion import ExternalPackageException


Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/thorlabs/thorlabsbpc303.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from ...general.item_attribute import ItemAttribute

from itemattribute import ItemAttribute
from thorlabs_kinesis import benchtop_piezo as bp
from ctypes import c_char_p, c_ushort, c_ulong, c_short
from time import sleep
Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/thorlabs/thorlabsbsc203.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

import numpy as np
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
from thorlabs_kinesis import benchtop_stepper_motor as bsm
from ctypes import c_char_p, c_int, c_double, c_ushort, c_ulong, c_short
from time import sleep
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/thorlabs/thorlabsitc4001.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver


Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/thorlabs/thorlabsmff101.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from ...general.item_attribute import ItemAttribute

from itemattribute import ItemAttribute
from thorlabs_kinesis import filter_flipper as ff
from ctypes import c_char_p, c_ushort, c_ulong
from time import sleep
Expand Down
2 changes: 1 addition & 1 deletion pyscan/drivers/yokogawa/yokogawags200.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

from ..instrument_driver import InstrumentDriver
import numpy as np
from time import sleep
Expand Down
4 changes: 2 additions & 2 deletions pyscan/drivers/zurich_instruments/zurichhf2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

import zhinst.ziPython as ziPython
from ...general.item_attribute import ItemAttribute
from itemattribute import ItemAttribute
import numpy as np


Expand Down
9 changes: 2 additions & 7 deletions pyscan/general/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# objects
from .item_attribute import ItemAttribute
from .pyscan_json_encoder import PyscanJSONEncoder

# methods
from .d_range import drange
from .delta_product import delta_product
from .first_string import first_string
from .infinite_iterator import infinite_iterator
from .is_list_type import is_list_type
from .is_numeric_type import is_numeric_type
from .quadrature_sum import quadrature_sum
from .same_length import same_length
from .set_difference import set_difference
from .stack_or_append import stack_or_append
from .get_pyscan_version import get_pyscan_version
from .pyscan_json_decoder import PyscanJSONDecoder
4 changes: 3 additions & 1 deletion pyscan/general/d_range.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

import numpy as np


Expand Down Expand Up @@ -46,4 +46,6 @@ def drange(start, delta, stop):
values = [start + sign * delta * i for i in range(n + 1)]
values += [stop]

values = np.array(values)

return values
Loading
Loading