From 289404c669a07cf6f48a9fb5b63aa15c0be6d0f3 Mon Sep 17 00:00:00 2001 From: Alexander Steppke Date: Mon, 3 Apr 2023 16:36:55 +0200 Subject: [PATCH] more tests that rely on /sf fixed --- src/cristallina/utils.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/cristallina/utils.py b/src/cristallina/utils.py index 69fe1d7..04c4058 100644 --- a/src/cristallina/utils.py +++ b/src/cristallina/utils.py @@ -4,6 +4,7 @@ import logging logger = logging.getLogger() import numpy as np +import sfdata from sfdata import SFDataFiles, sfdatafile, SFScanInfo, SFProcFile from xraydb import material_mu from joblib import Parallel, delayed, cpu_count @@ -93,11 +94,15 @@ def print_run_info( print(f"Total file size: {total_size/(1024*1024*1024):.1f} GB\n") - for step in scan: - ch = step.channels - print("\n".join([str(c) for c in ch])) - # print only channels for first step - break + try: + for step in scan: + ch = step.channels + print("\n".join([str(c) for c in ch])) + # print only channels for first step + break + except sfdata.errors.NoUseableFileError: + logger.warning("Cannot access files on /sf...") + def number_of_steps(scan_number_or_scan): """Returns number of steps for a scan object or run number"""