Skip to content

Commit

Permalink
Added console to error message
Browse files Browse the repository at this point in the history
  • Loading branch information
EuanPyle committed May 27, 2022
1 parent 912355f commit 93078fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lil_aretomo/aretomo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path
from typing import List, Optional
from rich.console import Console

from .utils import (
prepare_alignment_directory,
Expand All @@ -8,6 +9,7 @@
check_aretomo_availability,
)

console = Console(record=True)

def run_aretomo_alignment(
tilt_series_file: Path,
Expand All @@ -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
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ packages = find:
install_requires =
numpy
typer
rich
python_requires = >=3.7
include_package_data = True
setup_requires =
Expand Down

0 comments on commit 93078fe

Please sign in to comment.