From f5993249baa67b2ebc29b048dacc55f084eb4902 Mon Sep 17 00:00:00 2001 From: Theodor Hansson Date: Mon, 22 May 2023 09:13:17 +0200 Subject: [PATCH] updated hamatsu util import --- equipment/diode_detector.py | 11 ++++++++++- equipment/hamamatsu_s2281.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/equipment/diode_detector.py b/equipment/diode_detector.py index 0c80512..c2fc209 100644 --- a/equipment/diode_detector.py +++ b/equipment/diode_detector.py @@ -1,7 +1,16 @@ import pyvisa -import utils import time +# Dumb code to import utils +try: + import utils +except: + import sys, pathlib + + util_path = str(pathlib.Path(__file__).parent.parent.resolve()) + sys.path.append(util_path) + import utils + _required_arguments = ["gpib_address", "type"] _optional_arguments = {"verbose_printing": 0} diff --git a/equipment/hamamatsu_s2281.py b/equipment/hamamatsu_s2281.py index 1c7e2d8..f3c0548 100644 --- a/equipment/hamamatsu_s2281.py +++ b/equipment/hamamatsu_s2281.py @@ -1,7 +1,16 @@ import pyvisa -import utils import time +# Dumb code to import utils +try: + import utils +except: + import sys, pathlib + + util_path = str(pathlib.Path(__file__).parent.parent.resolve()) + sys.path.append(util_path) + import utils + _required_arguments = ["gpib_address", "type"] _optional_arguments = {"verbose_printing": 0}