made imports more robust

This commit is contained in:
2025-05-14 16:09:15 +02:00
parent 0f23e462a8
commit 63f810f42e
2 changed files with 13 additions and 7 deletions

View File

@@ -15,10 +15,16 @@ except PackageNotFoundError: # pragma: no cover
finally:
del version, PackageNotFoundError
try:
from . import utils
from . import plot
from . import analysis
from . import image
from . import channels
from . import uscan
from . import utils
from . import plot
from . import analysis
from . import image
from . import channels
from . import uscan
except (ImportError, ModuleNotFoundError) as e:
# Handle the case where the package is not installed
# or if there are issues with the imports
print(f"Error importing modules: {e}")

View File

@@ -30,7 +30,7 @@ class MySQLiteYStore(SQLiteYStore):
"""
Custom SQL location for jupyter collaboration to avoid NFS locking issues.
"""
suffix = random.randint(1E9, 9E9)
suffix = random.randint(int(1E9), int(9E9))
if os.path.isdir('/scratch'):
# We are on RA and should use the scratch space here
db_path = f"/scratch/ystore_{suffix}.db"