Global -> Logger Handlers
TARDIS log
- tardis_em.utils.logo.print_progress_bar(value: int, max_v: int)
Builder for ASCII type progress bar.
- Parameters:
value (int) – Current value for the progress bar.
max_v (int) – Maximum number of iterations.
- tardis_em.utils.logo.is_interactive()
Simple check if a command line window is from Jupiter.
- class tardis_em.utils.logo.TardisLogo(logo=True)
BUILDER FOR LOG OUTPUT
The log output is built to fit into the given window (cmd or Jupyter) The side Logo is optional and can be removed upon; set the logo to False The title and text are optional.
Example:
log = Tardis_Logo()
log(title=’Example’,
text_1=’Progress bar:’,
text_2=printProgressBar(value=i, max=len(range(10))),
….)
- static clear_output(wait=True)
Clear window output other Jupyter of the command line window.
- Parameters:
wait (bool) – Wait to clear the output until the new output is available to replace it.
- cell_width()
Ask for current shell window width
TARDIS errors
- tardis_em.utils.errors.standard_error_id(id_: str)
Helper function to read MRC header.
- Parameters:
id (str) – Tardis error id.
- exception tardis_em.utils.errors.TardisError(id_='0', py='NA', desc='Unknown exertion occurred!', warning_=True)
MAIN ERROR HANDLER
- Parameters:
id (str) – Standardized error code. See more in documentation
py (str) – .py file location
desc (str) – Error description to pass to the shell
warning (bool) – If True return error and terminate all processes, eles show warning only.
- Returns:
TARDIS Error log
- Return type:
str
- cut_desc(desc: str) Tuple[str, str, str, str, str, str, str, str]
Cut a string of text if too long to fit a shell window.
- Parameters:
desc (str) – Description text.
- Returns:
list of cut string
- Return type:
list[str]