From 93078fee0e1af614aa70835b2be0c60cfff00c38 Mon Sep 17 00:00:00 2001 From: EuanPyle Date: Fri, 27 May 2022 16:12:49 +0100 Subject: [PATCH] Added console to error message --- lil_aretomo/aretomo.py | 8 ++++++-- setup.cfg | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lil_aretomo/aretomo.py b/lil_aretomo/aretomo.py index 054f991..8d82d43 100644 --- a/lil_aretomo/aretomo.py +++ b/lil_aretomo/aretomo.py @@ -1,5 +1,6 @@ from pathlib import Path from typing import List, Optional +from rich.console import Console from .utils import ( prepare_alignment_directory, @@ -8,6 +9,7 @@ check_aretomo_availability, ) +console = Console(record=True) def run_aretomo_alignment( tilt_series_file: Path, @@ -30,7 +32,7 @@ def run_aretomo_alignment( tilt_angles: nominal stage tilt-angles from the microscope. pixel_size: pixel size of the tilt-series in angstroms-per-pixel output_directory: tilt-series directory. - aretomo_executable: path to the AreTomo executable file + (optional) aretomo_executable: path to the AreTomo executable file (optional) local_align: carry out local tilt series alignments? Yes or no, default is no (optional) target_pixel_size: the ideal pixel size at which TSA is carried out. Default is 10A (optional) nominal_rotation_angle: initial estimate for the rotation angle of the tilt @@ -42,7 +44,9 @@ def run_aretomo_alignment( See AreTomo manual for full explanation: this sets -AlignZ. Default is 800. """ if check_aretomo_availability() is False and aretomo_executable is None: - raise RuntimeError('AreTomo executable not found.') + e = 'AreTomo executable not found. Load AreTomo, or provide the path to the executable in the options.' + console.log(f'ERROR: {e}') + raise RuntimeError(e) tilt_series_file = prepare_alignment_directory( tilt_series_file=tilt_series_file, diff --git a/setup.cfg b/setup.cfg index fccb9e6..05c6e9d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,6 +26,7 @@ packages = find: install_requires = numpy typer + rich python_requires = >=3.7 include_package_data = True setup_requires =