helpers
helpers#
- class ImportButton(callback)[source]#
Bases:
tomopyui.widgets.helpers.ReactiveButtonBaseImport button found throughout the app.
- class MetaCheckbox(description, dictionary, obj, disabled=False, value=False)[source]#
Bases:
object
- class OutputWidgetHandler(*args, **kwargs)[source]#
Bases:
logging.HandlerCustom logging handler sending logs to an output widget
- class ReactiveButtonBase(callback, description='', description_during='', description_after='', icon='', icon_during='fas fa-cog fa-spin fa-lg', icon_after='fa-check-square', button_style='', button_style_during='info', button_style_after='success', style=None, disabled=False, layout=None, tooltip=None, warning="That button click didn't work.")[source]#
Bases:
abc.ABCBase class for a reactive button.
- Parameters
- description: str
Button description, initial.
- description_during: str
Button description, during reaction.
- description_after: str
Button description, during reaction.
- icon: str
FontAwesome icon, initial.
- icon_during: str
FontAwesome icon, during reaction.
- icon_after: str
FontAwesome icon, after reaction.
- button_style: str
Changes button color, initial. Can be “info”, “success”, “”, “warning”, or “danger”
- button_style_during: str
Changes button color, during callback. Can be “info”, “success”, “”, “warning”, or “danger”
- button_style_after: str
Changes button color, after callback. Can be “info”, “success”, “”, “warning”, or “danger”
- class ReactiveTextButton(callback, description, description_during, description_after, warning="That button didn't work.", layout=Layout(align_items='stretch', height='auto', width='auto'))[source]#
- class SwitchOffOnIconButton(callback_on, callback_off, icon)[source]#
Bases:
tomopyui.widgets.helpers.ReactiveButtonBaseSubclass for buttons that turn off and on (green on, grey off).
- debounce(wait)[source]#
Decorator that will postpone a function’s execution until after
waitseconds have elapsed since the last time it was invoked.
- import_module_set_env(import_dict)[source]#
https://stackoverflow.com/questions/1051254/check-if-python-package-is-installed
Safely imports a module or package and sets an environment variable if it imports (or is already imported). This is used in the main function for checking whether or not
cupyis installed. If it is not installed, then options for cuda-enabled functions will be greyed out.