Skip to content

Commit 37f8160

Browse files
committed
fix(drivers): fixed driver import exceptions and names
1 parent b046a2e commit 37f8160

File tree

15 files changed

+50
-12
lines changed

15 files changed

+50
-12
lines changed

pyscan/drivers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .hp import *
1313
from .keithley import *
1414
from .kepco import *
15-
from .oceanoptics import OceanOpticsQEPro
15+
from .oceanoptics import *
1616
from .oxford import *
1717
from .princeton_instruments import *
1818
from .stanford import *
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
from .attocubeANC350 import AttocubeANC350
1+
import sys
2+
3+
name = 'pylablib'
4+
5+
if name in sys.modules:
6+
from .attocubeANC350 import AttocubeANC350
7+
else:
8+
from .attocube_exceptions import PylabLibMissingException as AttocubeANC350
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from ...general.item_attribute import ItemAttribute
2+
from ..exceptions.external_package_excpetion import ExternalPackageException
3+
4+
5+
class PylabLibMissingException(ItemAttribute):
6+
7+
def __init__(self, *arg, **kwarg):
8+
9+
msg = "pylablib module not found in sys.modules, could not load this driver\n"
10+
msg += "re-install pyscan or pip install pylablib"
11+
12+
raise ExternalPackageException(msg)

pyscan/drivers/heliotis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
if name in sys.modules:
66
from .helioscamera import HeliosCamera
77
else:
8-
from .exceptions import HeliosImportException as HeliosCamera
8+
from .helios_exceptions import HeliosImportException as HeliosCamera
File renamed without changes.

pyscan/drivers/keysight/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .keysightm3302adaq import KeysightM3302ADAQ
55
from .keysightm3302aawg import KeysightM3302AAWG
66
else:
7-
from .exceptions import KeysightSD1Error as KeysightM3302ADAQ
8-
from .exceptions import KeysightSD1Error as KeysightM3302AAWG
7+
from .keysite_exceptions import KeysightSD1Error as KeysightM3302ADAQ
8+
from .keysite_exceptions import KeysightSD1Error as KeysightM3302AAWG
99

1010
from .keysight53230a import Keysight53230A
File renamed without changes.
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
from .oceanopticsqepro import OceanOpticsQEPro
1+
import sys
2+
3+
# For illustrative purposes.
4+
name = 'seabreeze'
5+
6+
if name in sys.modules:
7+
from .oceanopticsqepro import OceanOpticsQEPro
8+
else:
9+
from .oceanoptics_exceptions import SeabreezeMissingException as OceanOpticsQEPro
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from ...general.item_attribute import ItemAttribute
2+
from ..exceptions.external_package_excpetion import ExternalPackageException
3+
4+
5+
class SeabreezeMissingException(ItemAttribute):
6+
7+
def __init__(self, *arg, **kwarg):
8+
9+
msg = "seabreeze module not found in sys.modules, could not load this driver\n"
10+
msg += "re-install pyscan or pip install seabreeze"
11+
12+
raise ExternalPackageException(msg)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
try:
22
from .picoharp300 import PicoHarp300
33
except OSError:
4-
from .exceptions import PicoQuantException as PicoHarp300
4+
from .picoquant_exceptions import PicoQuantException as PicoHarp300

0 commit comments

Comments
 (0)