From a823e3e9740f160ba2e7fcd56f917b87b5cc4095 Mon Sep 17 00:00:00 2001 From: Alexander Steppke Date: Mon, 3 Apr 2023 15:54:57 +0200 Subject: [PATCH] fix more tests --- src/cristallina/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cristallina/utils.py b/src/cristallina/utils.py index d2a85da..69fe1d7 100644 --- a/src/cristallina/utils.py +++ b/src/cristallina/utils.py @@ -88,8 +88,8 @@ def print_run_info( for file in files_in_step: try: total_size += os.path.getsize(file) - except FileNotFoundError as e: - pass + except (FileNotFoundError, PermissionError) as e: + logger.warning(f"Cannot access {file}.") print(f"Total file size: {total_size/(1024*1024*1024):.1f} GB\n") @@ -98,6 +98,7 @@ def print_run_info( print("\n".join([str(c) for c in ch])) # print only channels for first step break + def number_of_steps(scan_number_or_scan): """Returns number of steps for a scan object or run number""" scan = get_scan_from_run_number_or_scan(scan_number_or_scan)